/* =========================================================
   PAPER HUB FRONT PAGE - OFFICIAL LIQUID GLASS + ZERO LAG
   ========================================================= */

:root {
    --font-main: 'Noto Sans Tamil', sans-serif;
    --text-dark: #0f172a;
    --text-muted: #334155;
    --primary-gradient: linear-gradient(135deg, #2563eb, #7c3aed, #ec4899);

    /* Lightweight Smooth Liquid Glass */
    --glass-surface: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.92);
    --glass-highlight: inset 0 1.5px 1px rgba(255, 255, 255, 0.96), inset 0 -1px 2px rgba(15, 23, 42, 0.05);
    --glass-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --glass-blur: blur(10px) saturate(140%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    color: var(--text-dark);
    background-color: #f8fafc;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Bright Colorful Light Background (Single GPU Layer, No Heavy Blur Blobs) */
.colorful-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 107, 157, 0.28), transparent 40%),
        radial-gradient(circle at 90% 15%, rgba(56, 189, 248, 0.28), transparent 42%),
        radial-gradient(circle at 20% 88%, rgba(250, 204, 21, 0.28), transparent 42%),
        radial-gradient(circle at 85% 82%, rgba(168, 85, 247, 0.26), transparent 42%),
        linear-gradient(135deg, #fffefe 0%, #f1f5f9 55%, #fdf4ff 100%);
    pointer-events: none;
}

/* Official Liquid Glass Base */
.liquid-glass {
    background: var(--glass-surface);
    border: 1.5px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
    border-radius: 24px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.navbar.liquid-glass,
.modal-overlay.show,
.floating-wa-glass,
.btn-liquid-wa {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.liquid-glass-inner {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 14px;
}

.spring-in {
    animation: smoothAppear 0.22s ease-out;
}

@keyframes smoothAppear {
    0% { opacity: 0.35; transform: translate3d(0, 6px, 0); }
    100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Navbar */
.navbar {
    position: sticky;
    top: 12px;
    z-index: 100;
    width: 94%;
    max-width: 1380px;
    margin: 12px auto;
    padding: 12px 22px;
    border-radius: 28px;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: var(--primary-gradient);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.logo-box h1 {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.badge-tamil {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 10px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Liquid Glass WhatsApp Button */
.btn-liquid-wa {
    padding: 9px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(187, 247, 208, 0.65));
    border: 1.5px solid rgba(255, 255, 255, 0.96);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.14), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    color: #14532d;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

.btn-liquid-wa:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(134, 239, 172, 0.78));
}

.wa-icon-glow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
}

.floating-wa-glass {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 99;
    padding: 10px 16px 10px 12px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(187, 247, 208, 0.68));
    border: 1.5px solid rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.18s ease;
}

.floating-wa-glass:hover {
    transform: translateY(-2px);
}

.wa-bubble-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.wa-text-box {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.wa-label { font-size: 0.76rem; font-weight: 800; color: #15803d; }
.wa-num { font-size: 0.9rem; font-weight: 800; color: #064e3b; }

/* Buttons */
.btn-glass {
    padding: 9px 16px;
    border-radius: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

.btn-glass:hover {
    transform: translateY(-2px);
    background: #ffffff;
}

.btn-glass.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
}

.btn-glass.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #6d28d9, #db2777);
    color: #ffffff;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border: none;
}

.full-width { width: 100%; }

/* Container & Hero */
.container {
    width: 94%;
    max-width: 1380px;
    margin: 22px auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero {
    padding: 32px 24px;
    text-align: center;
}

.pill-tag {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
    font-weight: 700;
    font-size: 0.84rem;
    margin-bottom: 10px;
}

.hero h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    max-width: 740px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

/* Grades 1-13 Grid */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.section-head h3 {
    font-size: 1.22rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-pill {
    padding: 6px 14px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #1d4ed8;
}

.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

/* Individual Colorful Liquid Glass Grade Card */
.grade-tile {
    --tile-bg: rgba(255, 255, 255, 0.72);
    --tile-accent: #2563eb;
    --tile-soft: rgba(37, 99, 235, 0.14);

    position: relative;
    padding: 20px 18px;
    border-radius: 24px;
    background: var(--tile-bg);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08), inset 0 1.5px 1px rgba(255, 255, 255, 0.95);
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.grade-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12), inset 0 1.5px 1px rgba(255, 255, 255, 1);
}

.tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tile-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--tile-accent);
    color: #ffffff;
    font-weight: 800;
    font-size: 1.05rem;
    display: grid;
    place-items: center;
}

.tile-section-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--tile-soft);
    color: var(--tile-accent);
}

