/* ============================================================
   CapSU LMS - Custom Stylesheet
   ============================================================ */

/* Base & Body */
body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar-custom {
    background-color: #1a3a6b;
    border: none;
    border-radius: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    min-height: 56px;
}

.navbar-custom .navbar-brand {
    color: #f0b429 !important;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: .5px;
    padding: 14px 18px;
}

.navbar-custom .navbar-brand img {
    margin-right: 8px;
    vertical-align: middle;
}

.navbar-custom .navbar-nav > li > a {
    color: #e0e8f0 !important;
    font-size: 14px;
    padding: 18px 16px;
    transition: color .2s, background .2s;
}

.navbar-custom .navbar-nav > li > a:hover,
.navbar-custom .navbar-nav > li.active > a {
    color: #f0b429 !important;
    background-color: rgba(255,255,255,.08) !important;
}

.navbar-custom .navbar-nav > li > a .badge {
    background-color: #f0b429;
    color: #1a3a6b;
    font-weight: 700;
}

.navbar-custom .navbar-toggle {
    border-color: #f0b429;
}

.navbar-custom .navbar-toggle .icon-bar {
    background-color: #f0b429;
}

.navbar-custom .navbar-text {
    color: #e0e8f0;
}

/* Dropdown in custom navbar */
.navbar-custom .dropdown-menu {
    background: #1e4080;
    border: 1px solid rgba(255,255,255,.1);
    border-top: 3px solid #f0b429;
}

.navbar-custom .dropdown-menu > li > a {
    color: #e0e8f0 !important;
    font-size: 13px;
}

.navbar-custom .dropdown-menu > li > a:hover {
    background: rgba(240,180,41,.15) !important;
    color: #f0b429 !important;
}

/* ============================================================
   Login page
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a3a6b 0%, #0d2147 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
    padding: 40px 38px 32px;
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #1a3a6b;
}

.login-logo h2 {
    color: #1a3a6b;
    font-size: 22px;
    font-weight: 700;
    margin: 12px 0 4px;
}

.login-logo p {
    color: #888;
    font-size: 13px;
    margin: 0;
}

.login-card .form-control {
    border-radius: 5px;
    height: 42px;
    border: 1px solid #cdd5e0;
    font-size: 14px;
}

.login-card .form-control:focus {
    border-color: #1a3a6b;
    box-shadow: 0 0 0 2px rgba(26,58,107,.15);
}

.login-card .btn-login {
    background: #1a3a6b;
    color: #f0b429;
    font-weight: 700;
    font-size: 15px;
    height: 44px;
    border: none;
    border-radius: 5px;
    width: 100%;
    letter-spacing: .5px;
    transition: background .2s;
}

.login-card .btn-login:hover {
    background: #0d2147;
}

.login-divider {
    text-align: center;
    color: #aaa;
    margin: 14px 0;
    font-size: 13px;
}

/* ============================================================
   Cards / Panels
   ============================================================ */
.card,
.panel {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    border: none;
    margin-bottom: 22px;
}

.panel-default > .panel-heading {
    background: #fff;
    border-bottom: 2px solid #1a3a6b;
    border-radius: 8px 8px 0 0;
    color: #1a3a6b;
    font-weight: 600;
    font-size: 15px;
    padding: 14px 18px;
}

.panel-primary > .panel-heading {
    background: #1a3a6b;
    color: #f0b429;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    padding: 14px 18px;
}

.panel-body {
    padding: 20px 22px;
}

/* Subject cards grid */
.subject-card {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    transition: transform .2s, box-shadow .2s;
    border: none;
    overflow: hidden;
}

.subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

.subject-card .subject-card-header {
    background: linear-gradient(135deg, #1a3a6b, #2a5298);
    color: #fff;
    padding: 18px 18px 14px;
    position: relative;
}

.subject-card .subject-card-header .subject-code {
    font-size: 22px;
    font-weight: 700;
    color: #f0b429;
    line-height: 1;
}

.subject-card .subject-card-header .subject-name {
    font-size: 13px;
    color: #c8d8f0;
    margin-top: 4px;
}

.subject-card .subject-card-body {
    padding: 14px 18px;
    background: #fff;
}

.subject-card .subject-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.subject-card .subject-meta i {
    width: 16px;
    color: #1a3a6b;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    padding: 0;
    overflow: hidden;
}

.sidebar .sidebar-header {
    background: #1a3a6b;
    color: #f0b429;
    padding: 16px 18px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .4px;
}

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

.sidebar ul li a {
    display: block;
    padding: 11px 18px;
    color: #444;
    font-size: 14px;
    border-bottom: 1px solid #f0f2f5;
    transition: background .15s, color .15s;
    text-decoration: none;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: #e8eff9;
    color: #1a3a6b;
    font-weight: 600;
}

.sidebar ul li a i {
    width: 20px;
    margin-right: 6px;
    color: #1a3a6b;
}

/* ============================================================
   Tables
   ============================================================ */
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #f7f9fc;
}

.table-hover > tbody > tr:hover {
    background-color: #eef3fb;
}

.table > thead > tr > th {
    background: #1a3a6b;
    color: #f0b429;
    font-weight: 600;
    font-size: 13px;
    border-bottom: none;
    padding: 12px 14px;
}

.table > tbody > tr > td {
    padding: 10px 14px;
    vertical-align: middle;
    font-size: 13px;
}

/* ============================================================
   Quiz builder
   ============================================================ */
.question-block {
    background: #fff;
    border: 1px solid #d0dae8;
    border-left: 4px solid #1a3a6b;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    position: relative;
}

