:root {
    --primary-color: #00f0ff;
    --secondary-color: #0055ff;
    --alert-color: #ff3366;
    --bg-dark: #0a0f1c;
    --text-light: #e0e6ed;
    --glass-bg: rgba(20, 25, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background: radial-gradient(circle at center, #111a2f 0%, #050810 100%);
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
}

.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

/* Glass Header */
.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-light);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
    text-transform: uppercase;
    font-size: 14px;
}

nav a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    perspective: 1000px;
}

.hero-content {
    max-width: 800px;
    padding: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.hero-content:hover {
    transform: rotateX(5deg) rotateY(5deg);
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    transform: translateZ(50px);
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 40px;
    line-height: 1.6;
    transform: translateZ(30px);
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 10px 20px rgba(0, 240, 255, 0.3);
    transition: all 0.3s ease;
    transform: translateZ(40px);
}

.btn-primary:hover {
    transform: translateZ(50px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 240, 255, 0.5);
}

/* Sections */
.section-container {
    padding: 100px 50px;
    position: relative;
    z-index: 10;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: var(--primary-color);
}

/* Section Styling (Backgrounds & Borders) */
#rechner {
    background: linear-gradient(180deg, rgba(10, 15, 28, 0.9) 0%, rgba(5, 8, 16, 0.95) 100%);
    border-top: 1px solid rgba(0, 240, 255, 0.2);
}

#lektionen {
    background: #0a0f1c;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#arduino {
    background: linear-gradient(180deg, rgba(0, 151, 157, 0.05) 0%, rgba(10, 15, 28, 0.9) 100%);
    border-top: 2px solid #00979d;
    border-bottom: 2px solid #00979d;
}

#arduino .section-title {
    color: #00979d;
    text-shadow: 0 0 15px rgba(0, 151, 157, 0.5);
}

/* Grid Layouts */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    perspective: 1200px;
}

/* 3D Cards */
.card-3d {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.4s ease;
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-3d:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.3);
}

.card-3d h3 {
    margin-bottom: 15px;
    font-size: 22px;
    color: var(--primary-color);
    transform: translateZ(30px);
}

.card-3d p {
    margin-bottom: 25px;
    color: #aaa;
    line-height: 1.5;
    transform: translateZ(20px);
}

/* Calc Card (Einfacher Zoom statt 3D Tilt) */
.calc-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 15px !important;
    padding: 30px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.calc-card:hover {
    transform: translateY(-5px) scale(1.03) !important;
    box-shadow: 0 15px 35px rgba(0, 240, 255, 0.2) !important;
    border-color: var(--primary-color) !important;
}

.calc-card h3 {
    margin-bottom: 15px !important;
    font-size: 22px !important;
    color: var(--primary-color) !important;
}

.calc-card p {
    margin-bottom: 25px !important;
    color: #aaa !important;
    line-height: 1.5 !important;
}

/* Calculators */
.calculator {
    transform: translateZ(40px);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #ccc;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.btn-calc, .btn-clear {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.btn-calc {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #000;
}

.btn-calc:hover {
    box-shadow: 0 0 15px var(--primary-color);
}

.btn-clear {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--glass-border);
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

.result-box {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 240, 255, 0.1);
    border-left: 4px solid var(--primary-color);
    font-size: 18px;
    font-weight: 700;
}

/* Widerstand CSS Modell */
.color-bands-display {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 25px !important;
    padding: 20px 0 !important;
}

.resistor-body {
    width: 200px !important;
    height: 50px !important;
    background: #e6ccb8 !important;
    border-radius: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 10px !important;
    box-shadow: inset 0 -10px 10px rgba(0,0,0,0.3), 0 5px 15px rgba(0,0,0,0.5) !important;
    position: relative !important;
}

.color-band {
    width: 15px !important;
    height: 100% !important;
    border-radius: 2px !important;
}

.color-band.gap {
    width: 25px;
}

.band-wire {
    width: 50px;
    height: 6px;
    background: linear-gradient(to bottom, #ccc, #888, #ccc);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

/* Stromfluss Animation (Electron-Flow) */
.band-wire::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.8), transparent);
    animation: flowLight 1.5s infinite linear;
    box-shadow: 0 0 10px var(--primary-color);
}

@keyframes flowLight {
    0% { left: -100%; opacity: 0; }
    50% { opacity: 1; }
    100% { left: 200%; opacity: 0; }
}

.color-select-group select {
    margin-bottom: 5px;
}

/* Lektionen */
.lektionen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.glass-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 30px;
    transition: transform 0.3s;
}

.glass-panel:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 20px rgba(0, 240, 255, 0.1);
    border-color: rgba(255,255,255,0.2);
}

.glass-panel h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Arduino Cards */
.arduino-card {
    border: 1px solid #00979d !important;
    background: linear-gradient(135deg, rgba(0, 151, 157, 0.1) 0%, rgba(0, 151, 157, 0.02) 100%) !important;
}

