/* General Vibrant Styles - Pushpak Aviation Quiz */
:root {
    --color-primary: #007bff;     /* Aviation Blue (Main CTA, links) */
    --color-secondary: #00d4ff;   /* Sky Blue/Cyan (Branding, accents) */
    --color-accent: #ff8c00;      /* Safety Orange (Admin/Flagging) */
    --color-dark: #2c3e50;        /* Dark Navy (Header background) */
    --color-light: #ecf0f1;       /* Light Gray (Body/background) */
    --color-success: #2ecc71;     /* Green (Pass/Success) */
    --color-error: #e74c3c;       /* Red (Fail/Error) */
    --color-text: #34495e;        /* Dark Text */
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--color-light);
    color: var(--color-text);
    margin: 0;
    padding-top: 70px; /* Space for fixed header */
}

/* --- Header Styling (Logo Left, Buttons Right) --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-dark); /* Dark Bar */
    color: white;
    padding: 10px 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
}

.logo-img {
    height: 40px; /* Size for the logo */
    margin-right: 15px;
    /* Optional: Add a subtle glow for a vibrant/futuristic look */
    filter: drop-shadow(0 0 5px var(--color-secondary)); 
}

.site-name {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--color-secondary); /* Vibrant color for the name */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    font-size: 1em;
    font-weight: 500;
    color: var(--color-light);
}

.nav-button {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
    cursor: pointer;
    border: none;
}

.nav-button.admin-link {
    background-color: var(--color-accent); /* Orange for Admin CTA */
    color: white;
}

.nav-button.admin-link:hover {
    background-color: #e67e22; /* Darker orange */
}

.nav-button.logout-btn {
    background-color: var(--color-primary); /* Blue for Logout */
    color: white;
}

.nav-button.logout-btn:hover {
    background-color: #0056b3; /* Darker blue */
}

/* --- Main Content Container & Forms --- */
#quiz-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

h1, h2, h3, .section-title {
    color: var(--color-dark);
    border-bottom: 2px solid var(--color-secondary); /* Sky blue underlay */
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Form Styling */
label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
    outline: none;
}

button[type="submit"], .action-button, .main-cta {
    display: inline-block;
    padding: 12px 25px;
    margin-top: 10px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    color: white;
    background-color: var(--color-primary);
    transition: background-color 0.3s, transform 0.1s;
}

button[type="submit"]:hover, .action-button:hover, .main-cta:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.delete-btn { background-color: var(--color-error) !important; }
.delete-btn:hover { background-color: #c0392b !important; }

/* Quiz/Admin List Styles */
.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #ccc;
}
.admin-list-item:last-child { border-bottom: none; }

/* Quiz Question Styles */
.question-options label {
    display: flex;
    align-items: center;
    background-color: var(--color-light);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    border: 1px solid #ddd;
}
.question-options label:hover {
    background-color: #e0f7fa; /* Light cyan hover */
    border-color: var(--color-secondary);
}
.question-options input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.4);
}

.quiz-navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Quiz Navigation Bar Styles */
#navigation-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: var(--color-light);
    border-radius: 8px;
    border: 1px solid #ddd;
}
.nav-button {
    padding: 6px 10px;
    background-color: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}
.nav-button.current {
    background-color: var(--color-accent); 
    color: white;
    border-color: var(--color-accent);
}
/*.nav-button.answered {
    background-color: var(--color-success);
    color: white;
    border-color: var(--color-success);
}*/

.nav-button.answered {
    /* This sets the default color for ANY answered question to green */
    background-color: var(--color-success); /* Green */
    color: white;
    border-color: var(--color-success);
}
/*.nav-button.answered {
    background-color: var(--color-success);
    color: white;
    border-color: var(--color-success);
}*/

/* NEW: Style for INCORRECTLY ANSWERED questions (will override .answered) */

/* 💥 CRITICAL FIX: The Incorrectly Answered style must be present and follow the Answered style. */
.nav-button.incorrectly-answered { 
    /* This rule has the same specificity as .nav-button.answered but is defined later, so it takes precedence. */
    background-color: var(--color-error) !important; /* Red */
    color: white !important;
    border-color: var(--color-error) !important;
}

/*.nav-button.incorrectly-answered { 
    background-color: var(--color-error); /* Uses the vibrant error red */
    color: white;
    border-color: var(--color-error);
}*/
/*.nav-button.flagged {
    border: 2px solid var(--color-error);
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.8);
}*/

.nav-button.flagged {
    /* This overrides the color for flagged questions */
    border: 2px solid var(--color-error);
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.8);
    /* Ensure the background remains what it was, or is reset if needed */
    background-color: #fff; 
    color: var(--color-primary);
}

/* Results Table Styles */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.results-table th, .results-table td {
    border: 1px solid #ddd;
    padding: 12px;
}
.results-table th {
    background-color: var(--color-primary);
    color: white;
    text-transform: uppercase;
}
.results-table tr:nth-child(even) { background-color: #f2f2f2; }
.pass-grade { color: var(--color-success); font-weight: bold; }
.fail-grade { color: var(--color-error); font-weight: bold; }

/* Message Styles */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: bold;
}
.message.success { background-color: #e6ffec; border: 1px solid var(--color-success); color: var(--color-success); }
.message.error { background-color: #ffe6e6; border: 1px solid var(--color-error); color: var(--color-error); }
.message.info { background-color: #e3f2fd; border: 1px solid var(--color-primary); color: var(--color-primary); }