/* ==========================================================================
   Rafenthic Academy — custom design system
   Loaded alongside the Tailwind Play CDN (see layouts/*.blade.php).
   This file defines component classes Tailwind doesn't generate on its own
   (buttons, cards, badges, tables, form controls, the admin shell, etc).
   No build step required — safe for hosts that can't run `npm run build`.
   ========================================================================== */

:root {
    --color-primary: #6A00F4;
    --color-primary-dark: #530CB8;
    --color-primary-light: #8A2BFF;
    --color-secondary: #0f172a;
    --color-accent: #F59E0B;
    --color-accent-dark: #D97706;
    --bg: #f8fafc;
    --surface: #ffffff;
    --muted: #64748b;
    --border: #e2e8f0;
    --text: #0f172a;

    --admin-bg: #0c0a18;
    --admin-sidebar-bg: #110c22;
    --admin-surface: #17122b;
    --admin-surface-hover: #1e1838;
    --admin-surface-solid: #150c29;
    --admin-border: rgba(255, 255, 255, 0.08);
    --admin-border-strong: rgba(255, 255, 255, 0.14);
    --admin-text: #f4f2ff;
    --admin-muted: #938aad;

    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.12);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.font-heading { font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; letter-spacing: -0.02em; }

/* ---------- Layout primitives ---------- */
.container { width: min(100% - 2rem, 1200px); margin: 0 auto; }
.section { padding: 4rem 0; }
.section-sm { padding: 2.5rem 0; }
.text-hero { font-size: clamp(2.25rem, 4vw, 4.25rem); line-height: 1.05; }
.text-muted { color: var(--muted); }
.text-primary { color: var(--color-primary); }
.bg-primary-soft { background: rgba(106, 0, 244, 0.08); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 900px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn, .btn-primary, .btn-secondary, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.925rem;
    border: none;
    cursor: pointer;
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
    line-height: 1.2;
}
.btn { background: rgba(15, 23, 42, 0.06); color: var(--text); }
.btn:hover { background: rgba(15, 23, 42, 0.1); }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 8px 20px -8px rgba(106, 0, 244, 0.55); }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-2px); box-shadow: 0 12px 24px -8px rgba(106, 0, 244, 0.6); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: rgba(106, 0, 244, 0.06); color: var(--color-primary-dark); border: 1px solid rgba(106, 0, 244, 0.15); }
.btn-secondary:hover { background: rgba(106, 0, 244, 0.12); transform: translateY(-1px); border-color: rgba(106, 0, 244, 0.3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }
.app-shell .btn-secondary { background: var(--admin-surface-hover); color: var(--admin-text); border-color: var(--admin-border-strong); }
.app-shell .btn-secondary:hover { background: #251d47; border-color: rgba(255, 255, 255, 0.22); }
.app-shell .btn-danger { box-shadow: 0 8px 20px -10px rgba(220, 38, 38, 0.5); }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.card:has(a:hover), a.card:hover {
    border-color: rgba(106, 0, 244, 0.25);
    box-shadow: 0 16px 32px -16px rgba(106, 0, 244, 0.25);
}
.app-shell .card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
    box-shadow: 0 20px 40px -28px rgba(0, 0, 0, 0.6);
    border-radius: 1rem;
}
.app-shell .card:has(a:hover), .app-shell a.card:hover { border-color: rgba(168, 130, 255, 0.35); box-shadow: 0 20px 40px -20px rgba(106, 0, 244, 0.35); }

/* ---------- Badges & status pills ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text);
}
.badge-primary { background: rgba(106, 0, 244, 0.12); color: var(--color-primary-dark); }
.badge-secondary { background: rgba(15, 23, 42, 0.08); color: var(--muted); }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-rejected { background: var(--danger-bg); color: var(--danger); }
.app-shell .badge { font-weight: 700; }
.app-shell .badge-primary { background: rgba(138, 43, 255, 0.2); color: #c9a6ff; }
.app-shell .status-approved { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
.app-shell .status-pending { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.app-shell .status-rejected { background: rgba(248, 113, 113, 0.16); color: #f87171; }
.badge-lg { padding: 0.55rem 1.1rem; font-size: 0.8rem; }

/* ---------- Definition-style detail rows (review/detail pages) ---------- */
.detail-list { display: flex; flex-direction: column; }
.detail-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1.25rem; padding: 0.7rem 0; border-bottom: 1px solid var(--admin-border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--admin-muted); font-weight: 700; flex-shrink: 0; }
.detail-value { font-size: 0.925rem; color: #fff; font-weight: 600; text-align: right; }
.detail-value.text-muted-value { color: var(--admin-muted); font-weight: 500; }

/* ---------- Contained, click-to-enlarge screenshot thumbnail ---------- */
.screenshot-thumb-wrap {
    display: block;
    width: 100%;
    max-width: 240px;
    border-radius: 0.9rem;
    overflow: hidden;
    border: 1px solid var(--admin-border);
    cursor: pointer;
    transition: border-color 150ms ease, transform 150ms ease;
    background: rgba(0, 0, 0, 0.2);
}
.screenshot-thumb-wrap:hover { border-color: rgba(168, 130, 255, 0.5); transform: translateY(-2px); }
.screenshot-thumb-wrap img { display: block; width: 100%; height: 170px; object-fit: cover; object-position: top; }
.screenshot-thumb-caption { display: block; text-align: center; font-size: 0.75rem; font-weight: 600; padding: 0.5rem; color: var(--admin-muted); background: rgba(255, 255, 255, 0.03); }

/* ---------- Danger zone ---------- */
.danger-zone { border-top: 1px dashed rgba(248, 113, 113, 0.3); }
.danger-zone-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #f87171; }

/* ---------- Forms ---------- */
label, .form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.app-shell label, .app-shell .form-label { color: var(--admin-text); }

.input, .select, .textarea {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: 0.9rem;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.925rem;
    font-family: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.input::placeholder, .textarea::placeholder { color: #94a3b8; }
.input-with-icon { padding-right: 2.75rem; }
.input[type="file"] {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--muted);
}
.input[type="file"]::file-selector-button {
    margin-right: 0.85rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.6rem;
    border: none;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease;
}
.input[type="file"]::file-selector-button:hover { background: var(--color-primary-dark); }
.app-shell .input[type="file"] { color: var(--admin-muted); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(106, 0, 244, 0.35); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(106, 0, 244, 0.14);
}
.input:disabled, .select:disabled, .textarea:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
.select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; -webkit-appearance: none; appearance: none; padding-right: 2.75rem; }
.app-shell .input, .app-shell .select, .app-shell .textarea {
    background: rgba(0, 0, 0, 0.22);
    border: 1.5px solid var(--admin-border-strong);
    color: var(--admin-text);
}
.app-shell .input:hover, .app-shell .select:hover, .app-shell .textarea:hover { border-color: rgba(168, 130, 255, 0.45); }
.app-shell .input:disabled, .app-shell .select:disabled, .app-shell .textarea:disabled { background: rgba(0, 0, 0, 0.12); color: var(--admin-muted); }
.textarea { resize: vertical; min-height: 6rem; }

.form-group { margin-bottom: 1.25rem; }
.form-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 0.4rem; font-weight: 500; }

