/* ============================================================
   FSAC Scholar — Landing Page (index.css) — v4.1
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   1. TOKENS
   ============================================================ */
:root {
    --transition-fast: 0.18s ease;
    --transition-norm: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm:   8px;
    --radius-md:  14px;
    --radius-lg:  20px;
    --radius-xl:  28px;
    --radius-pill: 999px;
    --header-h:   64px;
}

[data-theme="dark"] {
    --bg:           #090c12;
    --bg-card:      rgba(15, 18, 28, 0.8);
    --bg-elevated:  #141826;
    --border:       rgba(255,255,255,0.07);
    --border-hi:    rgba(255,255,255,0.12);
    --text:         #eef2ff;
    --text-muted:   #7882a0;
    --text-subtle:  #3a4060;
    --primary:      #6366f1;
    --primary-rgb:  99, 102, 241;
    --primary-glow: rgba(99,102,241,0.25);
    --success:      #10b981;
    --header-bg:    rgba(9,12,18,0.8);
    --orb-1:        rgba(99,102,241,0.15);
    --orb-2:        rgba(139,92,246,0.12);
    --sk-bg:        rgba(255,255,255,0.05);
}

[data-theme="light"] {
    --bg:           #f2f5fb;
    --bg-card:      rgba(255,255,255,0.9);
    --bg-elevated:  #ffffff;
    --border:       rgba(0,0,40,0.08);
    --border-hi:    rgba(0,0,40,0.15);
    --text:         #0d1117;
    --text-muted:   #4b5563;
    --text-subtle:  #9ca3af;
    --primary:      #4f46e5;
    --primary-rgb:  79, 70, 229;
    --primary-glow: rgba(79,70,229,0.2);
    --success:      #059669;
    --header-bg:    rgba(242,245,251,0.85);
    --orb-1:        rgba(79,70,229,0.08);
    --orb-2:        rgba(124,58,237,0.06);
    --sk-bg:        rgba(0,0,0,0.05);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background var(--transition-norm), color var(--transition-norm);
}

/* ============================================================
   3. BACKGROUND
   ============================================================ */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.orb-1 {
    top: -10%;  left: -5%;
    width: 500px; height: 500px;
    background: var(--orb-1);
    animation: drift 24s ease-in-out infinite alternate;
}

.orb-2 {
    bottom: -15%; right: -10%;
    width: 600px; height: 600px;
    background: var(--orb-2);
    animation: drift 30s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(50px,40px) scale(1.06); }
}

/* ============================================================
   4. HEADER
   ============================================================ */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
    gap: 16px;
    transition: background var(--transition-norm);
}

header.scrolled {
    box-shadow: 0 4px 30px rgba(0,0,0,0.12);
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.brand-logo {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hi);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-logo img { width: 30px; height: 30px; object-fit: contain; }
.brand-logo i { color: var(--primary); font-size: 1.1rem; }

.brand-text { display: flex; flex-direction: column; gap: 1px; }

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: -0.2px;
    line-height: 1;
}

.brand-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* Nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: flex-end;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-card);
    border-color: var(--border);
}

.nav-link.nav-admin {
    background: var(--bg-card);
    border-color: var(--border);
}

.nav-link.nav-admin:hover {
    background: var(--text);
    color: var(--bg);
    border-color: transparent;
}

/* Theme btn */
.btn-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 0.92rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.btn-icon:hover {
    color: var(--text);
    background: var(--bg-card);
    border-color: var(--border-hi);
}

/* Mobile menu btn */
.mobile-menu-btn {
    display: none;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Mobile Drawer */
.mobile-drawer {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 999;
    flex-direction: column;
    padding: 10px 16px 16px;
    gap: 4px;
    animation: slideDown 0.2s ease;
}

.mobile-drawer.open { display: flex; }

.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    text-align: left;
    transition: var(--transition-fast);
}

.drawer-link:hover { background: var(--bg-card); color: var(--text); }

.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: rgba(0,0,0,0.3);
    z-index: 998;
}

.drawer-overlay.open { display: block; }

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

/* ============================================================
   5. PAGE HEADER (replaces hero)
   ============================================================ */
main {
    flex: 1;
    padding-top: var(--header-h);
    display: flex;
    flex-direction: column;
}

.page-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.page-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.75rem clamp(1.25rem, 4vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text);
    margin-bottom: 3px;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Training shortcut card on right */
.training-shortcut {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-hi);
    background: linear-gradient(120deg,
        rgba(16,185,129,0.08) 0%,
        rgba(99,102,241,0.06) 100%
    );
    text-decoration: none;
    color: inherit;
    transition: var(--transition-norm);
    flex-shrink: 0;
    min-width: 0;
}

