/* CSCA Mock Test - User Interface Styles */

:root {
    --primary: #0e64a3;
    --secondary: #f7941e;
    --tertiary: #25aae1;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --dark: #343a40;
    --light: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    color: #333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, #0a4c7c 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    max-width: 150px;
    height: auto;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(255,255,255,0.2);
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    background: var(--primary);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background-color: var(--light);
    border-top: 1px solid #dee2e6;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--tertiary);
    box-shadow: 0 0 0 0.2rem rgba(37, 170, 225, 0.25);
}

.form-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #0d5892;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(14, 100, 163, 0.3);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #e88a1b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(247, 148, 30, 0.3);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Module Cards */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.module-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.module-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.module-card p {
    color: #666;
    margin-bottom: 15px;
}

.module-info {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #777;
}

/* Test Interface */
.test-container {
    max-width: 900px;
    margin: 0 auto;
}

.question-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.question-number {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #333;
}

/* LaTeX Math Styling */
.math-formula {
    display: block;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 3px solid var(--tertiary);
    border-radius: 5px;
    margin: 15px 0;
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
}

.math-inline {
    font-family: 'Times New Roman', serif;
    font-style: italic;
}

/* Options */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    position: relative;
}

.option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option label {
    display: block;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

.option label:hover {
    border-color: var(--tertiary);
    background-color: #f8f9fa;
}

.option input[type="radio"]:checked + label {
    border-color: var(--primary);
    background-color: #e6f3ff;
    font-weight: 500;
}

.option-letter {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    margin-right: 10px;
    font-weight: 600;
}

.option input[type="radio"]:checked + label .option-letter {
    background-color: var(--secondary);
}

/* Timer */
.timer-container {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
    z-index: 100;
}

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.timer.warning {
    color: var(--danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Progress Bar */
.progress-container {
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar {
    height: 30px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--tertiary) 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Result Page */
.result-container {
    max-width: 700px;
    margin: 40px auto;
    text-align: center;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 10px solid var(--primary);
    margin: 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.stat-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* Footer */
.footer {
    background-color: #343a40;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }

.py-1 { padding: 10px 0; }
.py-2 { padding: 20px 0; }
.py-3 { padding: 30px 0; }
.py-4 { padding: 40px 0; }

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .timer-container {
        position: static;
        margin: 20px 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        gap: 10px;
    }
}
