/* 
  Easy Math Print — Signature Edition (Reverted & Polished)
  - 1200px Golden Layout
  - Data-Driven Architecture
*/

/* ── Global Canvas ── */
body {
  background: linear-gradient(160deg, #f0f9ff 0%, #ffffff 40%, #f0fdf4 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 38px,
      rgba(37, 99, 235, 0.018) 38px,
      rgba(37, 99, 235, 0.018) 39px
    );
  pointer-events: none;
  z-index: -1;
}

/* ── Header ── */
.site-header {
  height: 80px;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--site-border);
}

.header-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--site-text);
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--site-text), var(--site-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Hero (The Wow Version with Contained Box) ── */
.hero {
  padding: 40px 0;
}

.hero-container {
  background: linear-gradient(135deg, var(--site-primary-light, #eff6ff) 0%, #f0fdf4 100%);
  border-radius: var(--radius-lg);
  padding: 60px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  border: 4px solid white;
  box-shadow: var(--shadow-xl);
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 32px;
  letter-spacing: -0.04em;
}

.hero-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.stat-item {
  background: white;
  padding: 16px;
  border-radius: 12px;
  flex: 1;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--site-primary);
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--site-text-muted);
  font-weight: 600;
}

.hero-illustration {
  width: 100%;
  max-width: 480px;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.1));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

/* ── Detail Page (The Perfect 1200px Stack) ── */
.detail-content-area {
  max-width: 1200px;
  margin: 0 auto;
}

.intro-content-card,
.guide-content-card {
  background: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--site-border);
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
  line-height: 1.8;
}

#detail-atom-mount {
  background: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--site-border);
  margin-bottom: 40px;
}

/* Problem Grid (3-Col centered) */
.problems-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 30px !important;
  margin-top: 20px !important;
}

/* Problem Box (Single Line Fill-in-the-blank) */
.problem {
  background: white !important;
  border: 1px solid #f1f5f9 !important;
  border-radius: 12px !important;
  padding: 24px 32px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}

.problem:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--site-primary-light) !important;
}

.problem .num_wrap {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: var(--site-text) !important;
  white-space: nowrap !important;
}

/* The Underline Input Style */
.answer-input {
  flex: 0 0 100px !important;
  /* Fixed width for the blank */
  height: 40px !important;
  margin-top: 5px !important;
  /* Visual alignment with baseline */
  padding: 0 8px !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid #cbd5e1 !important;
  /* The blank line */
  border-radius: 0 !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: var(--site-primary) !important;
  text-align: center !important;
  transition: all 0.2s ease !important;
}

.answer-input:focus {
  border-bottom-color: var(--site-primary, #2563eb) !important;
  background: rgba(37, 99, 235, 0.03) !important;
  outline: none !important;
}

.answer-input::placeholder {
  color: transparent !important;
}

/* ── Breadcrumbs ── */
.breadcrumb {
}

.breadcrumb ol {
  display: flex;
  list-style: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--site-text-muted);
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin: 0 12px;
  opacity: 0.3;
}

.breadcrumb a {
  color: var(--site-primary);
  text-decoration: none;
}

/* ── Home Categories ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  margin: 60px 0;
}

.category-card {
  background: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--site-border);
  text-decoration: none;
  color: var(--site-text);
  transition: var(--transition-normal);
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--site-primary);
}

.category-icon-box {
  width: 56px;
  height: 56px;
  background: var(--site-primary-light);
  color: var(--site-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.category-icon-box svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--site-primary);
  color: white;
  padding: 16px 36px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
}

.btn-primary:hover {
  background: var(--site-primary-hover);
  transform: translateY(-2px);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 20px;
  text-align: center;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--site-text-muted);
  margin-bottom: 60px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   Phase 1 Interaction Styles
   ═══════════════════════════════════════════════════════════ */

/* Feedback mode toggle */
.ia-feedback-mode-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-card, #f8fafc);
  border-radius: var(--ia-radius, 8px);
  border: 1px solid var(--border-color, #e2e8f0);
}

/* Input validation feedback */
.input-correct {
  border-color: var(--ia-success-color, #22c55e) !important;
  background: rgba(34, 197, 94, 0.06) !important;
}

.input-incorrect {
  border-color: var(--ia-error-color, #ef4444) !important;
  background: rgba(239, 68, 68, 0.06) !important;
}

/* Feedback icons */
.feedback-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.feedback-icon--correct {
  color: var(--ia-success-color, #22c55e);
}

.feedback-icon--incorrect {
  color: var(--ia-error-color, #ef4444);
}

/* Challenge mode panel */
.ia-game-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}

/* Print suppression for interaction elements */
@media print {
  .ia-feedback-mode-toggle,
  .ia-game-controls,
  .check-plugin-wrapper,
  .ia-data-panel,
  .ia-daily-challenge {
    display: none !important;
  }
}