/* 1. VARIABLEN FÜR HELL/DUNKEL */
:root {
    /* Hell-Modus (Standard) */
    --bg-body: #f8fafc;
    --bg-header: rgb(255 255 255 / 50%);
    --bg-header-side: rgb(255 255 255 / 80%);
    --text-main: #1e293b;
    --text-dim: #64748b;
    --card-bg: #ffffff;
    --accent: #15803d;
    --accent-blue: #0369a1;
    --title-blue: #268dbb;
    --shadow: rgba(0, 0, 0, 0.05);
    --hero-grad: linear-gradient(120deg, #f1f5f9, #e2e8f0);
    --sm-color: #28869d;
}

body.dark-mode {
    /* Deine Dunkel-Werte */
    --accent: #22c55e; 
    --accent-blue: #38bdf8;
    --bg-body: #0f172a;
    --bg-header: rgb(2 6 23 / 50%);
    --bg-header-side: rgb(2 6 23 / 80%);
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --card-bg: #1e293b;
    --shadow: rgba(0, 0, 0, 0.4);
    --hero-grad: linear-gradient(120deg, #1e293b, #020617);
}
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    min-height: 100vh;
}
/* 2. BASIS STYLES */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    font-family:system-ui, sans-serif; 
    transition: background 0.4s, color 0.4s;
    overflow-x: hidden;
    min-height: 100vh;
}

header {
    position: fixed; /* Absolut fixiert am oberen Rand */
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 15px var(--shadow);
}

.logo { display: flex; align-items: center; gap: 12px; font-weight: bold; text-transform: uppercase; }
.logo img { height: 45px; }
#main-nav {
    backdrop-filter: none;
}
nav a {
    color: var(--text-main);
    margin:0 10px;
    text-decoration:none;
    font-weight:500;
}
nav a:hover { color: var(--accent-blue); }

.lang-switch a {
    text-decoration:none;
}
.lang-switch a:hover { color: var(--accent-blue); }

/* 3. HERO & GRID */
.hero {
    /*background: var(--hero-grad);*/
    position: relative;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2; /* Über das Canvas legen */
}

/* Button Styles */
.hero-buttons { margin-top: 30px; display: flex; gap: 15px; justify-content: center; }
.button.secondary {
    background: transparent;
    border: 2px solid var(--accent-blue);
    color: var(--text-main);
}

/* Aktive Menüpunkte */
nav a.active { color: var(--accent-blue); border-bottom: 2px solid var(--accent-blue); }
.active-lang { font-weight: bold; color: var(--accent) !important; }
.inactive-lang { color: var(--text-main);}
/* Header Tools Layout */
.nav-container { display: flex; align-items: center; gap: 20px; }
.header-tools { display: flex; align-items: center; gap: 15px; }

#burger-menu {
    display: none; /* Standardmäßig aus */
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
}

#burger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text-main);
    border-radius: 3px;
    position: absolute;
    transition: .3s ease-in-out;
}

#burger-menu span:nth-child(1) { top: 0; }
#burger-menu span:nth-child(2) { top: 8px; }
#burger-menu span:nth-child(3) { top: 16px; }

/* Burger Animation bei Aktivierung */
#burger-menu.open span:nth-child(1) { transform: rotate(45deg); top: 8px; }
#burger-menu.open span:nth-child(2) { opacity: 0; }
#burger-menu.open span:nth-child(3) { transform: rotate(-45deg); top: 8px; }

.container { 
    max-width: 1600px;
    margin: auto;
    padding: 40px 20px;
    text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: var(--card-bg);
    padding: 35px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow);
    transition: 0.4s;
    border: 1px solid rgba(255,255,255,0.05);
}
.card img {
  width:75px;
  border-radius:12px;
  margin-bottom:10px;
}
.card:hover {
  transform:translateY(-6px);
  box-shadow:0 0 25px rgba(56,189,248,.4);
  cursor: pointer;
}
/* SERVICE */

.service-preview {
    width: 100%; /* Sicherstellen, dass der Container Platz nimmt */
    display: block;
}
.service-card {
    position: relative;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

/* Der Screenshot als Background mit Opacity */
.service-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: inherit;
    background-size: cover;
    opacity: 0.4; /* Normalzustand */
    transition: opacity 0.4s ease;
}

