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

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2333;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #5c6b7e;
    --royal-blue: #2d7dd2;
    --royal-blue-light: #4a8fd8;
    --royal-blue-dim: rgba(45, 125, 210, 0.15);
    --royal-blue-glow: rgba(45, 125, 210, 0.25);
    --border: #2d3748;
    --success: #3fb950;
    --success-bg: rgba(63, 185, 80, 0.12);
    --error: #f85149;
    --error-bg: rgba(248, 81, 73, 0.12);
    --warning: #d29922;
    --warning-bg: rgba(210, 153, 34, 0.12);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

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

.hidden {
    display: none !important;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* ============================================
   AUTH STYLES
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 20px;
    }
}

.auth-card .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-card .logo-icon {
    width: 48px;
    height: 48px;
    background: var(--royal-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .auth-card h1 {
        font-size: 20px;
    }
}

.auth-card .subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 15px;
}

.auth-card .input-group {
    margin-bottom: 16px;
}

.auth-card .input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-card input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.auth-card input:focus {
    outline: none;
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 3px var(--royal-blue-glow);
}

.auth-card button {
    width: 100%;
    padding: 13px;
    background: var(--royal-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.auth-card button:hover {
    background: var(--royal-blue-light);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--royal-blue-glow);
}

.auth-card .error {
    color: var(--error);
    font-size: 14px;
    padding: 10px 14px;
    background: var(--error-bg);
    border-radius: 8px;
    border: 1px solid rgba(248, 81, 73, 0.2);
    margin-bottom: 16px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

@media (max-width: 768px) {
    .header {
        padding: 10px 0;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    cursor: default;
}

.header-left .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--royal-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 16px;
    }
}

.logo-sub {
    color: var(--text-secondary);
    font-size: 13px;
}

@media (max-width: 480px) {
    .logo-sub {
        font-size: 12px;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .header-right {
        gap: 10px;
    }
}

.user-info {
    color: var(--text-secondary);
    font-size: 14px;
    word-break: break-all;
}

@media (max-width: 480px) {
    .user-info {
        font-size: 13px;
    }
}

.logout-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    white-space: nowrap;
}

.logout-btn:hover {
    border-color: var(--royal-blue);
    color: var(--royal-blue);
    background: var(--royal-blue-dim);
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard {
    padding: 32px 0 80px;
}

@media (max-width: 768px) {
    .dashboard {
        padding: 20px 0 60px;
    }
}

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

@media (max-width: 480px) {
    .dashboard-header {
        margin-bottom: 24px;
    }
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 22px;
    }
}

.dashboard-header .subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 4px;
}

@media (max-width: 480px) {
    .dashboard-header .subtitle {
        font-size: 14px;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--royal-blue);
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    font-size: 18px;
    margin-bottom: 6px;
    color: var(--royal-blue);
}

.stat-card .label {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

@media (max-width: 480px) {
    .stat-card .value {
        font-size: 24px;
    }
}

.timeline-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .timeline-section h2 {
        font-size: 18px;
    }
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
}

@media (max-width: 480px) {
    .timeline-item {
        padding: 12px 16px;
        gap: 12px;
        flex-wrap: wrap;
    }
}

.timeline-item:hover {
    border-color: var(--royal-blue);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.timeline-item .week-badge {
    min-width: 40px;
    height: 40px;
    background: var(--royal-blue-dim);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--royal-blue);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .timeline-item .week-badge {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

.timeline-item .week-info {
    flex: 1;
    min-width: 0;
}

.timeline-item .week-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .timeline-item .week-title {
        font-size: 14px;
    }
}

.timeline-item .week-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.timeline-item .status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .timeline-item .status-badge {
        font-size: 10px;
        padding: 3px 10px;
    }
}

.status-badge.completed {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.in-progress {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-badge.pending {
    background: var(--royal-blue-dim);
    color: var(--text-secondary);
}

/* ============================================
   WEEK VIEW
   ============================================ */
.week-view {
    padding: 24px 0 80px;
}

@media (max-width: 768px) {
    .week-view {
        padding: 16px 0 60px;
    }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 20px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--royal-blue);
}

.week-header {
    margin-bottom: 28px;
}

.week-number {
    color: var(--royal-blue);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.week-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

@media (max-width: 480px) {
    .week-title {
        font-size: 22px;
    }
}

.week-description {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .week-description {
        font-size: 14px;
    }
}

.week-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .week-content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.week-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .week-section {
        padding: 16px;
    }
}

.week-section h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}

