/* Educational Color Theme for JavaScript Learning Hub */
:root {
    /* Primary Educational Colors */
    --edu-blue: #3B82F6;
    --edu-blue-light: #60A5FA;
    --edu-blue-dark: #1D4ED8;

    --edu-green: #10B981;
    --edu-green-light: #34D399;
    --edu-green-dark: #047857;

    --edu-purple: #8B5CF6;
    --edu-purple-light: #A78BFA;
    --edu-purple-dark: #7C3AED;

    --edu-yellow: #F59E0B;
    --edu-yellow-light: #FBBF24;
    --edu-yellow-dark: #D97706;

    /* Neutral Colors */
    --edu-bg: #F9FAFB;
    --edu-bg-secondary: #F3F4F6;
    --edu-text: #374151;
    --edu-text-light: #6B7280;
    --edu-text-dark: #111827;

    /* Code Colors */
    --code-bg: #1F2937;
    --code-text: #F9FAFB;
    --code-comment: #6B7280;
    --code-keyword: #60A5FA;
    --code-string: #34D399;
    --code-number: #FBBF24;
    --code-function: #A78BFA;
}

/* Enhanced Typography */
.edu-heading {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.edu-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
}

.edu-code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Custom Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--edu-blue), var(--edu-blue-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    background: white;
    color: var(--edu-blue);
    border: 2px solid var(--edu-blue);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--edu-blue);
    color: white;
    transform: translateY(-1px);
}

/* Card Enhancements */
.lesson-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
}

.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.lesson-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--edu-blue), var(--edu-blue-dark));
    color: white;
}

.lesson-card-body {
    padding: 1.5rem;
}

/* Code Block Styling */
.code-block {
    background: var(--code-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    border: 1px solid #374151;
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #EF4444;
    box-shadow: 1.25rem 0 0 #F59E0B, 2.5rem 0 0 #10B981;
}

.code-line {
    display: block;
    padding: 0.125rem 0;
}

.code-comment {
    color: var(--code-comment);
    font-style: italic;
}

.code-keyword {
    color: var(--code-keyword);
    font-weight: 600;
}

.code-string {
    color: var(--code-string);
}

.code-number {
    color: var(--code-number);
}

.code-function {
    color: var(--code-function);
}

/* Progress Indicators */
.progress-bar {
    background: #E5E7EB;
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--edu-green), var(--edu-blue));
    height: 100%;
    transition: width 0.3s ease;
}

/* Interactive Elements */
.interactive-demo {
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.demo-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.demo-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    font-family: var(--edu-code);
}

.demo-output {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1rem;
    border-radius: 0.375rem;
    margin-top: 1rem;
    font-family: var(--edu-code);
    min-height: 3rem;
}

/* Difficulty Badges */
.difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-beginner {
    background: #D1FAE5;
    color: #065F46;
}

.difficulty-intermediate {
    background: #FEF3C7;
    color: #92400E;
}

.difficulty-advanced {
    background: #FEE2E2;
    color: #991B1B;
}

/* Algorithm Complexity Display */
.complexity-display {
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.complexity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #E5E7EB;
}

.complexity-item:last-child {
    border-bottom: none;
}

.complexity-value {
    font-family: var(--edu-code);
    font-weight: 600;
    color: var(--edu-purple);
}

/* Navigation Enhancements */
.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--edu-bg);
    color: var(--edu-blue);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2rem;
    height: 0.125rem;
    background: var(--edu-blue);
    border-radius: 9999px;
}

/* Responsive Design Helpers */
@media (max-width: 768px) {
    .lesson-card-header {
        padding: 1rem;
    }

    .lesson-card-body {
        padding: 1rem;
    }

    .demo-controls {
        flex-direction: column;
    }

    .demo-input {
        min-width: 100%;
    }
}

/* Animation Utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.focus-visible:focus {
    outline: 2px solid var(--edu-blue);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .lesson-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .code-block {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

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

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

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

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