/**
 * Arsvia Sell Form - Frontend Styles
 * 
 * @package ArsviaSellForm
 */

/* Form Container */
.arsvia-form {
  width: 100%;
  margin: 0 auto;
  background: #ffffff00;
  position: relative;
  font-family: "League Spartan";
}

/* Form Sections */
.arsvia-section {
  margin-bottom: 20px;
}

.arsvia-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #322d29;
  padding-bottom: 20px;
  border-bottom: 0px solid #ddd;
}

.arsvia-form-title {
  margin: 0 0 15px 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

.arsvia-form-description {
  margin: 0 0 25px 0;
  font-size: 16px;
  color: #666;
  text-align: center;
  line-height: 1.5;
}

/* Form Fields */
.arsvia-field {
  margin-bottom: 15px;
}

.arsvia-field-textarea {
  margin-bottom: 5px;
}

.arsvia-field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.arsvia-required {
  color: #666;
  margin-left: 3px;
}

/* Input Fields */
.arsvia-input,
.arsvia-textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #d8d3cc;
  font-size: 16px;
  line-height: 1.5;
  color: #322d29;
  background-color: #efe9e1;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

input::placeholder,
textarea::placeholder {
  color: #322d29;
}

.arsvia-input:focus,
.arsvia-textarea:focus {
  outline: none;
  border-color: #355b58;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Removed validation styling - now handled by JavaScript */

/* Textarea specific */
.arsvia-textarea {
  resize: vertical;
  min-height: 60px;
}

/* File Upload */
.arsvia-upload-container {
  width: 100%;
}

.arsvia-upload-button {
  width: 100%;
  padding: 14px 18px;
  border: 2px dashed #d8d3cc;
  background-color: #efe9e1;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: left;
  gap: 12px;
  text-align: center;
  min-height: 40px;
}

.arsvia-upload-button:hover {
  background-color: #ebe4db;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.arsvia-upload-button:active {
  transform: translateY(0);
}

.arsvia-upload-icon {
  font-size: 24px;
  font-weight: bold;
  color: #007cba;
  line-height: 1;
}

.arsvia-upload-text {
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.arsvia-file-input {
  display: none;
}

.arsvia-file-preview {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

.arsvia-file-item {
  position: relative;
  background: #fff;
  border: 1px solid #e1e5e9;
  padding: 10px;
  text-align: center;
  transition: all 0.3s ease;
}

.arsvia-file-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.arsvia-file-thumbnail {
  width: 100%;
  height: 100px;
  object-fit: cover;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #666;
  margin-bottom: 8px;
}

.arsvia-file-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.arsvia-file-name {
  font-size: 12px;
  color: #333;
  font-weight: 500;
  word-break: break-word;
  margin-bottom: 8px;
  line-height: 1.3;
}

.arsvia-file-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  background: #dc3232;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.arsvia-file-remove:hover {
  background: #a00;
  transform: scale(1.1);
}

.arsvia-file-info {
  margin-top: 8px;
  font-size: 14px;
  color: #666;
  display: flex;
  flex-direction: column;
}

/* Checkboxes */
.arsvia-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.arsvia-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.arsvia-checkbox {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 3px;
  background-color: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  transition: all 0.2s ease;
  box-sizing: border-box;
  display: block;
}

.arsvia-checkbox:hover {
  border-color: #355b58;
}

.arsvia-checkbox:checked {
  background-color: #355b58;
  border-color: #355b58;
}

.arsvia-checkbox:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.arsvia-checkbox:focus {
  outline: 2px solid #355b58;
  outline-offset: 2px;
}

.arsvia-checkbox-text {
  flex: 1;
  min-width: 0;
}

.arsvia-checkbox-text a {
  color: #355b58;
  text-decoration: underline;
  display: inline;
  margin: 0;
  padding: 0;
  line-height: inherit;
  vertical-align: baseline;
  white-space: normal;
  word-wrap: normal;
}

.arsvia-checkbox-text a:hover {
  text-decoration: none;
}

.arsvia-checkbox-text strong,
.arsvia-checkbox-text b {
  font-weight: 600;
}

.arsvia-checkbox-text em,
.arsvia-checkbox-text i {
  font-style: italic;
}

/* Turnstile CAPTCHA */
.arsvia-field-turnstile {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.cf-turnstile {
  margin: 0 auto;
}

/* Turnstile widget styling */
.cf-turnstile iframe {
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Field Error Styling */
.arsvia-field-error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.arsvia-field-error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
}

.arsvia-field-error-message::before {
  content: "⚠";
  margin-right: 0.25rem;
}

/* Success Overlay */
.arsvia-success-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.5);
  width: 80%;
  height: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.arsvia-success-content {
  text-align: center;
  color: #333;
  padding: 40px;
}

.arsvia-success-icon {
  width: 80px;
  height: 80px;
  background: #4caf50;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 38px;
  padding-top: 10px;
  color: white;
  font-weight: bold;
  animation: successPulse 0.6s ease-in-out;
}

.arsvia-success-message {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 300px;
}

/* Form Blur Effect */
.arsvia-form-container.arsvia-form-blurred {
  filter: blur(3px);
  transition: filter 0.3s ease;
}

/* Success Icon Animation */
@keyframes successPulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Submit Button */
.arsvia-submit-wrapper {
  text-align: center;
  margin-top: 30px;
}

/* Submit Section */
.arsvia-submit-section {
  text-align: center;
  margin-top: 30px;
}

.arsvia-submit-button {
  background: #355b58; /* Dark green like in the image */
  color: #fff;
  border: none;
  padding: 15px 40px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 150px;
  width: 100%;
  max-width: 200px;
  display: block;
}

.arsvia-submit-button:hover {
  background: #322d29; /* Darker green on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(45, 80, 22, 0.3);
}

.arsvia-submit-button:active {
  transform: translateY(0);
}

.arsvia-submit-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Form Messages */
.arsvia-form-messages {
  margin-top: 20px;
}

.arsvia-message {
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 15px;
}

.arsvia-message-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.arsvia-message-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.arsvia-message-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Loading State */
.arsvia-form.loading .arsvia-submit-button {
  position: relative;
  color: transparent;
}

.arsvia-form.loading .arsvia-submit-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: arsvia-spin 1s linear infinite;
}

@keyframes arsvia-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Field Validation States */
.arsvia-field-error .arsvia-input,
.arsvia-field-error .arsvia-textarea,
.arsvia-field-error .arsvia-file-input {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.arsvia-field-error .arsvia-field-label {
  color: #e74c3c;
}

.arsvia-field-error-message {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 5px;
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .arsvia-form-title {
    font-size: 20px;
  }

  .arsvia-input,
  .arsvia-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .arsvia-submit-button {
    width: 100%;
    padding: 18px 20px;
  }

  .arsvia-upload-button {
    padding: 15px;
    min-height: 60px;
  }

  .arsvia-upload-icon {
    font-size: 20px;
  }

  .arsvia-upload-text {
    font-size: 14px;
  }

  .arsvia-file-preview {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .arsvia-file-thumbnail {
    height: 80px;
  }
}

@media (max-width: 480px) {
  .arsvia-form {
  }

  .arsvia-form-title {
    font-size: 18px;
  }

  .arsvia-form-description {
    font-size: 14px;
  }
}

/* Accessibility */
.arsvia-form *:focus {
  outline: 2px solid #355b58;
  outline-offset: 2px;
}

.arsvia-checkbox:focus,
.arsvia-file-input:focus {
  outline: 2px solid #355b58;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .arsvia-form {
    border: 2px solid #000;
  }

  .arsvia-input,
  .arsvia-textarea {
    border: 2px solid #000;
  }

  .arsvia-submit-button {
    background: #000;
    border: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .arsvia-input,
  .arsvia-textarea,
  .arsvia-file-input,
  .arsvia-submit-button {
    transition: none;
  }

  .arsvia-submit-button:hover {
    transform: none;
  }

  @keyframes arsvia-spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
}

/* Print styles */
@media print {
  .arsvia-form {
    box-shadow: none;
    border: 1px solid #000;
  }

  .arsvia-submit-button {
    background: #fff;
    color: #000;
    border: 1px solid #000;
  }
}
