/* ===== Quiz App — Premium Design System ===== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --info: #06b6d4;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100vh;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #0f172a 100%) !important;
    background-attachment: fixed;
    color: var(--text-primary) !important;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body>.container {
    flex: 1;
}

/* ===== Bootstrap Overrides ===== */
.card,
.card-body,
.card-footer,
.card-header,
.modal-content,
.list-group-item,
.dropdown-menu,
.table,
.table-responsive,
.form-control,
.form-select,
.input-group-text,
.accordion-item,
.accordion-body {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

a {
    color: var(--primary-light);
    text-decoration: none;
}

a:hover {
    color: #c084fc;
}

/* Animated background orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

body::before {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

body::after {
    width: 500px;
    height: 500px;
    background: #ec4899;
    bottom: -150px;
    left: -100px;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -40px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ===== Layout ===== */
.container {
    position: relative;
    z-index: 1;
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border) !important;
    padding: 0.8rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--primary-light), #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.navbar .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    position: relative;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--text-primary) !important;
    background: var(--bg-glass);
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    transform: translateX(-50%);
}

.navbar .nav-link:hover::after {
    width: 60%;
}

/* ===== Glass Card ===== */
.glass-card {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease-out;
}

/* ===== Hero Section ===== */
.hero-section {
    padding: 6rem 0 4rem;
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.hero-section .lead {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.hero-feature .icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border);
}

/* ===== Buttons ===== */
.btn-glow {
    padding: 0.85rem 2.2rem;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn-glow-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-glow-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
    color: #fff;
}

.btn-glow-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-glow-outline:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

.btn-glow-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-glow-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
    color: #fff;
}

/* ===== Quiz Card ===== */
.quiz-card {
    max-width: 700px;
    margin: 2rem auto;
    animation: fadeInUp 0.5s ease-out;
}

.quiz-card .card-header-custom {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    padding: 1.2rem 1.8rem;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-card .card-header-custom h4 {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
    color: #fff;
}

.quiz-card .progress-pill {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.quiz-card .card-body-custom {
    padding: 2rem 1.8rem;
    background: rgba(15, 23, 42, 0.9);
}

.quiz-card .question-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.quiz-card .card-footer-custom {
    padding: 1.2rem 1.8rem;
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.85);
}

/* ===== Custom Form Controls ===== */
.form-check-custom {
    padding: 0.9rem 1.2rem;
    margin-bottom: 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.form-check-custom:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-light);
}

.form-check-custom input[type="radio"],
.form-check-custom input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-custom label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0;
}

.form-control-custom {
    display: block;
    width: 100% !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.85rem 1.1rem !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem !important;
    transition: var(--transition) !important;
}

.form-control-custom:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    outline: none !important;
    background: rgba(99, 102, 241, 0.05) !important;
}

.form-control-custom::placeholder {
    color: var(--text-muted) !important;
}

/* ===== Validation Error ===== */
.validation-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
    animation: slideIn 0.3s ease-out;
}

/* ===== Grid Table ===== */
.grid-section {
    animation: fadeInUp 0.6s ease-out;
}

.grid-section h2 {
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
}

.table-glass {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-glass thead th {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.2rem;
    border: none;
}

.table-glass thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.table-glass thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.table-glass tbody tr {
    transition: var(--transition);
}

.table-glass tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

.table-glass tbody td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.93rem;
    vertical-align: middle;
}

.table-glass tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Badges ===== */
.badge-type {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline-block;
}

.badge-type.single {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.badge-type.multiple {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info);
}

.badge-type.short {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-type.phone {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

.badge-type.long {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* ===== Stat Cards ===== */
.stat-card {
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.stat-card.total {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-card.attempted {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
    border-color: rgba(6, 182, 212, 0.3);
}

.stat-card.correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-card.score {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.3);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.stat-card.total .stat-value {
    color: var(--primary-light);
}

.stat-card.attempted .stat-value {
    color: var(--info);
}

.stat-card.correct .stat-value {
    color: var(--success);
}

.stat-card.score .stat-value {
    color: var(--warning);
}

/* ===== Result Badges ===== */
.result-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.result-badge.correct {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.result-badge.wrong {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.result-badge.na {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

/* ===== Spinner ===== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 0;
    color: var(--text-muted);
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border) !important;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
}

/* ===== Progress Bar ===== */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 0.8rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #c084fc);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.2rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .hero-features {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .quiz-card .card-body-custom {
        padding: 1.5rem 1.2rem;
    }

    .stat-card .stat-value {
        font-size: 1.6rem;
    }
}