/* ===== RESET & VARIABLES ===== */
:root {
    /* Backgrounds */
    --bg-page: #F3F4F6;
    --bg-card: #FFFFFF;
    
    /* Text */
    --text-dark: #111827;
    --text-grey: #6B7280;
    
    /* Accents */
    --accent-blue: #2563EB;
    --accent-dark: #1E40AF;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* 1. LAYOUT CONTAINER */
.app-container {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 2. HEADER */
.content-header {
    background-color: #FFFFFF;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: var(--shadow-sm);
}

.header-left .main-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.header-left .main-subtitle {
    font-size: 0.9rem;
    color: var(--text-grey);
    margin-top: 2px;
}

/* Header Right Side (Button + Logo) */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Quiz Button Styles */
.quiz-btn {
    text-decoration: none;
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 18px;
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #EFF6FF;
}

.quiz-btn:hover {
    background-color: var(--accent-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

/* Logo styling */
.header-logo {
    height: 55px; 
    width: auto;
    object-fit: contain;
}

/* 3. MAIN CONTENT */
.main-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 5%;
    flex: 1;
}

/* 4. STATS SECTION */
.welcome-section {
    margin-bottom: 40px;
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-grey);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 5px;
}

/* 5. SLEEK RESUME SECTION (New Standard) */
#resume-container {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-dark));
    border-radius: 12px;
    padding: 0;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    border: 2px solid var(--accent-dark);
    color: white;
    position: relative;
    overflow: hidden;
}

#resume-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
    z-index: 1;
}

.resume-button-simple {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 25px 30px;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.resume-button-simple:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.resume-simple-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
}

.resume-icon {
    font-size: 2rem;
    margin-right: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.resume-text {
    flex: 1;
    text-align: left;
}

.resume-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.resume-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

.resume-arrow {
    font-size: 1.5rem;
    margin-left: 20px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.resume-button-simple:hover .resume-arrow {
    transform: translateX(5px);
}

/* 6. CHAPTERS GRID */
.section-header {
    margin-bottom: 25px;
    border-bottom: 2px solid #E5E7EB;
    padding-bottom: 10px;
    display: inline-block;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-bottom: 60px;
}

/* 7. CARD DESIGN */
.chapter-card {
    background: var(--bg-card);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Top Color Strip */
.chapter-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: #D1D5DB; 
    transition: 0.2s;
}

/* Colors mapped from JS */
.chapter-card.blue::before { background: #3B82F6; }
.chapter-card.teal::before { background: #14B8A6; }
.chapter-card.gold::before { background: #F59E0B; }
.chapter-card.slate::before { background: #64748B; }

/* Interactive Hover */
.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: #BFDBFE;
}

.chapter-icon {
    width: 48px; height: 48px;
    background: #F3F4F6;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: #4B5563;
    transition: 0.2s;
}

.chapter-card:hover .chapter-icon {
    background: #EFF6FF;
    color: var(--accent-blue);
}

.chapter-content { flex: 1; }

.chapter-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.chapter-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-dark);
}

.chapter-arrow {
    color: #D1D5DB;
    transition: 0.2s;
}
.chapter-card:hover .chapter-arrow {
    color: var(--accent-blue);
    transform: translateX(4px);
}

/* 8. FOOTER */
footer {
    margin-top: auto;
    background: white;
    border-top: 1px solid #E5E7EB;
    text-align: center;
    padding: 30px;
    color: var(--text-grey);
    font-size: 0.9rem;
}
.fa-heart { color: #EF4444; }

.floating-home-btn {
    position: fixed;
    bottom: 30px; right: 30px;
    width: 50px; height: 50px;
    background: var(--text-dark);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-hover);
    transition: 0.3s;
    z-index: 99;
    animation: float 3s ease-in-out infinite;
}
.floating-home-btn:hover { transform: scale(1.1); animation: none; }

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

/* ===== 9. MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    /* 1. Hide Logo & Stats */
    #desktop-logo { display: none !important; }
    #desktop-stats { display: none !important; }

    /* Layout adjustments */
    .content-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }

    /* Standardized Title First Order */
    .header-left {
        order: 1;
        width: 100%;
        padding-top: 0;
    }

    /* Standardized Button Second Order */
    .header-right {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }

    .quiz-btn {
        width: 100%; /* Full width button on mobile */
        justify-content: center;
        padding: 12px; /* Easier to tap */
    }
    
    .main-content {
        padding: 20px;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== HEARTBEAT ANIMATION ===== */
@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.heart {
    animation: heartbeat 1.5s infinite;
    display: inline-block;
}