/**
 * eyreACT Assessment Integration Styles
 * Синхронизация стилей Assessment модуля с основным сайтом
 */

/* ===== CSS Variables Sync ===== */
:root {
  /* Синхронизация с основным сайтом */
  --assessment-text: var(--text-color, #2b2b2b);
  --assessment-primary: var(--primary, #fafafa);
  --assessment-bg: var(--background-color, #f2f2f2);
  --assessment-accent: var(--accent-color, #2868ed);
  --assessment-accent-hover: var(--accent-hover, #2a71d3);
  --assessment-font: var(--font-1, "DM Sans", sans-serif);
  
  /* Assessment специфичные переменные */
  --assessment-card-bg: #ffffff;
  --assessment-border: #E2E8F0;
  --assessment-muted: #64748B;
  --assessment-success: #10B981;
  --assessment-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  --assessment-radius: 0.75rem;
}

/* ===== Assessment Container ===== */
.assessment-page {
  background: var(--assessment-bg);
}

.assessment-container {
  min-height: calc(100vh - var(--header-height, 96px));
  padding: 0;
  padding-top: var(--header-height, 96px);
  background: var(--assessment-bg);
}

/* ===== Loading State ===== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1.5rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--assessment-border);
  border-top-color: var(--assessment-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  font-family: var(--assessment-font);
  font-size: 1rem;
  color: var(--assessment-muted);
  margin: 0;
}

/* ===== Override Assessment Styles to Match Site ===== */
#eyreact-assessment-root {
  font-family: var(--assessment-font) !important;
  color: var(--assessment-text);
}

/* Button Overrides */
#eyreact-assessment-root button {
  font-family: var(--assessment-font) !important;
  border-radius: var(--assessment-radius);
  transition: all 0.3s ease;
}

#eyreact-assessment-root button:hover {
  transform: translateY(-2px);
}

/* Primary Button Style Match */
#eyreact-assessment-root .btn-primary,
#eyreact-assessment-root [class*="premium-cta-button"],
#eyreact-assessment-root [class*="primary-button"] {
  background: var(--assessment-accent) !important;
  color: white !important;
  border: none;
}

#eyreact-assessment-root .btn-primary:hover,
#eyreact-assessment-root [class*="premium-cta-button"]:hover,
#eyreact-assessment-root [class*="primary-button"]:hover {
  background: var(--assessment-accent-hover) !important;
}

/* Card Styles Match */
#eyreact-assessment-root [class*="card"],
#eyreact-assessment-root [class*="option-card"] {
  background: var(--assessment-card-bg);
  border: 1px solid var(--assessment-border);
  border-radius: var(--assessment-radius);
  box-shadow: var(--assessment-shadow);
}

#eyreact-assessment-root [class*="card"]:hover,
#eyreact-assessment-root [class*="option-card"]:hover {
  border-color: var(--assessment-accent);
  box-shadow: 0 8px 16px -4px rgba(40, 104, 237, 0.1);
}

/* Input Styles Match - DISABLED to allow premium-form-footer styles */
/* COMMENTED OUT: These styles conflict with .premium-form-footer
#eyreact-assessment-root input[type="text"],
#eyreact-assessment-root input[type="email"],
#eyreact-assessment-root textarea,
#eyreact-assessment-root select {
  font-family: var(--assessment-font) !important;
  border: 1px solid var(--assessment-border);
  border-radius: calc(var(--assessment-radius) * 0.75);
  padding: 0.75rem 1rem;
  background: var(--assessment-card-bg);
  color: var(--assessment-text);
  transition: border-color 0.3s ease;
}

#eyreact-assessment-root input:focus,
#eyreact-assessment-root textarea:focus,
#eyreact-assessment-root select:focus {
  border-color: var(--assessment-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(40, 104, 237, 0.1);
}
*/

/* Progress Bar Match */
#eyreact-assessment-root [class*="progress"] {
  background: var(--assessment-border);
  border-radius: 9999px;
  overflow: hidden;
}

#eyreact-assessment-root [class*="progress-bar"],
#eyreact-assessment-root [class*="progress"] > div {
  background: var(--assessment-accent);
}

/* Typography Match */
#eyreact-assessment-root h1,
#eyreact-assessment-root h2,
#eyreact-assessment-root h3,
#eyreact-assessment-root h4,
#eyreact-assessment-root h5,
#eyreact-assessment-root h6 {
  font-family: var(--assessment-font) !important;
  color: var(--assessment-text);
  font-weight: 600;
}

#eyreact-assessment-root p {
  font-family: var(--assessment-font) !important;
  color: var(--assessment-text);
  line-height: 1.6;
}

/* Success States */
#eyreact-assessment-root [class*="success"],
#eyreact-assessment-root [class*="checkmark"] {
  color: var(--assessment-success);
}

/* Accent Color Applications */
#eyreact-assessment-root [class*="accent"],
#eyreact-assessment-root a {
  color: var(--assessment-accent);
}

#eyreact-assessment-root a:hover {
  color: var(--assessment-accent-hover);
  text-decoration: none;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .assessment-container {
    padding: 0;
  }
  
  #eyreact-assessment-root {
    font-size: 15px;
  }
  
  #eyreact-assessment-root h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
  
  #eyreact-assessment-root h3 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }
}

@media (max-width: 480px) {
  .loading-state {
    min-height: 300px;
  }
  
  .loading-spinner {
    width: 36px;
    height: 36px;
  }
}

/* ===== Smooth Transitions ===== */
#eyreact-assessment-root * {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Footer Spacing for Assessment Page ===== */
.assessment-page .minimal-footer {
  margin-top: 0;
}

/* ===== Ensure Proper Z-index Layering ===== */
#eyreact-assessment-root [class*="floating"],
#eyreact-assessment-root [class*="podcast-player"] {
  z-index: 1000;
}

#header {
  z-index: 2000;
}

/* ===== Animation Overrides for Smooth Experience ===== */
@media (prefers-reduced-motion: reduce) {
  #eyreact-assessment-root *,
  #eyreact-assessment-root *::before,
  #eyreact-assessment-root *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Print Styles ===== */
@media print {
  #header,
  .minimal-footer,
  #eyreact-assessment-root [class*="podcast-player"],
  #eyreact-assessment-root [class*="floating"] {
    display: none !important;
  }
  
  .assessment-container {
    padding: 0;
  }
}