.arduino-card h3 {
    color: #00979d !important;
}

.arduino-card:hover {
    transform: translateY(-8px) scale(1.03) !important;
    box-shadow: 0 20px 40px rgba(0, 151, 157, 0.5) !important;
    border-color: #00f0ff !important;
    z-index: 100 !important;
    position: relative !important;
}

/* Klick-Feedback für alle Karten */
.card-3d:active, .glass-panel:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s;
}

/* Lektionen Modal */
.modal-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 9999 !important;
    justify-content: center !important;
    align-items: center !important;
}

.modal-content {
    background: var(--bg-dark) !important;
    border: 1px solid var(--primary-color) !important;
    width: 90% !important;
    max-width: 800px !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    padding: 30px !important;
    position: relative !important;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.3) !important;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 30px;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: bold;
}

.close-btn:hover {
    color: #fff;
    text-shadow: 0 0 10px #fff;
}

#modal-title {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 28px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

#modal-body {
    line-height: 1.6;
    color: #ccc;
}

#modal-body h4 {
    color: #fff;
    margin: 20px 0 10px 0;
}

#modal-body pre {
    background: #111;
    padding: 15px;
    border-left: 3px solid #00979d;
    overflow-x: auto;
    margin: 15px 0;
    color: #00f0ff;
    font-family: monospace;
}

/* Spezielle Design-Boxen für Berechnungen in Lektionen */
.lektion-calc-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.lektion-calc-box {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-left: 5px solid var(--primary-color);
    border-radius: 10px;
    padding: 30px;
    box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.lektion-calc-box h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.lektion-calc-box p {
    color: #bbb;
    margin-bottom: 20px;
}

.lektion-calc-box .calculator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
}

@media (max-width: 600px) {
    .lektion-calc-box .calculator {
        grid-template-columns: 1fr;
    }
}

.lektion-calc-box .input-group select,
.lektion-calc-box .input-group input {
    background: rgba(255, 255, 255, 0.05);
}

.lektion-calc-box .result-box {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.lektion-calc-box .btn-calc {
    grid-column: 1 / -1;
}

/* Spezial-Schatten für interaktive Boxen */
.glow-box {
    position: relative;
    overflow: hidden;
}

.glow-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,240,255,0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.glow-box:hover::before {
    opacity: 1;
}

/* Werkzeuge & Icons */
.tool-icon {
    font-size: 50px;
    margin-bottom: 20px;
    transform: translateZ(50px);
}

/* Sicherheit Section */
.bg-alert {
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCI+IDxwYXRoIGQ9Ik0wIDBsNDAgNDBWMHoiIGZpbGw9InJnYmEoMjU1LCA1MCwgMTAwLCAwLjA1KSIvPiA8cGF0aCBkPSJNMCA0MGw0MC00MEgweiIgZmlsbD0icmdiYSg1MCwgMCwgMCwgMC4wNSkiLz4gPC9zdmc+');
    background-color: #1a0f12;
    border-top: 2px solid var(--alert-color);
    border-bottom: 2px solid var(--alert-color);
}

.intro-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px auto;
    font-size: 18px;
    line-height: 1.6;
}

.safety-rules {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.rule-item {
    display: flex;
    align-items: center;
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.rule-item:hover {
    background: rgba(255, 51, 102, 0.2);
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(255, 51, 102, 0.2);
}

.rule-number {
    font-size: 40px;
    font-weight: 900;
    color: var(--alert-color);
    margin-right: 30px;
    font-family: 'Orbitron', sans-serif;
}

.rule-content h3 {
    margin-bottom: 5px;
    color: #fff;
}

.rule-content p {
    color: #ccc;
    font-size: 15px;
}

.first-aid {
    margin-top: 50px;
    text-align: center;
    padding: 30px;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.5);
    border-radius: 10px;
}

.first-aid h3 {
    color: #ffcc00;
    margin-bottom: 15px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    background: #050810;
    border-top: 1px solid var(--glass-border);
}

/* Animations auf Scroll */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-container {
    animation: fadeIn 1s ease-out;
}

/* Mobile Navigation & Responsive Adjustments */
@media (max-width: 992px) {
    .glass-header {
        padding: 15px 30px;
    }

    .menu-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(10, 15, 28, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.5s ease;
        z-index: 1000;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    nav a {
        font-size: 20px;
    }

    /* Menu Toggle Animation */
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

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

    .section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .grid-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .lektionen-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .card-3d, .calc-card, .glass-panel {
        padding: 20px;
    }

    .resistor-body {
        width: 150px !important;
    }

    .footer-content {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 18px;
    }
    
    .btn-primary {
        padding: 12px 25px;
        font-size: 14px;
    }
}