.tile-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
}

.tile-sub {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
}

.tile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--tile-accent);
    padding-top: 8px;
    border-top: 1px solid rgba(15, 23, 42, 0.07);
}

/* 13 Distinct Bright Colorful Themes (Grade 1 to Grade 13) */
.grade-1  { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(254, 205, 211, 0.52)); --tile-accent: #e11d48; --tile-soft: rgba(225, 29, 72, 0.14); }
.grade-2  { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(254, 215, 170, 0.55)); --tile-accent: #ea580c; --tile-soft: rgba(234, 88, 12, 0.14); }
.grade-3  { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(254, 240, 138, 0.56)); --tile-accent: #ca8a04; --tile-soft: rgba(202, 138, 4, 0.16); }
.grade-4  { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(217, 249, 157, 0.55)); --tile-accent: #65a30d; --tile-soft: rgba(101, 163, 13, 0.14); }
.grade-5  { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(167, 243, 208, 0.56)); --tile-accent: #059669; --tile-soft: rgba(5, 150, 105, 0.14); }
.grade-6  { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(153, 246, 228, 0.56)); --tile-accent: #0d9488; --tile-soft: rgba(13, 148, 136, 0.14); }
.grade-7  { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(165, 243, 252, 0.56)); --tile-accent: #0891b2; --tile-soft: rgba(8, 145, 178, 0.14); }
.grade-8  { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(186, 230, 253, 0.56)); --tile-accent: #0284c7; --tile-soft: rgba(2, 132, 199, 0.14); }
.grade-9  { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(199, 210, 254, 0.58)); --tile-accent: #4f46e5; --tile-soft: rgba(79, 70, 229, 0.14); }
.grade-10 { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(221, 214, 254, 0.58)); --tile-accent: #7c3aed; --tile-soft: rgba(124, 58, 237, 0.14); }
.grade-11 { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(245, 208, 254, 0.58)); --tile-accent: #c026d3; --tile-soft: rgba(192, 38, 211, 0.14); }
.grade-12 { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(251, 207, 232, 0.58)); --tile-accent: #db2777; --tile-soft: rgba(219, 39, 119, 0.14); }
.grade-13 { --tile-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(191, 219, 254, 0.58)); --tile-accent: #1d4ed8; --tile-soft: rgba(29, 78, 216, 0.14); }

/* Footer & Modal */
.footer {
    width: 94%;
    max-width: 1380px;
    margin: 36px auto 22px;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer a { color: #15803d; font-weight: 700; text-decoration: none; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 999;
    display: none;
    place-items: center;
    padding: 16px;
}

.modal-overlay.show { display: grid; }

.modal-box {
    width: 100%;
    max-width: 420px;
    padding: 28px;
    position: relative;
    background: rgba(255, 255, 255, 0.96);
}

.close-modal {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--primary-gradient);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    margin: 0 auto 12px;
}

