/* EAPCET Mock Exam Platform Stylesheet */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --purple: #9333ea;
    --purple-bg: #f3e8ff;
    --gray-bg: #f8fafc;
    --card-border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* Navbar */
.navbar-custom {
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.brand-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #1e293b;
    letter-spacing: -0.025em;
}

.brand-badge {
    background: #e0f2fe;
    color: #0284c7;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Timer Box matching User Screenshot */
.cbt-timer-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.08);
}

.cbt-timer-banner.timer-critical {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.02); }
}

/* Question Area */
.question-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--card-border);
}

.question-num-tag {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.question-marks-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.question-body-text {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

/* Options Selector */
.option-item {
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.85rem 1.2rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background: #ffffff;
}

.option-item:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.option-item.selected {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 1px var(--primary);
}

.option-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #475569;
    flex-shrink: 0;
}

.option-item.selected .option-circle {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.option-content {
    font-size: 1rem;
    flex-grow: 1;
}

/* Right Sidebar: Student & Question Analysis (matching screenshot) */
.student-profile-box {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.25rem;
}

.student-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #e2e8f0;
    margin: 0 auto 0.75rem auto;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.student-name-title {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    line-height: 1.3;
}

.question-analysis-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
}

.analysis-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.25rem;
    margin-bottom: 1.25rem;
}

.palette-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #334155;
    position: relative;
}

.palette-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.palette-btn.active-q {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    font-weight: 700;
}

/* Palette Status Classes */
.palette-btn.answered {
    background: #22c55e !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

.palette-btn.not-answered {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.palette-btn.marked-review {
    background: #8b5cf6 !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
}

.palette-btn.answered-marked-review {
    background: #8b5cf6 !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
}

.palette-btn.answered-marked-review::after {
    content: '';
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    border: 1px solid #ffffff;
}

.palette-btn.not-visited {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

/* Big Action Button (Submit Test) matching screenshot */
.btn-submit-test {
    background: #16a34a;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    width: 100%;
    border: none;
    box-shadow: 0 2px 5px rgba(22, 163, 74, 0.25);
    transition: all 0.2s;
}

.btn-submit-test:hover {
    background: #15803d;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
}

/* Subject Tabs in CBT */
.cbt-subject-tabs .nav-link {
    font-weight: 600;
    color: #475569;
    border-radius: 8px 8px 0 0;
    padding: 0.65rem 1.25rem;
}

.cbt-subject-tabs .nav-link.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    background: transparent;
}

/* Rank Badge Styles */
.rank-badge-gold {
    background: linear-gradient(135deg, #fef08a, #eab308);
    color: #854d0e;
    font-weight: 800;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(234, 179, 8, 0.3);
}

.rank-badge-silver {
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
    color: #334155;
    font-weight: 800;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
}

.rank-badge-bronze {
    background: linear-gradient(135deg, #ffedd5, #ea580c);
    color: #ffffff;
    font-weight: 800;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
}

.rank-badge-normal {
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
}

/* Dashboard Summary Cards */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

/* Responsive Table */
.custom-table {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.custom-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--card-border);
}

.custom-table td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--card-border);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   OFFICIAL CORPORATE ERP THEME & GLOBAL MOBILE OPTIMIZATIONS
   Kuppam Engineering College (Autonomous) - Higher Education ERP System
   ========================================================================== */

/* 1. Global Typography & Corporate Shell */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Corporate Color Helpers */
.bg-navy-dark {
    background-color: #0b1528 !important;
}
.bg-navy-midnight {
    background-color: #060d1b !important;
}
.text-navy {
    color: #0f172a !important;
}
.text-white-90 {
    color: rgba(255, 255, 255, 0.90) !important;
}
.text-white-75 {
    color: rgba(255, 255, 255, 0.75) !important;
}
.text-white-50 {
    color: rgba(255, 255, 255, 0.50) !important;
}
.border-white-10 {
    border-color: rgba(255, 255, 255, 0.10) !important;
}
.border-white-15 {
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.border-white-20 {
    border-color: rgba(255, 255, 255, 0.20) !important;
}
.bg-white-10 {
    background-color: rgba(255, 255, 255, 0.10) !important;
}
.bg-white-15 {
    background-color: rgba(255, 255, 255, 0.15) !important;
}
.bg-white-20 {
    background-color: rgba(255, 255, 255, 0.20) !important;
}
.letter-spacing-1 {
    letter-spacing: 0.06em;
}
.letter-spacing-05 {
    letter-spacing: 0.03em;
}

/* 2. Executive Corporate ERP Footer */
.kec-erp-corporate-footer {
    background: linear-gradient(180deg, #0b1528 0%, #060d1b 100%);
    border-top: 3px solid #f59e0b !important;
    color: #e2e8f0;
    font-size: 0.90rem;
    position: relative;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
}
.kec-footer-primary {
    background: transparent;
}
.kec-footer-secondary {
    background: #040812;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.kec-footer-pedestal-wrap {
    flex-shrink: 0;
}
.kec-footer-pedestal {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    transition: transform 0.2s ease;
}
.kec-footer-pedestal:hover {
    transform: translateY(-2px) scale(1.04);
}
.kec-footer-pedestal-naac {
    border-color: #ef4444;
}
.kec-footer-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}
.kec-footer-institution-title {
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    line-height: 1.25;
}
@media (min-width: 768px) {
    .kec-footer-institution-title {
        font-size: 1.30rem;
    }
}
.kec-footer-system-title {
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}
.kec-footer-initiative-tag {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.kec-footer-statutory {
    font-size: 0.78rem;
    line-height: 1.5;
}

/* 3. Comprehensive Mobile Compatibility (< 768px and < 992px) */
@media (max-width: 767.98px) {
    /* Prevent horizontal page blowouts */
    body, html {
        overflow-x: hidden;
    }
    .container, .container-fluid {
        padding-left: 14px;
        padding-right: 14px;
    }
    
    /* Touch friendly form inputs (prevents iOS auto-zoom) */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px !important;
    }
    
    /* Touch friendly buttons */
    .btn:not(.btn-sm) {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile Table Ergonomics */
    .table-responsive {
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
    
    /* Question Card Mobile Padding */
    .question-card {
        padding: 1rem;
    }
    
    /* Option Card Mobile Touch */
    .option-card {
        padding: 0.75rem 1rem;
        min-height: 48px;
    }

    /* Palette Grid Mobile Layout */
    .palette-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    /* Timer Banner Mobile Fit */
    .cbt-timer-banner {
        padding: 0.45rem 0.9rem;
        font-size: 0.95rem;
    }

    /* Navbar Brand Mobile Tuning */
    .navbar-brand {
        max-width: 78%;
    }
    .brand-title {
        font-size: 1.05rem;
    }
}

/* 4. Official Corporate Polish for Tables, Cards & Modals */
.card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
}
.badge {
    vertical-align: middle;
}
.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
