/* ============================================
   DESIGN SYSTEM - Bank Soal Otomatis
   ============================================ */

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

:root {
    --primary:       #6366f1;
    --primary-dark:  #4f46e5;
    --primary-light: #818cf8;
    --secondary:     #64748b;
    --success:       #10b981;
    --danger:        #ef4444;
    --warning:       #f59e0b;
    --bg:            #0f0f1a;
    --bg-card:       #1a1a2e;
    --bg-card2:      #16213e;
    --border:        rgba(255,255,255,0.08);
    --text:          #e2e8f0;
    --text-muted:    #94a3b8;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

footer { margin-top: auto !important; }

/* Wrapper konten halaman publik agar footer tidak jauh */
body > nav + * { flex: 1 0 auto; }
.page-wrapper { flex: 1 0 auto; }

/* ============================================
   NAVBAR
   ============================================ */
#mainNav {
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0.75rem 0;
}

#mainNav .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

#mainNav .navbar-brand .brand-text {
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: -0.3px;
    background: linear-gradient(90deg, #fff 0%, #818cf8 25%, #c084fc 50%, #f472b6 75%, #fff 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: brandShine 3s linear infinite;
}

@keyframes brandShine {
    0%   { background-position: 0% center; }
    100% { background-position: 300% center; }
}

#mainNav .nav-link {
    color: rgba(255,255,255,0.65);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.08);
}

.nav-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-nav-cta {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border: none;
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-nav-cta:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}

#mainNav .dropdown-menu {
    background: #1e1e35;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
}

#mainNav .dropdown-item {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

#mainNav .dropdown-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    color: white;
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.shape-1 {
    width: 500px; height: 500px;
    background: var(--primary);
    top: -150px; right: -100px;
    animation: floatShape 8s ease-in-out infinite;
}

.shape-2 {
    width: 300px; height: 300px;
    background: #8b5cf6;
    bottom: -100px; left: -50px;
    animation: floatShape 10s ease-in-out infinite reverse;
}

.shape-3 {
    width: 200px; height: 200px;
    background: #06b6d4;
    top: 50%; left: 40%;
    animation: floatShape 6s ease-in-out infinite;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-30px) scale(1.05); }
}

.min-vh-75 { min-height: 75vh; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    color: var(--primary-light);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: clamp(1.2rem, 1.5vw, 1.7rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.3px;
    margin: 1rem 0;
    word-break: keep-all;
}

.hero-gradient {
    background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    color: rgba(255,255,255,0.6);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 480px;
}

.btn-hero-primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
}

.btn-hero-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.5);
}

.btn-hero-secondary {
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid rgba(255,255,255,0.15);
    padding: 0.85rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    backdrop-filter: blur(10px);
}

.btn-hero-secondary:hover {
    color: white;
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.hero-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.hero-stat-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.hero-stat-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-4px);
    border-color: rgba(99,102,241,0.3);
}

.hero-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.25rem;
}

/* ============================================
   SECTION STYLES
   ============================================ */
.section-categories {
    padding: 5rem 0;
    background: #f8fafc;
}

.section-features {
    padding: 5rem 0;
    background: white;
}

.section-tag {
    display: inline-block;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    color: var(--primary);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.section-desc {
    color: #64748b;
    font-size: 1rem;
}

/* ============================================
   CATEGORY CARDS
   ============================================ */
.category-card-new {
    display: block;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.category-card-new::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s;
}

.category-card-new:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(99,102,241,0.15);
    border-color: var(--primary);
    color: white;
}

.category-card-new:hover::before { opacity: 1; }
.category-card-new:hover .cat-icon-new,
.category-card-new:hover .cat-name,
.category-card-new:hover .cat-desc,
.category-card-new:hover .cat-count { color: white !important; position: relative; z-index: 1; }

.cat-icon-new {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    transition: color 0.3s;
}

.cat-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
    transition: color 0.3s;
}

.cat-desc {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
    transition: color 0.3s;
    line-height: 1.4;
}

.cat-count {
    font-size: 0.78rem;
    color: #94a3b8;
    position: relative;
    z-index: 1;
    transition: color 0.3s;
}

/* ============================================
   FEATURE CARDS
   ============================================ */
.feature-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: transparent;
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
}

