/* =====================================================================
 * HOME PAGE GREETING — "Kem Cho, Students" + "Padhai Mode On" (all screens)
 * On phones it is the first thing on the page, above the exam countdown.
 * ===================================================================== */
.home-greeting {
  text-align: center;
  margin: 0.25rem auto 1.25rem auto;
}
.home-greeting-title {
  margin: 0 !important;
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: clamp(2rem, 8vw, 3.1rem) !important;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #7c3aed 0%, #c026d3 45%, #ec4899 75%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.home-wave {
  display: inline-block;
  -webkit-text-fill-color: initial;
  color: initial;
  transform-origin: 70% 80%;
  animation: homeWave 2.6s ease-in-out infinite;
}
@keyframes homeWave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(16deg); }
  20%, 40% { transform: rotate(-8deg); }
}
.home-motto {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.7rem 0 0 0;
  padding: 0.38rem 1rem 0.38rem 0.45rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1.5px solid rgba(124, 58, 237, 0.18);
  box-shadow: 0 3px 0 rgba(76, 29, 149, 0.12), 0 10px 20px -12px rgba(76, 29, 149, 0.45);
  font-family: var(--font-display, 'Inter', sans-serif);
  font-weight: 700;
  font-size: clamp(0.95rem, 3.6vw, 1.1rem);
  letter-spacing: 0.01em;
  color: var(--ink, #1e1b4b);
}
/* Little green "ON" switch */
.home-motto-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 21px;
  border-radius: 999px;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.home-motto-switch > span {
  position: absolute;
  top: 2.5px;
  right: 2.5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
@media (prefers-reduced-motion: reduce) {
  .home-wave { animation: none; }
}

/* =====================================================================
 * HOME PAGE — ONE-SCREEN DESKTOP LAYOUT (index.html only)
 * ---------------------------------------------------------------------
 * Laptops / desktops (at least 1100px wide and 560px tall):
 *   LEFT  = Boards Exam Countdown (Grade 10 / Grade 12 switch)
 *   RIGHT = Welcome, Grade 10 + Grade 12 cards, AI Evaluation + Help Desk
 * Everything fits on one screen. Phones and tablets are NOT affected.
 * To go back to the old layout, remove the <link href="home-desktop.css"> line.
 * ===================================================================== */

@media (min-width: 1100px) and (min-height: 560px) {

  /* ---------- Two-column frame that fills the screen below the header ---------- */
  main.main-content {
    display: grid !important;
    grid-template-columns: minmax(420px, 0.72fr) 1.28fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(0.75rem, 1.6vh, 1.25rem) clamp(1rem, 1.6vw, 1.75rem);
    align-items: stretch;
    height: calc(100vh - var(--home-header-h, 72px));
    height: calc(100dvh - var(--home-header-h, 72px));
    /* Full width, so the countdown sits in the top-left corner */
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(0.75rem, 2vh, 1.25rem) clamp(1rem, 2vw, 2rem) !important;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Header matches the full width (logo in the left corner, buttons in the right corner) */
  .site-header .header-inner {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
    padding-left: clamp(1rem, 2vw, 2rem) !important;
    padding-right: clamp(1rem, 2vw, 2rem) !important;
  }

  /* ---------- TOP RIGHT: greeting ---------- */
  #home-greeting {
    grid-column: 2;
    grid-row: 1;
    margin: 0 !important;
  }
  #home-greeting .home-greeting-title {
    font-size: clamp(2rem, 3vw, 3rem) !important;
  }
  #home-greeting .home-motto { margin-top: 0.5rem; }

  /* ---------- LEFT: countdown panel — only as tall as its content, pinned top-left ---------- */
  #countdown-stage {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    margin: 0 !important;
    max-width: none !important;
    height: auto !important;
    max-height: 100%;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #exam-countdown {
    flex: 0 1 auto;
    height: auto !important;
    min-height: 0 !important;
    padding: clamp(0.75rem, 1.8vh, 1.15rem) 1rem !important;
    gap: 0.55rem !important;
    overflow: hidden;
  }
  /* Grade 10 / Grade 12 switch (same as on phones) — one grade at a time fits the height */
  #mobile-grade-tabs {
    display: flex !important;
    max-width: none !important;
    margin: 0 !important;
  }
  #boards-schedules-grid {
    display: block !important;
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;          /* only on very short screens */
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: thin;
  }
  /* "#boards-schedules-grid" makes these win over the countdown's own built-in styles */
  #boards-schedules-grid .schedule-column {
    padding: 0.65rem 0.8rem !important;
    gap: 0.4rem !important;
  }
  #boards-schedules-grid .exams-timeline {
    gap: 0.3rem !important;
  }
  #boards-schedules-grid .exam-item-card {
    padding: 0.4rem 0.7rem !important;
    gap: 0.12rem !important;
    /* No 3D tilt inside this compact list (it made the list scroll by a few pixels) */
    transform: none !important;
  }
  #boards-schedules-grid .exam-gap-divider {
    padding: 0.1rem 0.5rem !important;
    font-size: 0.72rem !important;
  }
  /* The exam timing is already shown under the title → hide the repeated bottom note */
  .schedule-footer-bar {
    display: none !important;
  }

  /* ---------- RIGHT (below the greeting): cards ---------- */
  main.main-content > section.hero {
    grid-column: 2;
    grid-row: 2;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: clamp(0.6rem, 1.6vh, 1rem) clamp(0.8rem, 1.4vw, 1.25rem);
    text-align: center;
    align-content: stretch;
  }

  /* Grade 10 + Grade 12 side by side */
  section.hero > div:not([id]) {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: clamp(0.8rem, 1.4vw, 1.25rem) !important;
    margin: 0 !important;
    min-height: 0;
  }
  section.hero > div:not([id]) > a.submit-card {
    max-width: none !important;
    height: 100%;
    min-height: 0;
    padding: clamp(0.75rem, 2vh, 1.4rem) 1rem !important;
    gap: clamp(0.3rem, 1vh, 0.75rem) !important;
  }
  section.hero > div:not([id]) > a.submit-card > span:first-child {
    font-size: clamp(2rem, 4.5vh, 3rem) !important;
  }
  section.hero > div:not([id]) > a.submit-card h2 {
    font-size: clamp(1.25rem, 1.8vw, 1.7rem) !important;
  }

  /* AI Evaluation + Help Desk side by side */
  #ai-checking-section,
  #student-helpdesk-section {
    grid-row: 2;
    max-width: none !important;
    margin: 0 !important;
    min-height: 0;
    padding: clamp(0.75rem, 2vh, 1.25rem) clamp(0.85rem, 1.4vw, 1.25rem) !important;
    gap: clamp(0.35rem, 1vh, 0.7rem) !important;
    justify-content: center;
  }
  #ai-checking-section { grid-column: 1; }
  #student-helpdesk-section { grid-column: 2; }
  #ai-checking-section h2,
  #student-helpdesk-section h2 {
    font-size: clamp(1.05rem, 1.35vw, 1.35rem) !important;
  }
  #ai-checking-section p,
  #student-helpdesk-section p {
    font-size: clamp(0.78rem, 0.9vw, 0.9rem) !important;
    line-height: 1.4 !important;
  }
  #nerd-tutors-eval-btn,
  #student-helpdesk-section a {
    font-size: 0.92rem !important;
    padding: 0.65rem 1.1rem !important;
  }

  /* The page itself does not need to scroll */
  .mobile-footer { display: none !important; }
}

/* Very short screens: hide the long descriptions so the cards still fit */
@media (min-width: 1100px) and (min-height: 560px) and (max-height: 620px) {
  #ai-checking-section p,
  #student-helpdesk-section p,
  section.hero > div:not([id]) > a.submit-card p {
    display: none !important;
  }
}