/* ============================================
   LEARNING OBJECTIVES
   ============================================ */
.objectives-list {
    list-style: none;
    padding: 0;
}

.objectives-list li {
    padding: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 15px;
    border-bottom: 1px solid var(--bg-secondary);
}

.objectives-list li:last-child {
    border-bottom: none;
}

.objectives-list li::before {
    content: "▸";
    color: var(--royal-blue);
    font-weight: bold;
}

@media (max-width: 480px) {
    .objectives-list li {
        font-size: 14px;
    }
}

/* ============================================
   LEARNING CONTENT - PROFESSIONAL DARK
   ============================================ */
.learning-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.learning-content p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.learning-content .code-block {
    background: #0d1117;
    color: #e6edf3;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    border-left: 4px solid var(--royal-blue);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    white-space: pre-wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.learning-content .code-block code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: transparent;
    color: #e6edf3;
    padding: 0;
}

.learning-content code {
    background: #0d1117;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #f0883e;
}

/* ============================================
   CODE EXAMPLES - DARK THEME
   ============================================ */
.code-example {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.code-example h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.code-example pre {
    background: #0d1117;
    color: #e6edf3;
    padding: 14px 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    border: 1px solid #1e2a3a;
    margin: 0;
}

.code-example pre code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: transparent;
    color: #e6edf3;
    padding: 0;
    white-space: pre-wrap;
}

/* ============================================
   COMMON MISTAKES
   ============================================ */
#commonMistakes {
    list-style: none;
    padding: 0;
}

#commonMistakes li {
    padding: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #f0883e;
    font-size: 14px;
    border-bottom: 1px solid var(--bg-secondary);
}

#commonMistakes li:last-child {
    border-bottom: none;
}

#commonMistakes li::before {
    content: "⚠";
    font-size: 16px;
    flex-shrink: 0;
}

/* ============================================
   PROJECTS
   ============================================ */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-item {
    padding: 14px 18px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border-left: 3px solid var(--royal-blue);
}

.project-item .project-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.project-item .project-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.project-item .project-difficulty {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   EXERCISES
   ============================================ */
.exercises-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exercise-item {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise-item .exercise-name {
    font-size: 14px;
    color: var(--text-primary);
}

.exercise-item .exercise-status {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ============================================
   RESOURCES
   ============================================ */
.resources-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    font-size: 14px;
}

.resource-link:hover {
    background: var(--royal-blue-dim);
    color: var(--royal-blue);
}

/* ============================================
   QUIZ
   ============================================ */
.quiz-option {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .quiz-option {
        font-size: 14px;
        padding: 10px 14px;
    }
}

.quiz-option:hover {
    border-color: var(--royal-blue);
}

.quiz-option.selected {
    border-color: var(--royal-blue);
    background: var(--royal-blue-dim);
}

.quiz-option.correct {
    border-color: var(--success);
    background: var(--success-bg);
}

.quiz-option.wrong {
    border-color: var(--error);
    background: var(--error-bg);
}

.quiz-option .option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.quiz-option.selected .option-letter {
    background: var(--royal-blue);
    color: white;
    border-color: var(--royal-blue);
}

.quiz-option.correct .option-letter {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.quiz-option.wrong .option-letter {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

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

.quiz-option.disabled:hover {
    border-color: var(--border);
}

.quiz-submit {
    padding: 10px 24px;
    background: var(--royal-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
    width: 100%;
}

@media (max-width: 480px) {
    .quiz-submit {
        font-size: 14px;
        padding: 12px;
    }
}

.quiz-submit:hover {
    background: var(--royal-blue-light);
    box-shadow: 0 4px 16px var(--royal-blue-glow);
}

.quiz-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quiz-result {
    padding: 16px;
    border-radius: 10px;
    margin-top: 16px;
    font-weight: 600;
    text-align: center;
}

.quiz-result.pass {
    background: var(--success-bg);
    color: var(--success);
}

.quiz-result.fail {
    background: var(--error-bg);
    color: var(--error);
}

.quiz-feedback {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.quiz-feedback .wrong-answer {
    color: var(--error);
    font-weight: 500;
}

/* ============================================
   PROGRESS STATUS
   ============================================ */
.progress-status {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

.progress-status.completed {
    background: var(--success-bg);
    color: var(--success);
}

.progress-status.in-progress {
    background: var(--warning-bg);
    color: var(--warning);
}

.progress-status:not(.completed):not(.in-progress) {
    color: var(--text-secondary);
}

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

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

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

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