/**
 * Feedback Form Component
 * Minimal component-specific styles - most styling inherited from base/forms.css
 *
 * @package LearningByHart
 * @since 2.0.0
 */

/* ==========================================================================
   Container & Card
   ========================================================================== */

.feedback-form-container {
  margin: var(--space-3xl) 0;
  clear: both; /* Prevent wrapping around floated content above */
}

.feedback-form-card {
  padding: var(--space-2xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

/* Form heading and intro now use standard h3 and p tags */

/* ==========================================================================
   Accordion/Concertina Toggle
   ========================================================================== */

.feedback-form-header {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.feedback-form-header:hover {
  opacity: 0.9;
}

.feedback-form-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-primary);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: 1;
  transition: transform var(--transition-base);
}

.feedback-form-toggle:hover {
  color: var(--color-primary-dark);
}

.feedback-form-toggle-icon {
  display: block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  transition: transform var(--transition-base);
}

/* When expanded, rotate the icon to show minus */
.feedback-form-header[aria-expanded="true"] .feedback-form-toggle-icon {
  transform: rotate(45deg);
}

/* Collapsible content area */
.feedback-form-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.feedback-form-content[aria-hidden="false"] {
  max-height: 2000px; /* Large enough to accommodate form */
  transition: max-height 0.5s ease-in;
}

/* Add spacing when expanded */
.feedback-form-header[aria-expanded="true"] {
  margin-bottom: var(--space-lg);
}

/* ==========================================================================
   Honeypot Field (Hidden)
   ========================================================================== */

.feedback-form__field--honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* Privacy notice now uses .notice class from base/typography.css */

/* ==========================================================================
   Form Actions (Submit Button)
   ========================================================================== */

.feedback-form__actions {
  margin-top: var(--space-2xl);
}

/* Button styling fully inherited from base/forms.css and components/ui/button.css */

/* ==========================================================================
   Status Messages
   ========================================================================== */

.feedback-form__messages {
  margin-top: var(--space-lg);
}

.feedback-form__messages:empty {
  display: none;
}

/* Messages use p.is-style-notice for base typography, only add colors */
.feedback-form__messages p {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-form__message--success {
  background: var(--color-bg-alt);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-border);
}

.feedback-form__message--error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid var(--color-error-border);
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.feedback-form--loading .wp-block-button__link {
  opacity: 0.6;
  cursor: wait;
  position: relative;
}

.feedback-form--loading .wp-block-button__link::after {
  content: '';
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .feedback-form-card {
    padding: var(--space-xl);
  }

  .feedback-form__actions .wp-block-button {
    width: 100%;
  }

  .feedback-form__actions .wp-block-button__link {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .feedback-form-container {
    display: none;
  }
}