.training-shortcut:hover {
    border-color: rgba(16,185,129,0.4);
    background: linear-gradient(120deg,
        rgba(16,185,129,0.14) 0%,
        rgba(99,102,241,0.10) 100%
    );
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.ts-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: #10b981;
    flex-shrink: 0;
    transition: transform var(--transition-norm);
}

.training-shortcut:hover .ts-icon {
    transform: scale(1.1) rotate(-5deg);
}

.ts-text { display: flex; flex-direction: column; gap: 2px; }

.ts-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.ts-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.ts-arrow {
    color: var(--text-subtle);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: transform var(--transition-norm), color var(--transition-norm);
}

.training-shortcut:hover .ts-arrow {
    color: #10b981;
    transform: translateX(4px);
}

/* ============================================================
   6. FILTER BAR
   ============================================================ */
.filter-bar {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--header-h);
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.filter-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem clamp(1.25rem, 4vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.fstat { display: flex; align-items: center; gap: 6px; }

.fstat-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.active-dot { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.soon-dot   { background: var(--text-subtle); }
.fstat-sep  { color: var(--border-hi); }

.filter-search {
    position: relative;
    flex-shrink: 0;
}

.filter-search i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    font-size: 0.8rem;
    pointer-events: none;
}

.filter-search input {
    padding: 7px 14px 7px 32px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    width: 220px;
    transition: var(--transition-fast);
}

.filter-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-search input::placeholder { color: var(--text-subtle); }

/* ============================================================
   7. MASTERS GRID
   ============================================================ */
.grid-wrap {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 4rem;
}

.masters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Master Card */
.master-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-norm);
    opacity: 0;
    transform: translateY(20px);
}

.master-card.animate-in {
    animation: fadeUp 0.45s cubic-bezier(0.4,0,0.2,1) forwards;
}

/* Color accent line top */
.master-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--card-color, var(--primary));
    opacity: 0.6;
    transition: opacity var(--transition-norm);
}

.master-card:hover {
    border-color: var(--border-hi);
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}

[data-theme="light"] .master-card:hover {
    box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}

.master-card:hover::before { opacity: 1; }

/* Card top row */
.mc-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.mc-icon {
    width: 44px; height: 44px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform var(--transition-norm);
    border: 1px solid;
}

.master-card:hover .mc-icon { transform: scale(1.08) rotate(-4deg); }

.mc-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.mc-badge.active {
    background: rgba(16,185,129,0.12);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.25);
}

.mc-badge.soon {
    background: var(--sk-bg);
    color: var(--text-subtle);
    border: 1px solid var(--border);
}

/* Card body */
.mc-acronym {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--card-color, var(--primary));
    margin-bottom: 5px;
}

.mc-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 5px;
    letter-spacing: -0.1px;
}

.mc-prof {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    flex: 1;
    margin-bottom: 1rem;
}

/* Card footer */
.mc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 700;
}

.mc-footer-label {
    color: var(--card-color, var(--primary));
}

.mc-footer i {
    color: var(--text-subtle);
    font-size: 0.75rem;
    transition: transform var(--transition-norm), color var(--transition-norm);
}

.master-card:hover .mc-footer i {
    transform: translateX(4px);
    color: var(--card-color, var(--primary));
}

/* Coming soon cards */
.master-card.coming-soon {
    opacity: 0.4 !important;
    pointer-events: none;
}

.master-card.coming-soon::before { opacity: 0.2; }

/* Skeleton */
.skeleton-card {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

.sk {
    border-radius: 6px;
    background: var(--sk-bg);
    animation: pulse 1.5s ease-in-out infinite;
    margin-bottom: 10px;
}

.sk-badge { width: 52px; height: 20px; border-radius: var(--radius-pill); }
.sk-icon  { width: 44px; height: 44px; border-radius: 11px; margin: 8px 0; }
.sk-title { height: 18px; width: 80%; }
.sk-text  { height: 13px; width: 60%; }

@keyframes pulse {
    0%,100% { opacity:0.5; }
    50%      { opacity:1; }
}

/* No results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.no-results i { font-size: 2rem; opacity: 0.5; }
.no-results p { font-size: 0.92rem; }

/* ============================================================
   8. FOOTER
   ============================================================ */
footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-subtle);
    font-weight: 500;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--text); }

/* ============================================================
   9. ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
    from { opacity:0; transform:translateY(20px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ============================================================
   10. RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
    .header-nav  { display:none; }
    .btn-icon    { display:none; }
    .mobile-menu-btn { display:flex; }
    .brand-sub   { display:none; }
    .training-shortcut { display:none; }
}

@media (max-width: 600px) {
    .filter-bar-inner { flex-direction:column; align-items:flex-start; gap:0.5rem; }
    .filter-search input { width:100%; }
    .filter-search { width:100%; }
    .masters-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction:column; text-align:center; }
    .footer-links { justify-content:center; }
}
