/**
 * BFFW Frontend Form Styles
 * 
 * Styles for the custom frontend editing form
 * 
 * @package Hestia_Child
 * @since 1.0.0
 */

/* Form Container */
.bffw-frontend-form-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bffw-form-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.bffw-form-header h2 {
  color: #333;
  font-size: 28px;
  margin-bottom: 10px;
  font-weight: 600;
}

.bffw-form-header p {
  color: #666;
  font-size: 16px;
  margin: 0;
}

/* Form Sections */
.bffw-form-section {
  margin-bottom: 40px;
  padding: 25px;
  background: #f9f9f9;
  border-radius: 6px;
  border-left: 4px solid rgb(63, 83, 69);
}

.bffw-form-section h3 {
  color: #333;
  font-size: 20px;
  margin: 0 0 20px 0;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.bffw-form-section h4 {
  color: #555;
  font-size: 16px;
  margin: 0 0 15px 0;
  font-weight: 600;
}

/* Form Fields */
.bffw-form-field {
  margin-bottom: 20px;
}

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

.bffw-form-field input[type="text"],
.bffw-form-field input[type="email"],
.bffw-form-field input[type="tel"],
.bffw-form-field input[type="url"],
.bffw-form-field select,
.bffw-form-field textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.bffw-form-field input:focus,
.bffw-form-field select:focus,
.bffw-form-field textarea:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.bffw-form-field input[readonly] {
  background-color: #f5f5f5;
  color: #666;
}

.bffw-form-field .description {
  margin-top: 5px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* Form Rows */
.bffw-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* Checkbox Groups */
.bffw-checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.bffw-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.bffw-checkbox-label:hover {
  background-color: #f0f0f0;
}

.bffw-checkbox-label input[type="checkbox"] {
  margin-right: 10px;
  width: auto;
}

.bffw-checkbox-text {
  font-size: 14px;
  color: #333;
}

/* Map Container */
.bffw-map-container {
  margin: 20px 0;
}

#bffw-frontend-map {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bffw-map-controls {
  margin: 15px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bffw-map-controls .button {
  padding: 8px 16px;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.bffw-map-controls .button:hover {
  background: #005a87;
}

/* Coordinates Group */
.bffw-coordinates-group {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

/* Hide lat/lng inputs but keep them functional */
.bffw-coordinates-group .form-field {
  display: none;
}

/* Region Groups */
.bffw-region-group-container {
  margin-top: 20px;
}

.bffw-region-groups-container {
  margin-bottom: 15px;
}

.bffw-region-group-entry {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
}

.bffw-region-group-fields {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 15px;
  align-items: end;
}

.bffw-region-group-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 15px;
}

.bffw-region-group-actions .button {
  padding: 8px 16px;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.bffw-region-group-actions .button:hover {
  background: #005a87;
}

.bffw-remove-region-group {
  background: #dc3232 !important;
  padding: 6px 10px !important;
}

.bffw-remove-region-group:hover {
  background: #c92626 !important;
}

/* Current Logo */
.bffw-current-logo {
  margin: 15px 0;
  text-align: center;
}

.bffw-current-logo img {
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bffw-current-logo p {
  margin: 10px 0 0 0;
  font-size: 12px;
  color: #666;
}

/* Form Actions */
.bffw-form-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
}

.bffw-submit-btn {
  padding: 15px 30px;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bffw-submit-btn:hover {
  background: #005a87;
}

.bffw-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.bffw-cancel-btn {
  padding: 15px 30px;
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease;
  display: inline-block;
}

.bffw-cancel-btn:hover {
  background: #e0e0e0;
  text-decoration: none;
}

/* Messages */
.bffw-messages {
  margin: 20px 0;
}

.bffw-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 15px;
  border-radius: 4px;
  font-weight: 600;
}

.bffw-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 15px;
  border-radius: 4px;
  font-weight: 600;
}

.bffw-field-error {
  color: #dc3232;
  font-size: 12px;
  margin-top: 5px;
  font-weight: 600;
}

.bffw-form-field.bffw-has-error input,
.bffw-form-field.bffw-has-error select,
.bffw-form-field.bffw-has-error textarea {
  border-color: #dc3232;
}

/* Loading States */
.bffw-btn-loading {
  display: none;
}

.bffw-submit-btn:disabled .bffw-btn-loading {
  display: inline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .bffw-frontend-form-container {
    padding: 15px;
    margin: 10px;
  }

  .bffw-form-section {
    padding: 20px;
    margin-bottom: 30px;
  }

  .bffw-form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .bffw-coordinates-group {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .bffw-region-group-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .bffw-checkbox-group {
    grid-template-columns: 1fr;
  }

  .bffw-form-actions {
    flex-direction: column;
    align-items: center;
  }

  .bffw-submit-btn,
  .bffw-cancel-btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .bffw-map-controls {
    flex-direction: column;
  }

  .bffw-map-controls .button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .bffw-form-header h2 {
    font-size: 24px;
  }

  .bffw-form-section h3 {
    font-size: 18px;
  }

  .bffw-form-field input,
  .bffw-form-field select,
  .bffw-form-field textarea {
    padding: 10px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Accessibility */
.bffw-form-field label:focus-within {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

.bffw-checkbox-label:focus-within {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .bffw-form-section {
    border: 2px solid #000;
  }

  .bffw-form-field input,
  .bffw-form-field select,
  .bffw-form-field textarea {
    border: 2px solid #000;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .bffw-form-field input,
  .bffw-form-field select,
  .bffw-form-field textarea,
  .bffw-submit-btn,
  .bffw-cancel-btn {
    transition: none;
  }
}
