/* CSS Variables */
:root {
    --primary-color: #042dac; /* Updated to user preference */
    --primary-hover: #032080;
    --accent-color: #0474fc; /* Keeping the lighter blue as accent */
    --light-bg: #f4f7fb;
    --white: #ffffff;
    --text-main: #1a1a1a;
    --text-secondary: #5f6368;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --font-family: 'Figtree', sans-serif;
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* Reset & Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--light-bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Main Content Wrapper */
.main-content {
    max-width: 1200px;
    width: 92%;
    margin: 40px auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Module Cards Grid */
.modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.module-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(4, 45, 172, 0.1);
}

.module-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(4, 45, 172, 0.1);
}

.module-card-header {
    margin-bottom: 15px;
}

.module-card-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

.module-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

.progress {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(4, 45, 172, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
    align-self: flex-start;
}

/* Module Content Panel */
.module-panel {
    display: none;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.module-panel.active {
    display: block;
}

.panel-header {
    padding: 30px 40px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.panel-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Buttons */
.btn {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e9ecef;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #dde2e6;
}

/* Accordion Styles */
.learn-container {
    padding: 40px;
}

.accordion {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    transition: var(--transition);
}

.accordion-item:hover {
    border-color: #cbd5e0;
}

.accordion-header {
    padding: 20px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    transition: background-color 0.2s;
}

.accordion-header:hover {
    background-color: #f8f9fa;
}

.accordion-header::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.accordion-header.active {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.accordion-header.active::after {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--white);
}

.accordion-content ul {
    padding: 20px 25px 25px 45px;
    list-style-type: disc;
}

.accordion-content li {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.accordion-content li:last-child {
    margin-bottom: 0;
}

/* Quiz Styles */
.quiz-container {
    display: none;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.quiz-progress {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

#quiz-question {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    line-height: 1.4;
}

.quiz-options {
    display: grid;
    gap: 15px;
}

.quiz-option {
    width: 100%;
    padding: 20px;
    font-size: 1.1rem;
    text-align: left;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
    color: var(--text-main);
}

.quiz-option:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: rgba(4, 45, 172, 0.02);
}

.quiz-option.correct {
    background-color: #d4edda;
    border-color: var(--success-color);
    color: #155724;
    font-weight: 600;
}

.quiz-option.incorrect {
    background-color: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
    font-weight: 600;
}

.quiz-option:disabled {
    cursor: default;
    opacity: 0.8;
}

.quiz-score {
    text-align: center;
    padding: 40px 0;
}

.quiz-score h4 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.quiz-score p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.quiz-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Footer */
footer {
    margin-top: auto;
    padding: 40px 20px;
    text-align: center;
    font-size: 0.95rem;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header {
        padding: 40px 20px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }

    .main-content {
        width: 90%;
        margin: 20px auto;
        gap: 30px;
    }

    .panel-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-header h3 {
        font-size: 1.6rem;
    }

    .learn-container, .quiz-container {
        padding: 20px;
    }

    .quiz-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
