/* QuizTest Custom Styles */

:root {
    --sidebar-width: 260px;
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #2ec4b6;
    --danger-color: #e63946;
    --warning-color: #f4a261;
    --dark-color: #2b2d42;
    --light-bg: #f8f9fa;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1a2e 100%);
    color: #fff;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar .brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .brand h4 {
    margin: 0;
    font-weight: 700;
    color: #fff;
}

.sidebar .brand small {
    color: rgba(255,255,255,0.6);
}

.sidebar .nav-menu {
    padding: 15px 0;
}

.sidebar .nav-item {
    list-style: none;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

.sidebar .nav-section {
    padding: 10px 20px 5px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-bar {
    background: #fff;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-wrapper {
    padding: 30px;
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 700;
}

.login-card .subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
}

/* Exam Taking */
.exam-container {
    max-width: 900px;
    margin: 0 auto;
}

.question-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.question-card .question-number {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.question-card .question-text {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.answer-option {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-option:hover {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.05);
}

.answer-option.selected {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
}

.answer-option.correct {
    border-color: var(--success-color);
    background: rgba(46, 196, 182, 0.1);
}

.answer-option.incorrect {
    border-color: var(--danger-color);
    background: rgba(230, 57, 70, 0.1);
}

.answer-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9ecef;
    color: #495057;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 10px;
    flex-shrink: 0;
}

.answer-option.selected .answer-label {
    background: var(--primary-color);
    color: #fff;
}

.answer-option.correct .answer-label {
    background: var(--success-color);
    color: #fff;
}

.answer-option.incorrect .answer-label {
    background: var(--danger-color);
    color: #fff;
}

/* Timer */
.exam-timer-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    padding: 10px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.exam-timer {
    background: #fff;
    padding: 5px 10px;
    border-radius: 12px;
    text-align: center;
}

.exam-timer .time-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.exam-timer .time-display.warning {
    color: var(--warning-color);
}

.exam-timer .time-display.danger {
    color: var(--danger-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Question Navigator */
.question-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.question-nav .q-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.question-nav .q-btn.answered {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.question-nav .q-btn.current {
    border-color: var(--warning-color);
    box-shadow: 0 0 0 2px var(--warning-color);
}

/* Question Nav Panel (Public Quiz) */
.question-nav-panel {
    position: sticky;
    top: 70px;
}

.question-nav-col {
    display: grid;
    grid-template-columns: repeat(auto-fill, 36px);
    gap: 6px;
    min-height: 36px;
}

.question-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #495057;
    font-weight: 600;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.question-nav-item:hover {
    border-color: #667eea;
    color: #667eea;
    text-decoration: none;
}

.question-nav-item.answered {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* Tables */
.table-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Alert */
.alert-float {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

/* Import preview */
.import-preview {
    max-height: 500px;
    overflow-y: auto;
}

.import-question {
    border-left: 3px solid var(--primary-color);
    padding: 10px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
}

/* Result page */
.result-score {
    font-size: 3rem;
    font-weight: 700;
}

.result-score.pass {
    color: var(--success-color);
}

.result-score.fail {
    color: var(--danger-color);
}
