/*
|--------------------------------------------------------------------------
| QUIZMASTER UNIFIED CSS
|--------------------------------------------------------------------------
| This file combines the global styles, header, quiz components, and login
| form styles, prioritizing consistency based on the initial design system.
*/

/* 1. Global Reset and Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #6366f1; /* Indigo - Main action color */
    --secondary-color: #8b5cf6; /* Violet - Gradient partner */
    --accent-color: #ec4899;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --text-color: #334155;
    
    /* Shadows */
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 2. Base Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /* Main Gradient Background */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

/* 3. Header and Navigation Styles */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    /* Gradient Text Effect */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 4. Hero Section Styles */
.hero {
    margin-top: 80px;
    padding: 4rem 2rem;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* 5. Login Component Styles (Based on the new structure, but styled with QuizMaster look) */
.login-container {
    /* Adopt the core card styling from the original site */
    background: white;
    padding: 3rem 2.5rem; /* Increased padding for modern look */
    border-radius: 20px; /* Use original card radius */
    box-shadow: var(--hover-shadow);
    width: 100%;
    max-width: 420px;
    text-align: center;
    margin-top: 40px; /* Separator from header if not using full-screen body display */
    /* Removed redundant display/align/justify as they should be controlled by the parent body/main element */
}

/* Note: In the actual login HTML, you'd center the body content via flexbox to center this container. */

.login-container h2 {
    margin-bottom: 20px;
    color: var(--dark-color); /* Use dark variable */
}

/* Input Field Styling (Prioritizing the original quiz page's input style) */
.login-container input {
    width: 100%;
    padding: 1rem; /* Use larger padding for consistency */
    margin: 10px 0;
    border: 2px solid #e2e8f0; /* Use light border */
    border-radius: 10px; /* Use larger border radius for consistency */
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Login Button (Prioritizing the original quiz page's start-quiz-btn style) */
.login-container button {
    width: 100%;
    padding: 1rem;
    margin-top: 15px;
    border: none;
    /* Use the same gradient background for button consistency */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3); /* Consistent hover shadow */
}

.login-container p {
    margin-top: 15px;
    font-size: 1rem; /* Adjusted for better legibility */
    color: var(--text-color);
}

.login-container a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.login-container a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}


/* 6. Animations (From original quiz page) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* 7. Responsive Design (From original quiz page) */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .nav-links {
        display: none;
    }
}
/* Main Content */
        main {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
        }

        /* Search and Filter Section */
        .search-filter {
            background: white;
            padding: 2rem;
            border-radius: 20px;
            box-shadow: var(--card-shadow);
            margin-bottom: 3rem;
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
            align-items: center;
        }

        .search-box {
            flex: 1;
            min-width: 250px;
            position: relative;
        }

        .search-box input {
            width: 100%;
            padding: 0.8rem 1rem 0.8rem 3rem;
            border: 2px solid #e2e8f0;
            border-radius: 50px;
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .search-box input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

        .search-box i {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: #94a3b8;
        }

        .filter-buttons {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .filter-btn {
            padding: 0.6rem 1.2rem;
            border: 2px solid #e2e8f0;
            background: white;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .filter-btn:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .filter-btn.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        /* Quiz Categories Grid */
        .quiz-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 2rem;
            margin-bottom: 3rem;
        }

        .quiz-card {
            background: white;
            border-radius: 20px;
            overflow: hidden;
            box-shadow: var(--card-shadow);
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
        }

        .quiz-card:hover {
            transform: translateY(-10px);
            box-shadow: var(--hover-shadow);
        }

        .quiz-card-image {
            height: 200px;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            position: relative;
            overflow: hidden;
        }

        .quiz-card-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .quiz-card:hover .quiz-card-image img {
            transform: scale(1.1);
        }

        .quiz-card-icon {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background: rgba(255, 255, 255, 0.9);
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }

        .quiz-card-content {
            padding: 1.5rem;
        }

        .quiz-card h3 {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
            color: var(--dark-color);
        }

        .quiz-card p {
            color: #64748b;
            margin-bottom: 1rem;
        }

        .quiz-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid #e2e8f0;
        }

        .quiz-difficulty {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .difficulty-badge {
            padding: 0.3rem 0.8rem;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .difficulty-easy {
            background: #dcfce7;
            color: #16a34a;
        }

        .difficulty-medium {
            background: #fef3c7;
            color: #d97706;
        }

        .difficulty-hard {
            background: #fee2e2;
            color: #dc2626;
        }

        .quiz-questions {
            color: #64748b;
            font-size: 0.9rem;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            animation: fadeIn 0.3s ease;
        }

        .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 20px;
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            animation: slideIn 0.3s ease;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .modal-header h2 {
            color: var(--dark-color);
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #64748b;
            transition: color 0.3s ease;
        }

        .close-btn:hover {
            color: var(--dark-color);
        }

        .modal-body {
            color: var(--text-color);
        }

        .quiz-details {
            margin-bottom: 1.5rem;
        }

        .quiz-details p {
            margin-bottom: 0.8rem;
        }

        .start-quiz-btn {
            width: 100%;
            padding: 1rem;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .start-quiz-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
        }

        /* Footer */
        footer {
            background: var(--dark-color);
            color: white;
            text-align: center;
            padding: 2rem;
            margin-top: 4rem;
        }

        /* Animations */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        @keyframes slideIn {
            from {
                transform: translate(-50%, -60%);
                opacity: 0;
            }
            to {
                transform: translate(-50%, -50%);
                opacity: 1;
            }
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .hero h1 {
                font-size: 2.5rem;
            }

            .hero p {
                font-size: 1.1rem;
            }

            .stats {
                flex-direction: column;
                gap: 1.5rem;
            }

            .nav-links {
                display: none;
            }

            .quiz-grid {
                grid-template-columns: 1fr;
            }

            .search-filter {
                flex-direction: column;
            }

            .search-box {
                width: 100%;
            }
/*
|--------------------------------------------------------------------------
| QUIZMASTER UNIFIED CSS (CONTINUED)
|--------------------------------------------------------------------------
| Adding styles for the Quiz Page and Results Page.
*/

/* 8. Quiz Page Styles (quiz.html) */
.quiz-container {
    max-width: 800px;
    margin: 120px auto 40px auto; /* Margin to clear the fixed header */
    padding: 2rem;
    background: var(--light-color);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

#quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    color: var(--dark-color);
}

#quiz-body h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.option-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.option-item input[type="radio"] {
    display: none;
}

.option-item input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border-color: var(--primary-color);
}

.option-item label {
    flex-grow: 1;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    color: var(--text-color);
}

.option-item input[type="radio"]:checked + label:before {
    content: "●";
    margin-right: 10px;
    color: white;
}

#quiz-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

#quiz-footer button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#next-btn, #submit-btn {
    background: var(--primary-color);
    color: white;
}

#prev-btn {
    background: #e2e8f0;
    color: var(--text-color);
}

#prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#next-btn:hover, #submit-btn:hover {
    background: var(--secondary-color);
}

.hidden {
    display: none !important;
}

/* 9. Results Page Styles (result.html) */
.results-card {
    max-width: 800px;
    margin: 120px auto 40px auto;
    padding: 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.results-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

#final-score {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.home-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.results-card h3 {
    text-align: left;
    margin-top: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-color);
}

#answers-review {
    margin-top: 1.5rem;
    text-align: left;
}

.review-item {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
}

.review-item h4 {
    margin-bottom: 0.5rem;
}

.review-item p {
    margin-bottom: 0.2rem;
    color: #64748b;
}

.review-item.correct {
    background-color: #dcfce7; /* Light Green */
    border: 1px solid #a7f3d0;
}

.review-item.incorrect {
    background-color: #fee2e2; /* Light Red */
    border: 1px solid #fecaca;
}

.correct-text {
    color: #dc2626 !important; /* Dark Red */
    font-weight: 500;
}

@media (max-width: 768px) {
    .quiz-container, .results-card {
        margin: 100px 1rem 20px 1rem;
        padding: 1.5rem;
    }

    #quiz-header {
        flex-direction: column;
        align-items: flex-start;
    }
};