.feature-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.feature-desc {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    top: -200px; right: -200px;
    pointer-events: none;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}

.auth-header { text-align: center; margin-bottom: 2rem; }

.auth-logo {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 25px rgba(99,102,241,0.4);
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: rgba(255,255,255,0.45);
    font-size: 0.875rem;
    margin: 0;
}

.auth-label {
    display: block;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.3);
    font-size: 0.875rem;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    color: white;
    font-size: 0.9rem;
    transition: all 0.2s;
    outline: none;
}

.auth-input::placeholder { color: rgba(255,255,255,0.25); }

.auth-input:focus {
    border-color: var(--primary);
    background: rgba(99,102,241,0.08);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.auth-eye {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.auth-eye:hover { color: rgba(255,255,255,0.7); }

.btn-auth-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.85rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.5);
}

.auth-footer-text {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.875rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.auth-footer-text a {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-text a:hover { text-decoration: underline; }

/* ============================================
   ADMIN LAYOUT
   ============================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.admin-sidebar .sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    display: block;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
    border-left: 3px solid var(--primary);
}

.admin-sidebar .nav-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    margin-top: 1rem;
}

.admin-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    background: #f8fafc;
}

.admin-topbar {
    background: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.admin-main { padding: 1.5rem; }

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    color: var(--secondary);
    font-size: 0.85rem;
}

/* ============================================
   QUESTION CARDS (latihan)
   ============================================ */
.question-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.question-number {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.question-card p { line-height: 1.6; flex: 1; min-width: 0; }

.option-label {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.option-label:hover  { border-color: var(--primary); background: #eff6ff; }
.option-label.selected { border-color: var(--primary); background: #eff6ff; }
.option-label.correct  { border-color: var(--success); background: #f0fdf4; }
.option-label.wrong    { border-color: var(--danger);  background: #fef2f2; }

.option-label span:last-child { flex: 1; min-width: 0; line-height: 1.5; }
.option-label .badge { flex-shrink: 0; font-size: 0.7rem; white-space: nowrap; }

.option-badge {
    background: #e2e8f0;
    color: #475569;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* ============================================
   FORM CARD
   ============================================ */
.form-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #3730a3);
    transform: translateY(-1px);
}

/* ============================================
   TIMER
   ============================================ */
.exam-timer {
    background: #1e293b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: monospace;
}

.exam-timer.warning { background: var(--warning); }
.exam-timer.danger  { background: var(--danger); animation: pulse 1s infinite; }

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

/* ============================================
   BADGE DIFFICULTY
   ============================================ */
.badge-easy   { background: #dcfce7; color: #166534; }
.badge-medium { background: #fef9c3; color: #854d0e; }
.badge-hard   { background: #fee2e2; color: #991b1b; }

/* ============================================
   TABLE
   ============================================ */
.table-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-card .table { margin-bottom: 0; }

.table-card .table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

/* ============================================
   GENERATE PROGRESS
   ============================================ */
.generate-progress {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.progress-step {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

.progress-step.active { color: var(--primary); font-weight: 500; }
.progress-step.done   { color: var(--success); }
.progress-step .step-icon { width: 24px; margin-right: 0.75rem; text-align: center; }

/* ============================================
   LOADING
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero-title { font-size: clamp(1.6rem, 5vw, 2.2rem); }
    .hero-stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .hero-stat-card { padding: 1rem; }
    .hero-stat-value { font-size: 1.5rem; }

    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-content { margin-left: 0; }
    .admin-topbar { padding: 0.75rem 1rem; }
    .admin-main { padding: 1rem; }

    .form-card { padding: 1.25rem; }
    .question-card { padding: 1rem; }
    .option-label { padding: 0.6rem 0.75rem; font-size: 0.9rem; }
    .auth-card { padding: 1.75rem; }
    .table-card { overflow-x: auto; }
}

@media (max-width: 576px) {
    .hero-title { font-size: clamp(1.4rem, 6vw, 1.8rem); }
    .hero-section { padding: 4rem 0 3rem; }
    .section-categories, .section-features { padding: 3rem 0; }
    .btn-hero-primary, .btn-hero-secondary { width: 100%; justify-content: center; }
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.8);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    filter: brightness(10);
}
