/* ====== Quiz App Stylesheet ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f6fa;
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: #4a6cf7; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Navbar ===== */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.nav-brand {
    color: white;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
}
.nav-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.nav-menu a {
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}
.nav-menu a:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
}
.user-badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
}
.btn-logout { background: rgba(255,255,255,0.15); }

/* ===== Container ===== */
.main-container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: calc(100vh - 200px);
}
.footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 14px;
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
}

/* ===== Auth ===== */
.auth-body {
    background-image: linear-gradient(-20deg, #e9defa 0%, #fbfcdb 100%);
    min-height: 100vh;
   /* display: flex;*/
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-container { width: 100%; }
.auth-card {
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px #ccc;
    background-blend-mode: screen;
    background-image: linear-gradient(-20deg, #f66302 0%, #fdd6bd 100%);
}
.auth-header { text-align: center; margin-bottom: 25px; }
.auth-header h1 { color: #4a6cf7; margin-bottom: 8px; }
.auth-header p { color: #7f8c8d; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 14px; }
.demo-creds {
    margin-top: 15px;
    padding: 12px;
    background: #f4f6fa;
    border-radius: 8px;
    font-size: 13px;
    text-align: left;
}
.demo-creds code {
    background: #e8eaf6;
    padding: 2px 6px;
    border-radius: 4px;
    color: #c2185b;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #dde1e7;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.15);
}
.field-error { color: #c33; font-size: 13px; display: block; margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 11px 22px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(102,126,234,0.4);
    text-decoration: none;
    color: white;
}
.btn-secondary { background: #ecf0f1; color: #2c3e50; }
.btn-secondary:hover { background: #dde4e7; text-decoration: none; }
.btn-block { width: 100%; }
.btn-large { padding: 14px 30px; font-size: 17px; }

/* ===== Alerts ===== */
.alert {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
    font-weight: 700;
}
.alert-success { background: #efe; color: #2a7; border: 1px solid #cfc; }

/* ===== Dashboard ===== */
.dashboard { display: grid; gap: 24px; }
.welcome-card, .history-card {
    background: white;
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.welcome-card h1 { margin-bottom: 10px; color: #2c3e50; }

.quiz-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 25px 0;
}
.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f4f6fa;
    border-radius: 10px;
}
.info-icon { font-size: 28px; }
.info-item strong { display: block; color: #2c3e50; font-size: 14px; }
.info-item p { color: #7f8c8d; font-size: 13px; }

.rules-box {
    background: #fff8e1;
    border-left: 4px solid #ffa726;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
}
.rules-box h3 { margin-bottom: 8px; color: #e65100; }
.rules-box ul { margin-left: 20px; color: #5d4037; }
.rules-box li { margin-bottom: 4px; }

/* ===== Quiz Page ===== */
.quiz-container { padding: 10px 0; }
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.quiz-header h1 { color: #2c3e50; }

.timer {
    background: #4a6cf7;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 20px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 3px 8px rgba(74,108,247,0.3);
}
.timer-warning { background: #ff9800 !important; animation: pulse 1.5s infinite; }
.timer-danger { background: #e53935 !important; animation: pulse 0.7s infinite; }
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.warning-bar {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.question-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid #4a6cf7;
}
.question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.q-number {
    background: #4a6cf7;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}
.q-type {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.q-type.mcq { background: #e3f2fd; color: #1976d2; }
.q-type.input { background: #f3e5f5; color: #7b1fa2; }
.q-type.yesno { background: #e8f5e9; color: #388e3c; }
.q-marks {
    margin-left: auto;
    background: #fff8e1;
    color: #f57c00;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.question-text {
    font-size: 17px;
    color: #2c3e50;
    margin-bottom: 18px;
    font-weight: 500;
}

.options { display: grid; gap: 10px; }
.option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}
.option:hover { border-color: #4a6cf7; background: #f0f4ff; }
.option input[type="radio"] { margin-right: 12px; transform: scale(1.2); accent-color: #4a6cf7; }
.option-letter {
    background: #ecf0f1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 13px;
}

.input-answer input { font-size: 16px; padding: 12px 16px; }

.yesno-options { display: flex; gap: 14px; }
.yesno-option {
    flex: 1;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}
.yesno-option input { margin-right: 8px; }
.yesno-option:hover { border-color: #4a6cf7; }

.submit-section { text-align: center; margin: 30px 0; }

/* ===== Result Page ===== */
.result-container { max-width: 850px; margin: 0 auto; }
.result-card {
    background: white;
    border-radius: 14px;
    padding: 35px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.result-card h1 { color: #2c3e50; margin-bottom: 25px; }

.score-display { display: inline-block; margin: 20px 0; }
.score-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(102,126,234,0.4);
}
.score-display.success .score-circle { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.score-display.warning .score-circle { background: linear-gradient(135deg, #f6d365, #fda085); }
.score-display.danger .score-circle { background: linear-gradient(135deg, #ee0979, #ff6a00); }
.score-number { font-size: 48px; font-weight: bold; line-height: 1; }
.score-total { font-size: 18px; opacity: 0.9; }

.grade-badge {
    margin-top: 14px;
    background: #f4f6fa;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    color: #2c3e50;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 25px;
}
.stat { background: #f4f6fa; padding: 16px; border-radius: 10px; }
.stat-value { font-size: 24px; font-weight: bold; color: #2c3e50; }
.stat-label { color: #7f8c8d; font-size: 13px; margin-top: 4px; }

.details-card {
    background: white;
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.details-card h2 { margin-bottom: 18px; color: #2c3e50; }
.detail-item {
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid;
}
.detail-item.correct { background: #e8f5e9; border-color: #4caf50; }
.detail-item.wrong { background: #ffebee; border-color: #e53935; }
.detail-header {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.detail-num {
    background: #2c3e50;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
}
.detail-type {
    background: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #7f8c8d;
}
.detail-status { margin-left: auto; font-weight: bold; font-size: 14px; }
.detail-item.correct .detail-status { color: #2e7d32; }
.detail-item.wrong .detail-status { color: #c62828; }
.detail-question { font-weight: 500; margin: 8px 0; color: #2c3e50; }
.detail-answers {
    background: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
}
.detail-answers div { margin: 3px 0; }

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 25px 0;
    flex-wrap: wrap;
}

/* ===== History Table ===== */
.history-container {
    background: white;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.history-container h1 { margin-bottom: 20px; color: #2c3e50; }
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}
.results-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 14px;
    text-align: left;
}
.results-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}
.results-table tbody tr:hover { background: #f8f9ff; }
.score-cell { color: #4a6cf7; font-size: 18px; }
.empty-state { text-align: center; padding: 40px; color: #7f8c8d; }
.empty-state p { margin-bottom: 18px; font-size: 16px; }
.link { color: #4a6cf7; font-weight: 600; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .nav-container { flex-direction: column; gap: 10px; }
    .nav-menu { gap: 10px; font-size: 14px; }
    .quiz-header { flex-direction: column; gap: 12px; }
    .timer { font-size: 18px; }
    .question-card { padding: 18px; }
    .question-text { font-size: 15px; }
    .yesno-options { flex-direction: column; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .score-circle { width: 130px; height: 130px; }
    .score-number { font-size: 38px; }
}

/* ===== Monthly quiz banner ===== */
.quiz-banner {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: #1a5e3d;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.quiz-banner small {
    color: #2d7a52;
    display: block;
    margin-top: 4px;
}
.hint {
    color: #95a5a6;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}
