/* Security+ Exam Simulator Styles */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #ecf0f1;
    --border-color: #bdc3c7;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

header .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Navigation */
nav {
    background-color: #34495e;
    padding: 0.75rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: var(--secondary-color);
}

.nav-inline-form {
    display: inline-block;
    margin-left: 0.5rem;
}

.nav-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Forms */
.form-grid {
    display: grid;
    gap: 1rem;
    max-width: 480px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.form-error {
    background: #fbeaea;
    border: 1px solid #e0b4b4;
    color: #8a2a2a;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.form-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.form-help {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background-color: #2980b9;
}

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

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

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

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

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

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

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

/* Timer */
#timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 1000;
}

#timer.warning {
    background-color: #fff3cd;
    border: 2px solid var(--warning-color);
}

#timer.danger {
    background-color: #f8d7da;
    border: 2px solid var(--danger-color);
    animation: pulse 1s infinite;
}

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

/* Question Navigation */
.question-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.question-nav-btn {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.question-nav-btn:hover {
    background-color: var(--light-bg);
}

.question-nav-btn.current {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.question-nav-btn.answered {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.question-nav-btn.flagged {
    background-color: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

/* Question Display */
.question-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 1.5rem 0;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-bg);
}

.question-number {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
}

.question-domain {
    background-color: var(--light-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.question-prompt {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 1.5rem 0;
    color: #2c3e50;
}

.choices {
    margin: 1.5rem 0;
}

.choice {
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin: 0.75rem 0;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.choice:hover {
    background-color: var(--light-bg);
    border-color: var(--secondary-color);
}

.choice input[type="radio"] {
    margin-right: 1rem;
    transform: scale(1.2);
    cursor: pointer;
}

.choice.selected {
    background-color: #e3f2fd;
    border-color: var(--secondary-color);
    border-width: 3px;
}

.choice.correct {
    background-color: #d4edda;
    border-color: var(--success-color);
}

.choice.incorrect {
    background-color: #f8d7da;
    border-color: var(--danger-color);
}

/* Question Controls */
.question-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--light-bg);
}

.flag-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.flag-checkbox input[type="checkbox"] {
    transform: scale(1.3);
    cursor: pointer;
}

/* Progress Bar */
.progress-container {
    margin: 1.5rem 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: var(--light-bg);
    border-radius: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Results */
.results-container {
    text-align: center;
}

.score-display {
    font-size: 4rem;
    font-weight: bold;
    margin: 2rem 0;
}

.score-display.passed {
    color: var(--success-color);
}

.score-display.failed {
    color: var(--danger-color);
}

.score-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.score-stat {
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
}

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

.score-stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

/* Domain Breakdown */
.domain-breakdown {
    margin: 2rem 0;
}

.domain-item {
    margin: 1rem 0;
}

.domain-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.domain-name {
    font-weight: 600;
}

.domain-percentage {
    font-weight: bold;
}

.domain-bar {
    width: 100%;
    height: 25px;
    background-color: var(--light-bg);
    border-radius: 12px;
    overflow: hidden;
}

.domain-bar-fill {
    height: 100%;
    background-color: var(--secondary-color);
    transition: width 0.3s;
}

/* Explanation */
.explanation {
    background-color: #fff9e6;
    border-left: 4px solid var(--warning-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.explanation h4 {
    color: var(--warning-color);
    margin-bottom: 0.75rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    #timer {
        position: static;
        margin-bottom: 1rem;
    }

    .question-nav {
        grid-template-columns: repeat(5, 1fr);
    }

    .score-display {
        font-size: 2.5rem;
    }

    header h1 {
        font-size: 1.4rem;
    }
}

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

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.hidden {
    display: none;
}