.question-block .question-header {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    gap: 10px;
    flex-wrap: wrap;
}

.question-block .question-num {
    background: #1a3a6b;
    color: #f0b429;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.question-block .question-type-select {
    min-width: 170px;
}

.question-block .points-input {
    width: 70px;
}

.choices-section {
    background: #f8fafd;
    border: 1px solid #e0e8f0;
    border-radius: 5px;
    padding: 12px 14px;
    margin-top: 10px;
}

.choice-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.choice-row input[type="radio"] {
    flex-shrink: 0;
}

.choice-row input[type="text"] {
    flex: 1;
}

.open-answer-note {
    background: #fffbe6;
    border: 1px solid #f0b429;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    color: #7a6000;
    margin-top: 10px;
}

.open-answer-note i {
    margin-right: 5px;
}

/* ============================================================
   Progress bars
   ============================================================ */
.progress {
    border-radius: 20px;
    background: #e0e8f0;
    box-shadow: none;
    height: 14px;
}

.progress-bar {
    border-radius: 20px;
    background-color: #1a3a6b;
    font-size: 11px;
    line-height: 14px;
}

.progress-bar-success { background-color: #28a745; }
.progress-bar-warning { background-color: #f0b429; }
.progress-bar-danger  { background-color: #dc3545; }

/* ============================================================
   Badges & Labels
   ============================================================ */
.badge-lms {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}

.badge-present  { background: #d4edda; color: #155724; }
.badge-absent   { background: #f8d7da; color: #721c24; }
.badge-late     { background: #fff3cd; color: #856404; }
.badge-excused  { background: #d1ecf1; color: #0c5460; }
.badge-accepted { background: #d4edda; color: #155724; }
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-draft    { background: #e2e3e5; color: #383d41; }
.badge-published{ background: #d4edda; color: #155724; }
.badge-closed   { background: #f8d7da; color: #721c24; }

/* ============================================================
   Stat boxes (dashboard)
   ============================================================ */
.stat-box {
    background: #fff;
    border-radius: 8px;
    padding: 22px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    border-left: 5px solid #1a3a6b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-box .stat-icon {
    font-size: 36px;
    color: #1a3a6b;
    width: 50px;
    text-align: center;
}

.stat-box .stat-value {
    font-size: 30px;
    font-weight: 700;
    color: #1a3a6b;
    line-height: 1;
}

.stat-box .stat-label {
    font-size: 13px;
    color: #888;
    margin-top: 3px;
}

.stat-box-success { border-left-color: #28a745; }
.stat-box-success .stat-icon,
.stat-box-success .stat-value { color: #28a745; }

.stat-box-warning { border-left-color: #f0b429; }
.stat-box-warning .stat-icon,
.stat-box-warning .stat-value { color: #c8960a; }

.stat-box-danger { border-left-color: #dc3545; }
.stat-box-danger .stat-icon,
.stat-box-danger .stat-value { color: #dc3545; }

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
    background-color: #1a3a6b;
    border-color: #1a3a6b;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #0d2147;
    border-color: #0d2147;
}

.btn-gold {
    background-color: #f0b429;
    border-color: #c8960a;
    color: #1a3a6b;
    font-weight: 600;
}

.btn-gold:hover {
    background-color: #d9a020;
    border-color: #b07a00;
    color: #1a3a6b;
}

/* ============================================================
   Timer
   ============================================================ */
.quiz-timer {
    position: fixed;
    top: 70px;
    right: 20px;
    background: #1a3a6b;
    color: #f0b429;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(0,0,0,.3);
    z-index: 1000;
    min-width: 110px;
    text-align: center;
}

.quiz-timer.warning {
    background: #dc3545;
    color: #fff;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%  { opacity: 1; }
    50% { opacity: .7; }
    100%{ opacity: 1; }
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    border-radius: 6px;
    font-size: 14px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: #1a3a6b;
    color: #c8d8f0;
    text-align: center;
    padding: 18px 0;
    margin-top: 50px;
    font-size: 13px;
}

.site-footer a {
    color: #f0b429;
    text-decoration: none;
}

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

/* ============================================================
   Utility
   ============================================================ */
.page-header {
    border-bottom: 3px solid #1a3a6b;
    margin-bottom: 22px;
    padding-bottom: 10px;
}

.page-header h2,
.page-header h3 {
    color: #1a3a6b;
    font-weight: 700;
    margin: 0;
}

.page-header small {
    color: #888;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a3a6b;
    border-bottom: 2px solid #e0e8f0;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.invite-link-box {
    background: #f0f4fa;
    border: 1px dashed #1a3a6b;
    border-radius: 5px;
    padding: 10px 14px;
    font-family: monospace;
    font-size: 13px;
    color: #1a3a6b;
    word-break: break-all;
}

/* Material type icons */
.material-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.type-file  { background: #e3f2fd; color: #1565c0; }
.type-link  { background: #e8f5e9; color: #2e7d32; }
.type-video { background: #fce4ec; color: #c62828; }

/* ============================================================
   Print styles
   ============================================================ */
@media print {
    .navbar-custom,
    .sidebar,
    .btn,
    .site-footer,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .panel {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .table > thead > tr > th {
        background: #f0f0f0 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
    }

    .page-header h2 {
        color: #000;
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .login-card {
        margin: 16px;
        padding: 28px 22px;
    }

    .stat-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .subject-card {
        margin-bottom: 16px;
    }

    .quiz-timer {
        top: auto;
        bottom: 16px;
        right: 16px;
    }
}
