/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-modal: #ffffff;
    --border-glass: rgba(99, 102, 241, 0.12);
    --text-main: #0f172a;
    --text-muted: #475569;
    --primary: #4f46e5;
    --secondary: #9333ea;
    --accent: #0d9488;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --primary-grad: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    --accent-grad: linear-gradient(135deg, #2563eb 0%, #0d9488 100%);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --font-outfit: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(147, 51, 234, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    overflow-x: hidden;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(79, 70, 229, 0.12);
}

/* Glass Buttons */
.btn-premium {
    background: var(--primary-grad);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.4);
    color: #fff;
}

.btn-glass-secondary {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-main);
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-glass-secondary:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-main);
}

/* Inputs and Forms Styling */
.form-control, .form-select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-main) !important;
    border-radius: 10px;
    padding: 11px 16px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

.form-label {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

/* Typography Gradient */
.text-gradient-primary {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.text-gradient-accent {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* Tables Styling */
.table {
    color: var(--text-main) !important;
}

.table th {
    background-color: rgba(0, 0, 0, 0.02) !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--text-muted) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.8px;
}

.table td {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 16px 12px;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.015) !important;
}

/* Badges */
.badge-custom {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Timeline Layout */
.status-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 30px 0;
    padding: 0 20px;
}

.status-timeline::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    z-index: 1;
}

.timeline-step {
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 3px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.timeline-step.active .timeline-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.3);
}

.timeline-step.completed .timeline-icon {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.timeline-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.timeline-step.active .timeline-text {
    color: var(--text-main);
    font-weight: 600;
}

/* Left Sidebar Navigation */
.sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border-glass);
    min-height: 100vh;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding-top: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

.sidebar-brand {
    padding: 0 24px 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    margin: 4px 16px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted) !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-link i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 10px;
}

.sidebar-link:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary) !important;
}

.sidebar-item.active .sidebar-link {
    background: var(--primary-grad);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    color: #fff !important;
}

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

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Exam Timer Alert Box */
.timer-box {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Make small-sized and muted text readable in light mode */
.text-muted, .form-text, small, .timeline-text {
    color: var(--text-muted) !important;
}

/* Make placeholder text legible in light mode */
::placeholder {
    color: #94a3b8 !important;
    opacity: 0.8;
}
::-webkit-input-placeholder {
    color: #94a3b8 !important;
}
:-ms-input-placeholder {
    color: #94a3b8 !important;
}
::-ms-input-placeholder {
    color: #94a3b8 !important;
}

/* Modal Content overrides for hardcoded dark inline styles in templates */
.modal-content {
    background: var(--bg-modal) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-main) !important;
}
.modal-content.text-white {
    color: var(--text-main) !important;
}
.modal-content .text-white {
    color: var(--text-main) !important;
}
.modal-header, .modal-footer {
    border-color: rgba(0, 0, 0, 0.06) !important;
}
.modal-content .btn-close-white {
    filter: invert(1) !important; /* Invert white close button to dark */
}

/* Dropdown Menu overrides for hardcoded dark inline styles in templates */
.dropdown-menu {
    background: var(--bg-modal) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-main) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}
.dropdown-menu-dark {
    background: var(--bg-modal) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-main) !important;
}
.dropdown-item {
    color: var(--text-main) !important;
}
.dropdown-item:hover {
    background: rgba(79, 70, 229, 0.05) !important;
    color: var(--primary) !important;
}
.dropdown-divider {
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Adjust heading and label text contrast for light theme cards */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main) !important;
}

.glass-card h1, .glass-card h2, .glass-card h3, .glass-card h4, .glass-card h5, .glass-card h6,
.modal-content h1, .modal-content h2, .modal-content h3, .modal-content h4, .modal-content h5, .modal-content h6,
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.card-title {
    color: var(--text-muted) !important;
}

/* Shift navbar and make sidebar responsive */
@media (min-width: 992px) {
    body:has(.sidebar) .navbar {
        margin-left: 260px;
        width: calc(100% - 260px);
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 260px;
        height: 100vh;
        z-index: 1040;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
    .sidebar.active {
        left: 0;
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.2);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 1035;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 20px;
    }
}

/* Badge Color and Contrast Enhancements */
.badge {
    font-weight: 600 !important;
}

.badge.bg-success,
.badge.bg-secondary,
.badge.bg-danger,
.badge.bg-primary,
.badge.bg-info,
.badge.bg-warning,
.badge.bg-dark {
    color: #ffffff !important;
}

.badge.bg-opacity-10,
.badge.bg-opacity-20,
.badge.bg-opacity-25 {
    /* Ensure opacity background badges without explicit text class default to text-main color */
    color: var(--text-main);
}

/* Site Footer Styling */
.site-footer {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-top: 1px solid rgba(99, 102, 241, 0.08) !important;
    color: var(--text-main);
    font-size: 0.9rem;
    padding-top: 4rem;
    padding-bottom: 2rem;
    position: relative;
    margin-top: 4rem;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.25s ease;
}

.site-footer a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.site-footer .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.03);
    margin-right: 10px;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.site-footer .social-icons a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
    padding-left: 0;
}

.footer-heading {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 8px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1.5rem;
    margin-top: 3rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}


