:root {
    --bg-color: #09090b;
    --surface-color: #18181b;
    --surface-light: #27272a;
    --border-color: #3f3f46;
    --primary: #00E5FF;
    --secondary: #B026FF;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --code-bg: #000000;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Glow Effects */
body::before, body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

body::before {
    background: var(--primary);
    top: -200px;
    left: -200px;
}

body::after {
    background: var(--secondary);
    bottom: -200px;
    right: -200px;
}

.app-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    gap: 3rem;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

/* Main Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}

.sidebar h2 {
    font-size: 1.8rem;
    margin-bottom: 2.5rem;
    line-height: 1.3;
    transition: all 0.3s ease;
}

#main-nav {
    list-style: none;
}

#main-nav li {
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

#main-nav li:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    transform: translateX(4px);
}

#main-nav li.active {
    background: var(--surface-light);
    color: var(--text-main);
    border-color: var(--border-color);
    box-shadow: inset 3px 0 0 var(--primary);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

/* Content Area */
.content-area {
    flex: 1;
    min-width: 0; /* Prevents overflow */
}

.main-tab-content {
    display: none;
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.main-tab-content.active {
    display: block;
}

.topic-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.topic-header h1 {
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

/* Inner Tabs (Aufgabe, Snippets, Lösung, Facts) */
.inner-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0px;
}

.inner-tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    position: relative;
    transition: color 0.3s ease;
}

.inner-tab-btn:hover {
    color: var(--text-main);
}

.inner-tab-btn.active {
    color: var(--primary);
}

.inner-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 -2px 12px rgba(0, 229, 255, 0.8);
    animation: tabGlow 1.5s infinite alternate;
}

.inner-content {
    display: none;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.inner-content h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    font-size: 1.25rem;
}

.inner-content h3:first-child {
    margin-top: 0;
}

.inner-content p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Fact Cards */
.fact-card {
    background: rgba(176, 38, 255, 0.03);
    border-left: 3px solid var(--secondary);
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(176, 38, 255, 0.1);
    border-left-width: 4px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fact-card:hover {
    transform: translateY(-3px) scale(1.005);
    background: rgba(176, 38, 255, 0.06);
    box-shadow: 0 8px 20px rgba(176, 38, 255, 0.15);
    border-color: rgba(176, 38, 255, 0.3);
    border-left-color: var(--primary);
}

.fact-card h4 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Code Blocks with Copy Button */
.code-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.code-wrapper pre {
    background-color: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
    transition: border-color 0.3s ease;
}

.code-wrapper:hover pre {
    border-color: rgba(255, 255, 255, 0.25);
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
}

.copy-btn:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Interactive Demo Box */
.demo-box {
    background: #000;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-tech {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    cursor: pointer;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-tech:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
    transform: translateY(-2px);
}

.btn-tech:active {
    transform: translateY(1px);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.badge-snippet {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.badge-solution {
    background: rgba(0, 229, 255, 0.06);
    color: var(--primary);
    border: 1px solid rgba(0, 229, 255, 0.3);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 6px;
    border: 2px solid var(--bg-color);
}

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

/* Animations */
@keyframes fadeUp {
    from { 
        opacity: 0; 
        transform: translateY(12px); 
        filter: blur(2px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
        filter: blur(0);
    }
}

@keyframes tabGlow {
    from {
        box-shadow: 0 -2px 10px rgba(0, 229, 255, 0.5);
    }
    to {
        box-shadow: 0 -2px 18px rgba(0, 229, 255, 0.9);
    }
}

/* Comparison Grid for Snippets vs Solution */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: start;
}

.given-snippet-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 10px;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.given-snippet-box:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.solution-box {
    background: rgba(0, 229, 255, 0.01);
    border: 1px solid rgba(0, 229, 255, 0.15);
    padding: 1.5rem;
    border-radius: 10px;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.solution-box:hover {
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.03);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.05);
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 1100px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    /* Sticky, frosted-glass header */
    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(9, 9, 11, 0.8);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
        padding: 1.25rem 1rem 0.75rem 1rem;
    }

    .sidebar h2 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
        text-align: center;
    }

    /* Horizontal scroll navigation for topics */
    #main-nav {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        scrollbar-width: none; /* Firefox */
        -webkit-overflow-scrolling: touch;
    }

    #main-nav::-webkit-scrollbar {
        display: none; /* Safari & Chrome */
    }

    #main-nav li {
        margin-bottom: 0;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        flex-shrink: 0;
        border-radius: 6px;
    }

    #main-nav li:hover {
        transform: none; /* Disable shift-aside animation on mobile horizontal scroll */
    }

    #main-nav li.active {
        box-shadow: inset 0 -2px 0 var(--primary); /* Bottom active indicator instead of left */
    }

    /* Content Area styling for Mobile */
    .content-area {
        padding: 1.5rem 1rem;
    }

    .topic-header {
        margin-bottom: 1.5rem;
    }

    .topic-header h1 {
        font-size: 1.8rem;
    }

    .inner-tabs {
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        gap: 0.25rem;
    }
    
    .inner-tabs::-webkit-scrollbar {
        display: none;
    }

    .inner-tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .inner-content {
        padding: 1.25rem;
        border-radius: 10px;
    }

    .inner-content h3 {
        font-size: 1.15rem;
    }

    .code-wrapper pre {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .copy-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
        top: 6px;
        right: 6px;
    }
}