.service-card:hover::before {
    opacity: 1; /* Volle Sichtbarkeit bei Hover */
}

.service-card:hover {
    transform: scale(1.03);
}

.service-info h3 { margin-bottom: 5px; color: var(--accent-blue); }
.service-info p { font-size: 0.9rem; margin-bottom: 15px; }

/* Alternierende Reihenfolge für services.php */
.service-row {
    padding-top: 115px;
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 100px;
}
.service-row.reverse { flex-direction: row-reverse; }

/* PROJECT */
.project-preview {
    width: 100%; /* Sicherstellen, dass der Container Platz nimmt */
    display: block;
}
.project-card {
    position: relative;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

/* Der Screenshot als Background mit Opacity */
.project-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: inherit;
    background-size: cover;
    opacity: 0.4; /* Normalzustand */
    transition: opacity 0.4s ease;
}

.project-card:hover::before {
    opacity: 1; /* Volle Sichtbarkeit bei Hover */
}

.project-card:hover {
    transform: scale(1.03);
}

.project-info h3 { margin-bottom: 5px;}
.project-info p { font-size: 0.9rem; margin-bottom: 15px; }

/* Alternierende Reihenfolge für projects.php */
.project-row {
    padding-top: 115px;
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 100px;
}
.project-row.reverse { flex-direction: row-reverse; }




/* 4. ANIMATIONEN */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.7s ease-out;
}

.from-left { transform: translateX(-100px); }
.from-right { transform: translateX(100px); }

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slider Container */
.service-slider {
    position: relative;
    width: 100%;
    min-height: 250px; /* Wichtig für Mobile! */
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    z-index: 5;
}

.project-slider {
    position: relative;
    width: 100%;
    min-height: 250px; /* Wichtig für Mobile! */
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-header);
    z-index: 5;
}


.slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide img {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* Navigation Buttons */
.slider-nav {
    position: absolute;
    top: 50%; width: 100%;
    display: flex; justify-content: space-between;
    transform: translateY(-50%);
    z-index: 10;
    padding: 0 15px;
    pointer-events: none;
}

.slider-btn {
    pointer-events: auto;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: 0.3s;
}

.slider-btn:hover { background: var(--sm-color); }

/* Punkte (Dots) */
.slider-dots {
    position: absolute;
    bottom: 15px; width: 100%;
    display: flex; justify-content: center;
    gap: 8px; z-index: 10;
}

.dot {
    width: 10px; height: 10px;
    background: var(--sm-color);
    border-radius: 50%;
    cursor: pointer;
}

.dot.active { background: var(--accent-blue); width: 25px; border-radius: 10px; }


#theme-toggle{
    background:none;
    border:none;
    cursor:pointer;
    font-size: 20px;
    vertical-align: super;
    padding-left: 10px;
    color: var(--text-main);
    opacity: 0.8;
}

#theme-icon {
    display: inline-block;
    color: var(--text-main); /* Nutzt immer die Haupttextfarbe der jeweiligen Mode */
    filter: drop-shadow(0 0 2px var(--shadow));
}

.contact-card {
    text-align: left;
    padding: 50px;
}
.start-icon svg {
    fill: var(--icon-color, var(--accent)); 
    transition: transform 0.3s ease;
    width: 75px;
    height: auto;
}
.service-icon svg {
    fill: var(--icon-color, var(--accent)); 
    transition: transform 0.3s ease;
    width: 150px;
    height: auto;
}
.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 15px;
    background: var(--bg-body);
    border: 1px solid var(--shadow);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    transition: 0.3s;
    margin-bottom: 20px;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.privacy-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.privacy-check a { color: var(--accent-blue); text-decoration: none; }

.button {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #2563eb 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
    text-align: center;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
    filter: brightness(1.1);
}

.button:active {
    transform: translateY(0);
}

/* Sekundärer Button (z.B. für "Details") */
.button.secondary {
    background: transparent;
    border: 2px solid var(--accent-blue);
    color: var(--accent-blue) !important;
    box-shadow: none;
}

.button.secondary:hover {
    background: var(--accent-blue);
    color: #ffffff !important;
}


#project-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 95%;
    height: 90%;
    background: var(--bg-body);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.modal-header {
    padding: 15px 25px;
    background: var(--bg-header);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--shadow);
}

