/* MLO Exam Study Hub - Styles */

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

:root {
    --primary: #0A2342;
    --secondary: #2CA58D;
    --accent: #F46036;
    --light: #FFFDF7;
    --gray: #84A7A1;
    --success: #2CA58D;
    --error: #F46036;
}

body {
    font-family: 'Space Mono', monospace;
    background: linear-gradient(135deg, #0A2342 0%, #1a3a5a 100%);
    color: var(--light);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header Styles */
header {
    text-align: center;
    padding: 40px 20px;
    border-bottom: 3px solid var(--accent);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(244, 96, 54, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-20px) translateX(20px); }
}

h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--light);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.subtitle {
    color: var(--secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    z-index: 10;
}

.user-email {
    color: var(--secondary);
}

.logout-btn {
    background: rgba(244, 96, 54, 0.2);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--accent);
    color: var(--light);
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 253, 247, 0.05);
    border: 2px solid var(--secondary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(44, 165, 141, 0.1);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab {
    background: rgba(255, 253, 247, 0.05);
    border: 2px solid var(--gray);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
}

.tab:hover {
    border-color: var(--secondary);
    background: rgba(44, 165, 141, 0.1);
}

.tab.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Topic Cards */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.topic-card {
    background: rgba(255, 253, 247, 0.05);
    border: 2px solid rgba(255, 253, 247, 0.1);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.topic-card:hover::before {
    transform: scaleX(1);
}

.topic-card:hover {
    border-color: var(--secondary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(44, 165, 141, 0.2);
}

.topic-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--light);
}

.topic-desc {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.topic-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 253, 247, 0.1);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 253, 247, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-right: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 700;
}

/* Questions and Quizzes */
.question-card {
    background: rgba(255, 253, 247, 0.08);
    border: 2px solid rgba(255, 253, 247, 0.15);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 30px;
}

.question-text {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

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

.option {
    background: rgba(255, 253, 247, 0.03);
    border: 2px solid rgba(255, 253, 247, 0.2);
    padding: 16px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option:hover {
    border-color: var(--secondary);
    background: rgba(44, 165, 141, 0.1);
    transform: translateX(5px);
}

.option.selected {
    border-color: var(--accent);
    background: rgba(244, 96, 54, 0.1);
}

.option.correct {
    border-color: var(--success);
    background: rgba(44, 165, 141, 0.15);
}

.option.incorrect {
    border-color: var(--error);
    background: rgba(244, 96, 54, 0.15);
}

.option-letter {
    background: var(--secondary);
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

/* Buttons */
.buttons {
    display: flex;
    gap: 15px;
    margin-top: 24px;
    flex-wrap: wrap;
}

button {
    background: var(--secondary);
    color: var(--primary);
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    background: var(--accent);
    transform: scale(1.05);
}

button:disabled {
    background: var(--gray);
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 253, 247, 0.1);
    color: var(--light);
    border: 2px solid var(--gray);
}

.btn-secondary:hover {
    background: rgba(255, 253, 247, 0.15);
    border-color: var(--secondary);
}

/* Feedback */
.feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.feedback.correct {
    background: rgba(44, 165, 141, 0.15);
    border-color: var(--success);
}

.feedback.incorrect {
    background: rgba(244, 96, 54, 0.15);
    border-color: var(--error);
}

.feedback-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* Back Button */
.back-button {
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-button:hover {
    color: var(--accent);
    transform: translateX(-5px);
}

/* Session Headers */
.study-session-header {
    background: rgba(255, 253, 247, 0.05);
    border: 2px solid var(--secondary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.session-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.session-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--gray);
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Completion Card */
.completion-card {
    background: linear-gradient(135deg, rgba(44, 165, 141, 0.2), rgba(244, 96, 54, 0.2));
    border: 3px solid var(--secondary);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    animation: celebrate 0.6s ease;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.completion-title {
    font-family: 'Syne', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.completion-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent);
    margin: 20px 0;
}

.completion-message {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 30px;
}

/* Authentication Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 253, 247, 0.05);
    border: 2px solid var(--secondary);
    border-radius: 16px;
    padding: 40px;
    max-width: 420px;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.auth-card h2 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--light);
    text-align: center;
}

.auth-subtitle {
    color: var(--secondary);
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form input {
    background: rgba(255, 253, 247, 0.05);
    border: 2px solid rgba(255, 253, 247, 0.2);
    color: var(--light);
    padding: 14px 16px;
    border-radius: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--secondary);
    background: rgba(255, 253, 247, 0.08);
}

.auth-form input::placeholder {
    color: var(--gray);
}

.auth-form button {
    margin-top: 8px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--gray);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.auth-switch a:hover {
    color: var(--accent);
}

.error-message {
    background: rgba(244, 96, 54, 0.15);
    border: 1px solid var(--error);
    color: var(--light);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--light);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

    header {
        padding: 30px 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .user-info {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-top: 20px;
    }

    .topic-grid {
        grid-template-columns: 1fr;
    }

    .buttons {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .auth-card {
        padding: 30px 20px;
    }
}