.checkbox-row { display: flex; align-items: flex-start; gap: 0.65rem; font-size: 0.9rem; color: var(--text); }
input[type="checkbox"], input[type="radio"] {
    width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; flex-shrink: 0;
    accent-color: var(--color-primary); cursor: pointer;
}

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 0.9rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tbody tr { transition: background 150ms ease; }
.table tbody tr:hover { background: rgba(106, 0, 244, 0.03); }
.app-shell .table th, .app-shell .table td { border-bottom: 1px solid var(--admin-border); padding: 1rem 1.1rem; }
.app-shell .table th { color: var(--admin-muted); background: rgba(255, 255, 255, 0.02); }
.app-shell .table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.app-shell .table tbody tr:last-child td { border-bottom: none; }

/* ---------- Admin shell ---------- */
.app-shell { display: flex; min-height: 100vh; background: var(--admin-bg); }
.sidebar {
    width: 272px;
    flex-shrink: 0;
    background: var(--admin-sidebar-bg);
    border-right: 1px solid var(--admin-border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.sidebar .brand { font-weight: 700; font-size: 1.1rem; margin: 0.25rem 0.5rem 1.75rem; color: #fff; }
.nav-group { display: flex; flex-direction: column; gap: 0.2rem; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    color: var(--admin-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 2px solid transparent;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.nav-link svg { flex-shrink: 0; opacity: 0.85; }
.nav-link:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-link.active { background: rgba(106, 0, 244, 0.16); color: #e4d6ff; border-left-color: var(--color-primary-light); }
.nav-link.active svg { opacity: 1; }
.nav-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 9999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}
.nav-badge.pulse { animation: nav-badge-pulse 900ms ease-in-out 2; }
@keyframes nav-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.35); }
}

/* ---------- Collapsible sidebar sections (Students / Teachers / Affiliates) ---------- */
.nav-collapsible summary.nav-link { cursor: pointer; }
.nav-collapsible summary.nav-link::-webkit-details-marker { display: none; }
.nav-collapsible summary.nav-link::marker { content: ""; }
.nav-chevron { flex-shrink: 0; opacity: 0.6; transition: transform 150ms ease; }
.nav-collapsible[open] > summary .nav-chevron { transform: rotate(180deg); }
.nav-submenu { display: flex; flex-direction: column; gap: 0.1rem; padding-left: 2.4rem; margin: 0.15rem 0 0.4rem; }
.nav-sublink {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    color: var(--admin-muted);
    transition: background 150ms ease, color 150ms ease;
}
.nav-sublink:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-sublink.active { background: rgba(106, 0, 244, 0.14); color: #e4d6ff; font-weight: 600; }
.nav-subcount { font-size: 0.72rem; font-weight: 700; color: var(--admin-muted); }
.nav-sublink.active .nav-subcount { color: #c9a6ff; }
.nav-submenu-scroll { display: flex; flex-direction: column; gap: 0.1rem; max-height: 12rem; overflow-y: auto; padding-right: 0.25rem; }

.sidebar-footer { margin-top: auto; padding-top: 1.25rem; border-top: 1px solid var(--admin-border); font-size: 0.8rem; color: var(--admin-muted); }
.main { flex: 1; min-width: 0; padding: 2.5rem; color: var(--admin-text); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--admin-border); flex-wrap: wrap; }
.page-title { font-size: 1.55rem; font-weight: 700; color: #fff; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
.app-shell .text-muted { color: var(--admin-muted); }

/* ---------- Two-step account+payment checklist (Students review page) ---------- */
.checklist-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.checklist-pill { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.5rem 1rem 0.5rem 0.6rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.checklist-pill .checklist-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; border-radius: 999px; font-size: 0.7rem; line-height: 1; flex-shrink: 0; }
.checklist-done { background: var(--success-bg); color: var(--success); }
.checklist-done .checklist-icon { background: var(--success); color: #fff; }
.checklist-pending { background: var(--warning-bg); color: var(--warning); }
.checklist-pending .checklist-icon { background: var(--warning); color: #fff; }
.checklist-rejected { background: var(--danger-bg); color: var(--danger); }
.checklist-rejected .checklist-icon { background: var(--danger); color: #fff; }
.checklist-muted { background: rgba(148, 163, 184, 0.12); color: var(--muted); }
.checklist-muted .checklist-icon { background: rgba(148, 163, 184, 0.4); color: #fff; }
.app-shell .checklist-done { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
.app-shell .checklist-pending { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.app-shell .checklist-rejected { background: rgba(248, 113, 113, 0.16); color: #f87171; }
.app-shell .checklist-muted { background: rgba(255, 255, 255, 0.06); color: var(--admin-muted); }
.enrollment-card { border-radius: 1rem; border: 1px solid var(--admin-border); padding: 1.35rem; background: rgba(255, 255, 255, 0.015); transition: border-color 150ms ease; }
.enrollment-card + .enrollment-card { margin-top: 1.25rem; }

/* ---------- Scroll-reveal (public homepage) ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Homepage cards: image zoom + lift on hover ---------- */
.hover-lift { transition: transform 280ms ease, box-shadow 280ms ease, border-color 280ms ease; }
.hover-lift:hover { transform: translateY(-6px); box-shadow: 0 24px 48px -20px rgba(15, 23, 42, 0.18); }
.img-zoom { overflow: hidden; }
.img-zoom img { transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1); }
.img-zoom:hover img { transform: scale(1.08); }

/* ---------- Modal / lightbox ---------- */
.thumb-img { width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: 0.6rem; transition: transform 150ms ease; }
.thumb-img:hover { transform: scale(1.05); }
.full-img { max-width: 100%; border-radius: 0.85rem; }
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(11, 7, 22, 0.75);
    display: flex; align-items: center; justify-content: center; padding: 2rem; z-index: 50;
}
.modal-backdrop.hidden { display: none; }
.modal { max-width: 32rem; width: 100%; }

/* ---------- Curriculum drag handle ---------- */
.drag-handle { cursor: grab; color: var(--admin-muted); font-size: 1.1rem; }

/* ---------- Header / footer ---------- */
.navbar { background: transparent; }
.site-footer { padding: 48px 0; background: #0b0716; color: #fff; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr 1.15fr; gap: 24px; }
.footer-map { width: 100%; height: 9rem; border: 0; border-radius: 0.85rem; margin-top: 0.75rem; filter: grayscale(0.3) invert(0.92) contrast(0.9); }
.footer-map:hover { filter: none; }
.footer-col h4 { margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { transition: color 150ms ease; }
.footer-links a:hover { color: #d5baff; }
.footer-description, .footer-note { color: rgba(255,255,255,0.65); font-size: 0.9rem; line-height: 1.6; }
.social-links { display: flex; gap: 0.6rem; margin-top: 1rem; }
.social-link {
    width: 2.25rem; height: 2.25rem; border-radius: 9999px;
    background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center;
    transition: background 150ms ease, transform 150ms ease;
}
.social-link:hover { background: var(--color-primary); transform: translateY(-2px); }
.footer-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.75rem; }
.platform-link { display: inline-flex; align-items: center; gap: 0.5rem; color: rgba(255,255,255,0.85); font-size: 0.9rem; transition: color 150ms ease; }
.platform-link:hover { color: #d5baff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 2.5rem; padding-top: 1.5rem; }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; font-size: 0.85rem; color: rgba(255,255,255,0.6); padding: 0 !important; max-width: none !important; }
.footer-bottom-inner a:hover { color: #fff; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; background: transparent; padding: 12px 0; }
.marquee-track { display: flex; gap: 36px; animation: marquee 18s linear infinite; white-space: nowrap; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--admin-border); }
    .sidebar .brand { margin-bottom: 0; margin-right: auto; }
    .sidebar-footer { display: none; }
    .main { padding: 1.5rem; }
}
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; }
    .hero-grid { grid-template-columns: 1fr; }
    .grid-2.stats-grid { grid-template-columns: repeat(2, 1fr); }
}
