/*
 * Custom styles for Quiz System
 * Author: Ashiqur Jubaier
 * NASTech Business Solution
 */

/* ===== Sidebar: dark indigo gradient ===== */
.app-sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
}
.app-sidebar .sidebar-brand {
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.app-sidebar .nav-header {
    color: rgba(255,255,255,0.4) !important;
    letter-spacing: 0.05em;
}
.app-sidebar .nav-link {
    color: rgba(255,255,255,0.7) !important;
    border-radius: 6px;
    margin: 2px 8px;
    transition: all 0.2s ease;
}
.app-sidebar .nav-link:hover {
    color: #fff !important;
    background: rgba(99,102,241,0.15) !important;
}
.app-sidebar .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.app-sidebar .nav-treeview .nav-link {
    margin-left: 16px;
}

/* ===== Header: accent top border ===== */
.app-header {
    border-top: 3px solid #6366f1 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ===== Cards: subtle shadow + rounded ===== */
.card {
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    overflow: hidden;
}
.card .card-header {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* ===== Small box icons: proper alignment ===== */
.small-box {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.small-box .icon {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 3.5rem;
    opacity: 0.2;
    line-height: 1;
}
.small-box .icon i {
    font-size: inherit;
}

/* ===== Content area background ===== */
.app-main {
    background: #f1f5f9;
}

/* ===== Table header styling ===== */
.table thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

/* ===== Footer ===== */
.app-footer {
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* ===== Pre-loader ===== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #1e293b23 0%, #0f172a5c 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}
.preloader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(99,102,241,0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.preloader-text {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin-top: 16px;
    letter-spacing: 0.05em;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Required field asterisk ===== */
.form-label .text-danger {
    font-weight: bold;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Cards fade-in-up */
.card {
    animation: fadeInUp 0.5s ease both;
}
.row > [class*="col-"]:nth-child(1) .card { animation-delay: 0.05s; }
.row > [class*="col-"]:nth-child(2) .card { animation-delay: 0.1s; }
.row > [class*="col-"]:nth-child(3) .card { animation-delay: 0.15s; }
.row > [class*="col-"]:nth-child(4) .card { animation-delay: 0.2s; }

/* Small-box stat cards */
.small-box {
    animation: fadeInUp 0.5s ease both;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.small-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.row > [class*="col-"]:nth-child(1) .small-box { animation-delay: 0.05s; }
.row > [class*="col-"]:nth-child(2) .small-box { animation-delay: 0.15s; }
.row > [class*="col-"]:nth-child(3) .small-box { animation-delay: 0.25s; }
.row > [class*="col-"]:nth-child(4) .small-box { animation-delay: 0.35s; }

/* Card hover lift */
.card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

/* Table rows fade-in */
.table tbody tr {
    animation: fadeIn 0.4s ease both;
}
.table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.table tbody tr:nth-child(2) { animation-delay: 0.08s; }
.table tbody tr:nth-child(3) { animation-delay: 0.11s; }
.table tbody tr:nth-child(4) { animation-delay: 0.14s; }
.table tbody tr:nth-child(5) { animation-delay: 0.17s; }
.table tbody tr:nth-child(6) { animation-delay: 0.20s; }
.table tbody tr:nth-child(7) { animation-delay: 0.23s; }
.table tbody tr:nth-child(8) { animation-delay: 0.26s; }
.table tbody tr:nth-child(9) { animation-delay: 0.29s; }
.table tbody tr:nth-child(10) { animation-delay: 0.32s; }

/* Breadcrumb fade-in */
.content-header {
    animation: fadeIn 0.4s ease both;
}

/* Badge pulse on hover */
.badge {
    transition: transform 0.2s ease;
}
.badge:hover {
    transform: scale(1.08);
}

/* Button hover lift */
.btn {
    transition: all 0.2s ease;
}
.btn:hover {
    transform: translateY(-1px);
}

/* Alert slide-in */
.alert {
    animation: fadeInUp 0.4s ease both;
}

/* ===== Quiz Attempt Page ===== */
body.quiz-mode { user-select: none; -webkit-user-select: none; }
.question-card { border-left: 4px solid #007bff; }
.option-label { cursor: pointer; padding: 10px 15px; border: 2px solid #dee2e6; border-radius: 8px; margin-bottom: 8px; transition: all 0.2s; display: block; }
.option-label:hover { border-color: #007bff; background-color: #f0f7ff; }
.form-check-input:checked + .option-label { border-color: #007bff; background-color: #e7f1ff; font-weight: 500; }
.question-nav.answered { background-color: #198754 !important; border-color: #198754 !important; color: #fff !important; }
.question-nav.current { box-shadow: 0 0 0 3px rgba(13,110,253,0.4); }
/* Fix sticky sidebar - AdminLTE parent containers have overflow that breaks position:sticky */
.app-wrapper, .app-main, .app-content, .app-content > .container-fluid { overflow: visible !important; }
