/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Light Mode (Default) */
:root {
    --primary-color: #f7df1e;
    --secondary-color: #323330;
    --accent-color: #61dafb;
    --bg-color: #f5f5f5;
    --text-color: #333;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --hover-color: #34495e;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --code-bg: #282c34;
    --code-text: #abb2bf;
    --output-bg: #1e1e1e;
    --output-text: #d4d4d4;
    --hero-gradient: linear-gradient(135deg, var(--primary-color), #f4d03f);
    --modal-overlay: rgba(0, 0, 0, 0.7);
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #f7df1e;
    --secondary-color: #e0e0e0;
    --accent-color: #61dafb;
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --sidebar-bg: #121212;
    --sidebar-text: #e0e0e0;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --hover-color: #3a3a3a;
    --success-color: #4ade80;
    --error-color: #f87171;
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --output-bg: #0d1117;
    --output-text: #c9d1d9;
    --hero-gradient: linear-gradient(135deg, #323330, #2c3e50);
    --modal-overlay: rgba(0, 0, 0, 0.9);
}

/* Read Mode (Sepia/Paper-like) */
[data-theme="read"] {
    --primary-color: #8b6914;
    --secondary-color: #5c4a1f;
    --accent-color: #6b4423;
    --bg-color: #f4ecd8;
    --text-color: #3e2723;
    --sidebar-bg: #8b7355;
    --sidebar-text: #f4ecd8;
    --card-bg: #faf7f0;
    --border-color: #d4c5a9;
    --hover-color: #a0826d;
    --success-color: #6b8e23;
    --error-color: #8b4513;
    --code-bg: #2d2416;
    --code-text: #e8d5b7;
    --output-bg: #3e3120;
    --output-text: #f4e6d2;
    --hero-gradient: linear-gradient(135deg, #d4a574, #c49460);
    --modal-overlay: rgba(91, 74, 31, 0.85);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background:transparent;
    color: var(--sidebar-text);
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: left;
    justify-content: left;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
}

.sidebar-toggle-btn:hover {
    background: transparent;
    transform: scale(1.05);
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow: hidden;
    overflow-x: visible;
    transition: transform 0.3s ease, width 0.3s ease, background 0.3s ease, color 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 80px;
    overflow-x: visible;
}

.sidebar.collapsed .sidebar-title-text,
.sidebar.collapsed .nav-link span {
    opacity: 0;
    visibility: hidden;
    width: 0;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}

/* Tooltip for collapsed sidebar nav items */
.sidebar.collapsed .nav-link {
    position: relative;
}

/* Dynamic tooltip element (created via JavaScript) */
.nav-tooltip {
    position: fixed;
    left: 90px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9em;
    font-weight: 500;
    pointer-events: none;
    display: none;
    transform: translateY(-50%);
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Arrow for JavaScript tooltip */
.nav-tooltip::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--sidebar-bg);
}


.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: var(--hover-color);
    border-radius: 3px;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-title {
    font-size: 23px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-title-text {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.sidebar-title a {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-menu {
    list-style: none;
    padding: 10px 0;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 80px); /* Adjust based on header height */
    flex: 1;
}

.nav-menu li {
    margin: 5px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link span {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    padding-left: 25px;
}

.nav-link.active {
    background: rgba(247, 223, 30, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 40px;
    max-width: none;
    transition: margin-left 0.3s ease, padding 0.3s ease, width 0.3s ease;
    width: calc(100% - 280px);
    box-sizing: border-box;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: hidden;
}

/* Main Content when sidebar is collapsed */
.sidebar.collapsed ~ .main-content,
.sidebar.collapsed + .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
    flex: 1 1 auto;
}

.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);
    }
}

.content-section h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.content-section h2 i {
    color: var(--primary-color);
}

.content-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.content-card h3 {
    font-size: 1.8em;
    margin: 25px 0 15px 0;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.content-card h4 {
    font-size: 1.3em;
    margin: 20px 0 10px 0;
    color: var(--secondary-color);
}

.content-card p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.content-card ul,
.content-card ol {
    margin: 15px 0 15px 30px;
    font-size: 1.1em;
}

.content-card li {
    margin-bottom: 10px;
}

.content-card code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    transition: background 0.3s ease, color 0.3s ease;
}

.content-card pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 20px;
    padding-top: 45px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    font-size: 0.95em;
    line-height: 1.5;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
}

.content-card pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Code Copy Button */
.code-block-wrapper {
    position: relative;
    margin: 15px 0;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0.9;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.copy-code-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.copy-code-btn.copied {
    background: var(--success-color);
    color: white;
}

.copy-code-btn i {
    font-size: 0.9em;
}

.content-card kbd {
    background: var(--secondary-color);
    color: var(--card-bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
}

.theme-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--secondary-color);
    border: 3px solid var(--card-bg);
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 
                0 0 0 0 rgba(247, 223, 30, 0.4),
                inset 0 2px 5px rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.theme-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.theme-btn:hover::before {
    width: 100%;
    height: 100%;
}

.theme-btn:hover {
    transform: scale(1.15) rotate(360deg);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3), 
                0 0 20px rgba(247, 223, 30, 0.6),
                inset 0 2px 5px rgba(255, 255, 255, 0.4);
}

.theme-icon {
    position: relative;
    z-index: 1;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
}

.theme-icon.fa-sun {
    color: #ffa500;
    animation: rotate-sun 20s linear infinite;
    text-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.theme-icon.fa-moon {
    color: #e0e0e0;
    animation: rotate-moon 15s linear infinite;
    text-shadow: 0 0 10px rgba(224, 224, 224, 0.5);
}

.theme-icon.fa-book-open {
    color: #8b6914;
    animation: flip-book 3s ease-in-out infinite;
}

@keyframes rotate-sun {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotate-moon {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(-15deg) scale(1.1);
    }
}

@keyframes flip-book {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(15deg);
    }
}


/* Dark theme specific styles for button */
[data-theme="dark"] .theme-btn {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: var(--primary-color);
    border-color: #404040;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 
                0 0 0 0 rgba(247, 223, 30, 0.3),
                inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .theme-btn:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6), 
                0 0 25px rgba(247, 223, 30, 0.4),
                inset 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* Read theme specific styles for button */
[data-theme="read"] .theme-btn {
    background: linear-gradient(135deg, #8b7355, #a0826d);
    color: var(--primary-color);
    border-color: #d4c5a9;
    box-shadow: 0 4px 15px rgba(91, 74, 31, 0.3), 
                0 0 0 0 rgba(139, 105, 20, 0.4),
                inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

[data-theme="read"] .theme-btn:hover {
    box-shadow: 0 6px 25px rgba(91, 74, 31, 0.4), 
                0 0 20px rgba(139, 105, 20, 0.5),
                inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: var(--hero-gradient);
    border-radius: 15px;
    margin-bottom: 40px;
    color: var(--secondary-color);
    transition: background 0.3s ease;
}

.hero h1 {
    font-size: 3em;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.subtitle {
    font-size: 1.5em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: var(--accent-color);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    background: #4fa8c5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Learning Flow */
.learning-flow {
    margin-top: 40px;
}

.learning-flow h2 {
    text-align: center;
    margin-bottom: 40px;
}

.flow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.flow-step {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.flow-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0 auto 20px;
}

.flow-step h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.flow-step p {
    color: #666;
    line-height: 1.6;
}

/* Data Type Grid */
.data-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.data-type-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.data-type-item h4 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.data-type-item code {
    background: transparent;
    color: var(--error-color);
}

/* Code Playground */
.playground-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.code-editor-container,
.output-container {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
}

.editor-header,
.output-header {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.run-btn,
.clear-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.run-btn {
    background: var(--success-color);
    color: white;
}

.run-btn:hover {
    background: #229954;
    transform: scale(1.05);
}

.clear-btn {
    background: var(--error-color);
    color: white;
}

.clear-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.code-editor-wrapper {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 300px;
    overflow: hidden;
    background: var(--code-bg);
}

.line-numbers {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 20px 0;
    padding-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
    user-select: none;
    min-width: 50px;
    width: 50px;
    flex-shrink: 0;
    overflow: hidden;
    opacity: 0.6;
    font-weight: normal;
    box-sizing: border-box;
    white-space: pre;
    display: flex;
    flex-direction: column;
}

.line-number {
    display: block;
    text-align: right;
    padding-right: 8px;
    min-height: 21px;
    line-height: 1.5;
}

.code-editor {
    flex: 1;
    min-height: 300px;
    padding: 20px;
    padding-left: 16px;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: var(--code-bg);
    color: var(--code-text);
    resize: vertical;
    outline: none;
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1.5;
    tab-size: 4;
}

.output {
    min-height: 200px;
    padding: 20px;
    background: var(--output-bg);
    color: var(--output-text);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-y: auto;
    max-height: 400px;
    transition: background 0.3s ease, color 0.3s ease;
}

.output .error {
    color: #f48771;
}

.output .success {
    color: #4ec9b0;
}

/* Cheat Sheet */
.cheat-sheet-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.cheat-sheet-content {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 30px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
    transition: background 0.3s ease, color 0.3s ease;
}

.cheat-sheet-content h3 {
    color: var(--primary-color);
    margin: 25px 0 15px 0;
    font-size: 1.5em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.cheat-sheet-content pre {
    background: var(--output-bg);
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 15px 0;
    border-left: 4px solid var(--primary-color);
    transition: background 0.3s ease;
}

/* Resources */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.resource-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.resource-card h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-card h3 i {
    color: var(--primary-color);
}

.resource-card ul {
    list-style: none;
    margin-left: 0;
}

.resource-card li {
    margin-bottom: 12px;
}

.resource-card a {
    color: var(--secondary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 4px;
}

.resource-card a:hover {
    color: var(--primary-color);
    background: rgba(247, 223, 30, 0.1);
    padding-left: 10px;
}

.resource-card a::before {
    content: "→";
    font-weight: bold;
}

/* Modal/Dialog */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    transition: background-color 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    margin: 20px;
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease;
    transition: all 0.3s ease;
}

.modal-content.fullscreen {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    margin: 0;
    border-radius: 0;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-controls {
    display: flex;
    gap: 10px;
}

.modal-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-content.fullscreen .modal-body {
    max-height: calc(100vh - 80px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar-toggle-btn {
        display: flex;
    }

    .theme-switcher {
        top: 80px;
        right: 15px;
    }

    .theme-btn {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 20px;
        padding-top: 80px;
    }
    
    .sidebar.collapsed ~ .main-content,
    .sidebar.collapsed + .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Show full sidebar when not collapsed on mobile */
    .sidebar:not(.collapsed) .sidebar-title-text,
    .sidebar:not(.collapsed) .nav-link span {
        opacity: 1;
        visibility: visible;
    }

    .hero h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1.2em;
    }

    .content-section h2 {
        font-size: 1.8em;
    }

    .flow-steps {
        grid-template-columns: 1fr;
    }

    .data-type-grid {
        grid-template-columns: 1fr;
    }

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

    .playground-container {
        flex-direction: column;
    }

    .code-editor-wrapper {
        min-height: 250px;
    }
    
    .code-editor {
        min-height: 250px;
    }
    
    .line-numbers {
        min-width: 35px;
        padding: 15px 8px;
        font-size: 12px;
    }

    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }

    .modal-header h2 {
        font-size: 1.4em;
    }

    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 15px;
    }

    .hero h1 {
        font-size: 1.5em;
    }

    .content-card {
        padding: 20px;
    }

    .cheat-sheet-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Print Styles for PDF */
@media print {
    .sidebar,
    .mobile-menu-btn,
    .btn,
    .cheat-sheet-actions {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .content-section {
        display: block;
        page-break-inside: avoid;
    }
}
