/* ==================== ROOT VARIABLES ==================== */
:root {
    /* Light Theme Colors */
    --primary: #e63946;
    --primary-dark: #c41e3a;
    --secondary: #457b9d;
    --accent: #f77f00;
    --success: #06d6a0;
    --warning: #ffd60a;
    --error: #e63946;
    
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #6a6a6a;
    
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    
    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-tertiary: #8b949e;
    
    --border: #30363d;
    --shadow: rgba(0, 0, 0, 0.5);
    --shadow-lg: rgba(0, 0, 0, 0.6);
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== THEME TOGGLE ==================== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.theme-toggle .sun-icon {
    display: block;
    color: var(--primary);
}

.theme-toggle .moon-icon {
    display: none;
    color: var(--primary);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* ==================== MOBILE MENU TOGGLE ==================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    width: 50px;
    height: 50px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 5px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ==================== INSTALL BUTTON ==================== */
.install-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 16px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(230, 57, 70, 0.4);
    transition: all 0.3s ease;
    animation: slideInRight 0.5s ease, pulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 8px;
}

.install-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.install-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(230, 57, 70, 0.5);
}

.install-btn:active {
    transform: translateY(-2px);
}

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

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(230, 57, 70, 0.4);
    }
    50% {
        box-shadow: 0 8px 24px rgba(230, 57, 70, 0.6);
    }
}

/* ==================== CONTAINER ==================== */
.container {
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 999;
}

.sidebar-header {
    margin-bottom: 32px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==================== PROGRESS TRACKER ==================== */
.progress-tracker {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
}

/* ==================== NAVIGATION ==================== */
.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-color: var(--primary);
}

.nav-icon {
    font-size: 20px;
}

/* ==================== SIDEBAR FOOTER ==================== */
.sidebar-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.version {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.7;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: 320px;
    flex: 1;
    padding: 40px;
    max-width: 1200px;
}

/* ==================== HERO ==================== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 48px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 8px 16px var(--shadow-lg);
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
}

.hero-description {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.95;
}

/* ==================== CONTENT SECTIONS ==================== */
.content-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.content-section.active {
    display: block;
}

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

/* ==================== CARDS ==================== */
.info-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow-lg);
}

.info-card h3 {
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
}

.info-card li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* ==================== FORMULA BOX ==================== */
.formula-box {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

/* ==================== QUIZ BUTTON ==================== */
.quiz-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow-lg);
}

/* ==================== QUIZ MODAL ==================== */
.quiz-option {
    width: 100%;
    text-align: left;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.quiz-option:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateX(4px);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px;
        padding-top: 80px;
    }
    
    .hero {
        padding: 32px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    .theme-toggle {
        top: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    .install-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px;
        padding-top: 80px;
    }
    
    .hero {
        padding: 24px;
        border-radius: 16px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-description {
        font-size: 15px;
    }
    
    .info-card {
        padding: 20px;
    }
    
    .info-card h3 {
        font-size: 20px;
    }
    
    .formula-box {
        font-size: 16px;
        padding: 16px;
    }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .sidebar,
    .theme-toggle,
    .mobile-menu-toggle,
    .install-btn,
    .quiz-btn {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}