.modal-box h3 { text-align: center; margin-bottom: 6px; }
.modal-sub { text-align: center; font-size: 0.86rem; color: var(--text-muted); margin-bottom: 16px; }
.input-group { margin-bottom: 12px; }
.input-group label { display: block; font-size: 0.84rem; font-weight: 600; margin-bottom: 5px; }
.input-group input { width: 100%; padding: 11px 14px; border-radius: 13px; border: 1px solid #cbd5e1; background: #ffffff; outline: none; }
.auth-switch { margin-top: 12px; text-align: center; font-size: 0.86rem; }
.auth-switch button { background: none; border: none; color: #2563eb; font-weight: 700; cursor: pointer; text-decoration: underline; }
.user-email-badge { background: #eff6ff; color: #1e40af; padding: 10px; border-radius: 12px; font-weight: 700; font-size: 0.86rem; margin-bottom: 12px; }

/* Responsive Media Queries */
@media (max-width: 600px) {
    .navbar { padding: 11px 14px; border-radius: 22px; }
    .nav-actions span:not(.wa-icon-glow) { display: none; }
    .hero { padding: 22px 16px; }
    .hero h2 { font-size: 1.55rem; }
    .grades-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .wa-text-box { display: none; }
    .floating-wa-glass { padding: 10px; border-radius: 50%; }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .grades-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1920px) {
    .container, .navbar, .footer { max-width: 1760px; }
    .grades-grid { grid-template-columns: repeat(5, 1fr); }
}
/* =========================================================
   MAIN PAGE GRADES GRID - CLEAN RESPONSIVE MEDIA QUERIES
   ========================================================= */

.grades-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    align-items: stretch;
}

.grade-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 20px;
    border-radius: 22px;
}

.grade-card h3,
.grade-card h4,
.grade-card p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Tablet View */
@media (max-width: 1024px) {
    .grades-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

/* Mobile View - Clean Stacked Order */
@media (max-width: 600px) {
    .grades-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .grade-card {
        padding: 16px;
        border-radius: 18px;
        gap: 10px;
    }

    .grade-card .btn-glass,
    .grade-card .btn-liquid-wa,
    .grade-card a {
        width: 100%;
        justify-content: center;
    }
}


.pdf-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 20, 40, 0.65);
  backdrop-filter: blur(20px);
  padding: 20px;
}

.pdf-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-container {
  width: 95%;
  height: 92%;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.pdf-header {
  min-height: 65px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,0.8);
  border-bottom: 1px solid #ddd;
}

.pdf-header h3 {
  font-size: 16px;
  color: #172554;
}

.pdf-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-controls button {
  border: none;
  background: #2563eb;
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 17px;
}

.pdf-controls button:hover {
  background: #1d4ed8;
}

#zoomLevel {
  font-weight: 600;
  color: #172554;
}

.pdf-viewer {
  flex: 1;
  min-height: 0;
  background: #e5e7eb;
}

.pdf-viewer iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Tablet */
@media (max-width: 768px) {
  .pdf-modal {
    padding: 8px;
  }

  .pdf-container {
    width: 100%;
    height: 96%;
    border-radius: 16px;
  }

  .pdf-header {
    flex-wrap: wrap;
    padding: 10px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .pdf-header h3 {
    font-size: 13px;
  }

  .pdf-controls {
    gap: 5px;
  }

  .pdf-controls button {
    padding: 9px 11px;
    font-size: 15px;
  }

  .pdf-modal {
    padding: 0;
  }

  .pdf-container {
    height: 100%;
    border-radius: 0;
  }
}
/* Phone-ல Full Clear Paper Preview (No Lag) */
.paper-preview-box {
  width: 100%;
  height: 78dvh;
  min-height: 420px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-line, rgba(32, 178, 170, 0.25));
  background: #ffffff;
}

.paper-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 600px) {
  .paper-preview-box {
    height: 72dvh;
    min-height: 340px;
  }
}

/* Paper numbers / count badges hide பண்ண */
.paper-number,
.paper-count,
.count-badge,
.item-index {
  display: none !important;
}
/* Hide redundant paper counters across the site */
.paper-number, .paper-count, .count-badge, .item-index, .paper-count-badge { display:none !important; }