/* ==========================================================================
   NETWORK TAB SPECIFIC STYLES
   ========================================================================== */

/* OSI Visualizer */
.osi-visualizer {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    align-items: stretch;
}

.osi-layers {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.osi-layer {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.osi-layer::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.3s ease;
}

.osi-layer[data-layer="4"]::before { background: #FF007F; }
.osi-layer[data-layer="3"]::before { background: #FF7F00; }
.osi-layer[data-layer="2"]::before { background: #7F00FF; }
.osi-layer[data-layer="1"]::before { background: #00FF7F; }

.osi-layer:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.05);
}

.osi-layer.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-muted);
}

.osi-layer.active[data-layer="4"] { border-color: #FF007F; box-shadow: 0 0 15px rgba(255, 0, 127, 0.2); }
.osi-layer.active[data-layer="3"] { border-color: #FF7F00; box-shadow: 0 0 15px rgba(255, 127, 0, 0.2); }
.osi-layer.active[data-layer="2"] { border-color: #7F00FF; box-shadow: 0 0 15px rgba(127, 0, 255, 0.2); }
.osi-layer.active[data-layer="1"] { border-color: #00FF7F; box-shadow: 0 0 15px rgba(0, 255, 127, 0.2); }

.layer-num {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.layer-name {
    font-weight: 600;
    font-size: 1rem;
    flex-grow: 1;
    margin-left: 1.5rem;
}

.layer-badge {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.osi-details-panel {
    flex: 1.2;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.osi-details-panel h3 {
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.osi-desc ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.osi-desc li {
    margin-bottom: 0.5rem;
}

/* DNS Simulator styles */
.dns-sim-container {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.sim-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.dns-canvas {
    height: 250px;
    position: relative;
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    overflow: hidden;
    margin-bottom: 1rem;
}

.dns-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.5s ease;
}

.node-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.dns-node.client { left: 50px; top: 100px; }
.dns-node.dns-server { left: 280px; top: 25px; }
.dns-node.web-server { left: 500px; top: 100px; }
.dns-node.hacker { left: 280px; top: 175px; display: none; }

.dns-node.active .node-icon {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    transform: scale(1.1);
}

.dns-node.hacker.active .node-icon {
    border-color: var(--secondary);
    box-shadow: 0 0 15px var(--secondary);
}

.dns-packet {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    top: 0;
    left: 0;
    display: none;
    z-index: 5;
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sim-console {
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 60px;
    border-left: 3px solid var(--primary);
    transition: all 0.3s ease;
}

/* Terminal Simulator Styles */
.terminal-container {
    background: #050505;
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    margin-top: 1.5rem;
}

.terminal-header {
    background: #18181b;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
}

.terminal-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.terminal-header .dot.red { background: #ef4444; }
.terminal-header .dot.yellow { background: #f59e0b; }
.terminal-header .dot.green { background: #22c55e; }

.terminal-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 10px;
}

.terminal-screen {
    padding: 1rem;
    height: 250px;
    overflow-y: auto;
}

.terminal-screen pre {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #22c55e; /* Matrix Green */
    white-space: pre-wrap;
    line-height: 1.4;
}

.terminal-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.btn-terminal {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-terminal:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 229, 255, 0.05);
}

/* Network Grid */
.net-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.net-card {
    background: rgba(255,255,255,0.01);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.net-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255,255,255,0.02);
}

.net-card h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
}

.net-card ol, .net-card ul {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.net-card li {
    margin-bottom: 0.25rem;
}

@media (max-width: 900px) {
    .osi-visualizer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .osi-layer {
        padding: 0.8rem 1rem;
    }
    
    .layer-name {
        margin-left: 0.75rem;
        font-size: 0.9rem;
    }
    
    .layer-badge {
        font-size: 0.7rem;
    }
    
    .net-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dns-canvas {
        height: 250px;
    }
    
    .dns-node.client { left: 15px; top: 80px; }
    .dns-node.dns-server { left: 135px; top: 15px; }
    .dns-node.web-server { left: 255px; top: 80px; }
    .dns-node.hacker { left: 135px; top: 155px; }
    
    .dns-node {
        width: 80px;
    }
    .node-icon {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   BUBBLESORT VISUALIZER
   ========================================================================== */
.sort-visualizer {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sort-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.sort-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    height: 200px;
    padding: 0 1rem;
}

.sort-bar {
    flex: 1;
    max-width: 50px;
    background: linear-gradient(to top, var(--primary), rgba(0, 229, 255, 0.5));
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease, background 0.3s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.sort-bar span {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: #fff;
    padding-top: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.sort-bar.comparing {
    background: linear-gradient(to top, #f59e0b, rgba(245, 158, 11, 0.5));
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.sort-bar.swapping {
    background: linear-gradient(to top, #ef4444, rgba(239, 68, 68, 0.5));
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.sort-bar.sorted {
    background: linear-gradient(to top, #22c55e, rgba(34, 197, 94, 0.5));
}

/* ==========================================================================
   ZAHLENSYSTEME: CONVERTER
   ========================================================================== */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.conv-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.conv-card:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

.conv-card label {
    display: block;
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.base-badge {
    font-size: 0.7rem;
    font-weight: 400;
    background: rgba(0, 229, 255, 0.1);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.conv-input {
    width: 100%;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    color: var(--primary);
    font-family: 'Fira Code', monospace;
    font-size: 1.3rem;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s ease;
}

.conv-input:focus {
    border-color: var(--primary);
}

.conv-input::placeholder {
    color: var(--border-color);
    font-size: 1rem;
}

.conv-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ==========================================================================
   ZAHLENSYSTEME: BIT VISUALIZER
   ========================================================================== */
.bit-viz {
    margin-top: 1.5rem;
}

.bit-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.bit-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.bit-weight {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.bit-toggle {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-muted);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bit-cell.active .bit-toggle {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
    transform: scale(1.05);
}

.bit-result {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.bit-res-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    text-align: center;
    min-width: 100px;
}

.bit-res-item span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.bit-res-item strong {
    font-family: 'Fira Code', monospace;
    font-size: 1.2rem;
    color: var(--primary);
}

/* ==========================================================================
   DATENBANKEN: NORMALIZATION STEPPER
   ========================================================================== */
.norm-stepper {
    margin-top: 1.5rem;
}

.norm-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.norm-step-btn {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.norm-step-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

.norm-step-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.norm-display {
    animation: fadeUp 0.3s ease forwards;
}

.norm-explanation {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.norm-explanation h4 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.norm-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.norm-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

.norm-table-wrapper th {
    background: var(--surface-light);
    color: var(--primary);
    padding: 0.6rem 0.8rem;
    text-align: left;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.norm-table-wrapper td {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.norm-table-wrapper .highlight {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.norm-table-wrapper .pk {
    color: var(--primary);
    font-weight: bold;
}

/* ER Model shapes */
.er-section {
    margin-top: 2rem;
}

.er-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.er-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
}

.er-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.2);
}

.er-shape {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    font-size: 0.85rem;
}

.er-shape.entity {
    width: 100px;
    height: 50px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    color: var(--primary);
}

.er-shape.attribute {
    width: 100px;
    height: 50px;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    color: var(--secondary);
}

.er-shape.relation {
    width: 100px;
    height: 50px;
    border: 2px solid #f59e0b;
    transform: rotate(45deg);
    color: #f59e0b;
    font-size: 0.7rem;
}

.er-shape.relation {
    transform: none;
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    background: rgba(245, 158, 11, 0.1);
    height: 60px;
}

.er-shape.key {
    width: 60px;
    height: 50px;
    border: 2px solid #22c55e;
    border-radius: 8px;
    color: #22c55e;
    font-size: 1.2rem;
}

/* SQL Grid */
.sql-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
}

.sql-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.sql-card:hover {
    border-color: rgba(255,255,255,0.2);
}

.sql-card h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* Nav Icons */
.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE RESPONSIVE (ALL COMPONENTS)
   ========================================================================== */
@media (max-width: 900px) {
    .converter-grid {
        grid-template-columns: 1fr;
    }
    
    .conv-input {
        font-size: 1.1rem;
    }
    
    .bit-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .bit-row {
        gap: 6px;
    }
    
    .bit-res-item {
        min-width: 80px;
        padding: 0.5rem 0.75rem;
    }
    
    .bit-res-item strong {
        font-size: 1rem;
    }
    
    .norm-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    
    .norm-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .norm-step-btn {
        flex-shrink: 0;
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .er-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .sql-grid {
        grid-template-columns: 1fr;
    }
    
    .sort-bars {
        height: 160px;
        gap: 4px;
        padding: 0;
    }
    
    .sort-bar span {
        font-size: 0.6rem;
    }
    
    .sim-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sim-controls .btn-tech {
        width: 100%;
    }
    
    .terminal-buttons {
        flex-direction: column;
    }
    
    .btn-terminal {
        width: 100%;
        text-align: left;
    }
    
    .fact-card {
        padding: 1rem;
    }
    
    .fact-card h4 {
        font-size: 1rem;
    }
    
    .net-card {
        padding: 1rem;
    }
    
    .net-card h4 {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .er-grid {
        grid-template-columns: 1fr;
    }
    
    .bit-toggle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .bit-weight {
        font-size: 0.6rem;
    }
    
    .topic-header h1 {
        font-size: 1.5rem;
    }
    
    .inner-content {
        padding: 1rem;
    }
    
    .comparison-grid {
        gap: 1rem;
    }
    
    .given-snippet-box,
    .solution-box {
        padding: 1rem;
    }
}