.close-modal {
    font-size: 35px;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

/* Ersetze deine aktuellen modal-body & iframe Regeln mit diesen: */

.modal-body {
    flex: 1; /* Nimmt den restlichen Platz unter dem Header ein */
    width: 100%;
    position: relative;
    overflow: hidden; /* Verhindert, dass der iFrame nach außen drückt */
    background: #000;
}

.iframe-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto; /* Erlaubt Scrollen NUR innerhalb, falls das Spiel zu groß ist */
    -webkit-overflow-scrolling: touch; /* Sanftes Scrollen auf iPhone */
}

#project-iframe {
    border: none;
    display: block;
    width: 100%;
    height: 100%;
    /* Fix für iOS: Verhindert, dass der iFrame sich automatisch vergrößert */
    min-width: 100%;
}


body.modal-open {
    overflow: hidden !important; 
    height: 100vh;
}

footer {
    padding:40px;
    text-align:center;
    border-top:1px solid var(--shadow);
}
footer a {
    color: var(--text-main);
    text-decoration:none;
}
footer a:hover { color: var(--accent-blue); }


/* 5. RESPONSIVE */
@media (max-width: 1280px) {
    .grid {
        grid-template-columns: repeat(2, 1fr); /* 2x2 auf Tablets */
    }
}
/* RESPONSIVE NAV (Ab 1110px umschalten) */
@media (max-width: 1110px) {
    #burger-menu { display: block;}
    .header-tools { z-index: 1001; }
    #main-nav {
        position: fixed;
        top: 0;
        right: -100%; /* Versteckt rechts */
        width: 250px;
        height: 100vh;
        background: var(--bg-header-side);
        box-shadow: -5px 0 15px var(--shadow);
        display: flex;
        flex-direction: column;
        padding: 80px 20px;
        transition: 0.4s ease;
        backdrop-filter: blur(20px);
        visibility: hidden;
    }

    #main-nav.open { 
        right: 0; 
        visibility: visible;
    } /* Reinfahren */
    #main-nav a { margin: 15px 0; font-size: 1.2rem; }
}
@media (max-width: 768px) {
    header { 
        flex-direction: row; /* Bleibt nebeneinander */
        justify-content: space-between; 
    }
    .header-tools { 
        width: 100%; 
        display: flex;         /* Aktiviert Flexbox für die Tools-Leiste */
        justify-content: flex-end; /* Schiebt alle Kinder (Umschalter, Sprache, Burger) nach rechts */
        align-items: center;
        gap: 15px;             /* Abstand zwischen den Icons */
        padding: 0 10px;       /* Kleiner Abstand zum Rand */
    }
    .hero h1 { font-size: 28px; }
    .grid {
        grid-template-columns: 1fr; /* 1 Spalte auf Handy */
    }

    .service-row {
        display: flex;
        flex-direction: column !important; /* Text oben, Bild unten */
        gap: 30px;
        padding-top: 30px;
        margin-bottom: 30px;
    }

    .service-text, .service-preview {
        flex: none;
        width: 100%;
    }

    .service-slider {
        aspect-ratio: 4 / 3; /* Quadratischer auf Handys sieht oft besser aus */
        min-height: 200px;
    }

    .project-row {
        display: flex;
        flex-direction: column !important; /* Text oben, Bild unten */
        gap: 30px;
        padding-top: 30px;
        margin-bottom: 30px;
    }

    .project-text, .project-preview {
        flex: none;
        width: 100%;
    }

    .project-slider {
        aspect-ratio: 4 / 3; /* Quadratischer auf Handys sieht oft besser aus */
        min-height: 200px;
    }
    #project-iframe {
        /* Falls das Projekt eine feste Breite hat, wird es hier 
           innerhalb des .iframe-wrapper scrollbar gemacht */
        width: 100vw; 
    }

    /* Animationen auf Mobile etwas dezenter, falls das Handy langsam ist */
    .from-left, .from-right {
        transform: translateY(30px); /* Von unten statt von der Seite */
    }
}

@media (max-width: 600px) {
    .input-group { grid-template-columns: 1fr; gap: 0; }
    .contact-card { padding: 30px 20px; }
}
@media (max-width: 560px) {
    .logo span { display: none; } /* Nur Icon zeigen, wenn Platz zu knapp ist */
}
