/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #0066cc;
}

a:hover {
    text-decoration: underline;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.1rem;
}

p {
    margin-bottom: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-danger {
    background-color: #fee;
    border-color: #c33;
    color: #900;
}

.alert-danger p {
    margin-bottom: 0.5rem;
}

.alert-danger p:last-child {
    margin-bottom: 0;
}

.alert-success {
    background-color: #efe;
    border-color: #3c3;
    color: #090;
}

.alert-success a {
    color: #060;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background-color: #0066cc;
    color: white;
}

.btn-primary:hover {
    background-color: #0052a3;
    text-decoration: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    text-decoration: none;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-view {
    padding: 0.5rem 1rem;
    background-color: #0066cc;
    color: white;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-view:hover {
    background-color: #0052a3;
    text-decoration: none;
}

.btn-submit {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* Navigation Bar */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    sticky: top;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.navbar-title {
    font-size: 1.5rem;
    color: #0066cc;
    margin: 0;
}

.navbar-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background-color: #f0f0f0;
    border-top: 1px solid #ddd;
    margin-top: auto;
}

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    width: 100%;
    padding: 1rem;
}

.auth-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 450px;
    margin: 0 auto;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #0066cc;
}

/* Form Styles */
.auth-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
}

.auth-link a {
    color: #0066cc;
}

/* Exam Container */
.exam-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Exam Selection */
.exam-selection {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.exam-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.exam-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.exam-card h3 {
    margin-bottom: 0.5rem;
    color: white;
}

.exam-card p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.exam-card .btn {
    background-color: white;
    color: #667eea;
}

.exam-card .btn:hover {
    background-color: #f0f0f0;
}

/* Exam Header */
.exam-header {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.exam-info {
    display: flex;
    gap: 2rem;
    color: #666;
    align-items: center;
}

.exam-timer {
    font-size: 1.3rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    border-radius: 6px;
    color: #333;
    transition: all 0.3s ease;
}

/* Questions */
.question-card {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #0066cc;
}

.question-number {
    color: #0066cc;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-label:hover {
    background-color: #f5f5f5;
    border-color: #0066cc;
}

.option-label input[type="radio"] {
    margin-right: 0.75rem;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.option-label span {
    flex: 1;
}

.option-label input[type="radio"]:checked + span {
    font-weight: 500;
    color: #0066cc;
}

/* Exam Actions */
.exam-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

/* Results Container */
.results-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.no-results {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 1rem;
}

/* Results List */
.results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.result-card {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.result-header {
    margin-bottom: 1.5rem;
}

.result-header h3 {
    margin-bottom: 0.5rem;
}

.result-date {
    font-size: 0.9rem;
    color: #999;
}

.result-stats {
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.stat .label {
    font-weight: 500;
    color: #666;
}

.stat .value {
    font-weight: bold;
    color: #0066cc;
    font-size: 1.1rem;
}

/* Result Detail */
.result-detail {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-header-detail {
    border-bottom: 2px solid #eee;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.result-header-detail h2 {
    margin-bottom: 0.5rem;
}

/* Score Summary */
.score-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 2rem;
    align-items: center;
}

.score-box {
    text-align: center;
}

.score-value {
    font-size: 3.5rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Detailed Answers */
.detailed-answers {
    margin-top: 2rem;
}

.detailed-answers h3 {
    margin-bottom: 1.5rem;
}

.answer-review {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #f9f9f9;
}

.answer-review.correct {
    border-color: #28a745;
    background-color: #f1f9f6;
}

.answer-review.incorrect {
    border-color: #dc3545;
    background-color: #faf1f3;
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.answer-header h4 {
    margin: 0;
    color: #333;
}

.answer-status {
    font-weight: bold;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.answer-review.correct .answer-status {
    color: #155724;
    background-color: #d4edda;
}

.answer-review.incorrect .answer-status {
    color: #721c24;
    background-color: #f8d7da;
}

.question-text {
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.answer-info {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.answer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.answer-item:last-child {
    border-bottom: none;
}

.answer-item .label {
    font-weight: 500;
    color: #666;
}

.answer-item .value {
    font-weight: 500;
    color: #333;
}

.explanation {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
}

.explanation strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #0066cc;
}

.explanation p {
    margin: 0;
    color: #666;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 2rem;
    border-top: 2px solid #eee;
    margin-top: 2rem;
}

/* Admin Container */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-title {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.results-table thead {
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.results-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
}

.results-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.results-table tbody tr:hover {
    background-color: #f9f9f9;
}

.score-badge {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.score-badge.pass {
    background-color: #d4edda;
    color: #155724;
}

.score-badge.fail {
    background-color: #f8d7da;
    color: #721c24;
}

/* Student Info Panel */
.student-info-panel {
    background-color: #f0f4f8;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid #0066cc;
}

.student-info-panel h3 {
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item .label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.info-item .value {
    color: #333;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .navbar-info {
        flex-direction: column;
        width: 100%;
    }

    .exam-actions {
        flex-direction: column-reverse;
    }

    .exam-actions .btn {
        width: 100%;
    }

    .score-summary {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }

    .results-table {
        font-size: 0.85rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.75rem 0.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .exam-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }

    .question-card {
        padding: 1.5rem;
    }

    .score-value {
        font-size: 2.5rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }
}
