/* style.css */

/* Bestehende globale Stile */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --dark: #111111;
    --light: #ffffff;
    --accent: #1a73e8;
    --text-dark: #333;
    --text-light: #fff;
    --sun: #ffd700;
    --sun-shadow: #987416;
    --moon: #dddddd;
    --moon-shadow: #808080;
    --star: #ffffff;
    --cloud: #ffffff;
    --crater: #535370;
    --shadow-01: #80808077;
    --shadow-02: #ffffff22;
    --shadow-03: #555555;
    --background-day: linear-gradient(skyblue, cadetblue);
    --background-night: linear-gradient(-45deg, #222, #000030);
}

/* Header Grundstile */
.site-header {
    background: var(--light);
    color: var(--text-dark);
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background 0.3s, color 0.3s;
}

body.darkmode .site-header {
    background: var(--dark);
    color: var(--text-light);
}

/* Container Flexbox innerhalb des Headers */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px; /* Optional: Maximale Breite des Headers */
    margin: 0 auto; /* Zentriert den Header horizontal */
    padding: 10px 20px; /* Innenabstand */
}

/* Linke Sektion: Logo und Navigation */
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Logo */
.site-logo a {
    font-size: 30px;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.4s;
}

body.darkmode .site-logo a {
    color: var(--light);
}

/* Navigation */
.site-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.site-nav li {
    position: relative;
}

.site-nav a {
    text-decoration: none;
    color: var(--text-dark);
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
}

.site-nav a:hover,
.site-nav a.active {
    background: var(--accent);
    color: var(--text-light);
}

body.darkmode .site-nav a {
    color: var(--text-light);
}

body.darkmode .site-nav a:hover,
body.darkmode .site-nav a.active {
    background: var(--light);
    color: var(--dark);
}

/* Rechte Sektion: Hamburger-Menü und Icons */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Hamburger-Menü */
.menu-toggle {
    display: none; /* Standardmäßig versteckt auf Desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100; /* Sicherstellen, dass es über anderen Elementen liegt */
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

body.darkmode .menu-toggle span {
    background: var(--text-light);
}

/* Hamburger-Menü geöffnet */
.menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* Header Icons */
.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Apple-artiger Toggle-Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.toggle-switch .toggle-input {
    display: none;
}

.toggle-switch .toggle-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 24px;
    background-color: #2196F3;
    border-radius: 34px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch .toggle-label::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background-color: #fff;
    box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.toggle-switch .toggle-input:checked + .toggle-label {
    background-color: #4CAF50;
}

.toggle-switch .toggle-input:checked + .toggle-label::before {
    transform: translateX(16px);
}

/* Light theme specific styles for toggle */
.toggle-switch.light .toggle-label {
    background-color: #BEBEBE;
}

.toggle-switch.light .toggle-input:checked + .toggle-label {
    background-color: #9B9B9B;
}

.toggle-switch.light .toggle-input:checked + .toggle-label::before {
    transform: translateX(6px);
}

/* Dark theme specific styles for toggle */
.toggle-switch.dark .toggle-label {
    background-color: #4B4B4B;
}

.toggle-switch.dark .toggle-input:checked + .toggle-label {
    background-color: #717171;
}

.toggle-switch.dark .toggle-input:checked + .toggle-label::before {
    transform: translateX(16px);
}

/* Symbole für Warenkorb und Login */
.icon-link {
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.3s;
}

.icon-link:hover {
    color: var(--accent);
}

body.darkmode .icon-link {
    color: var(--text-light);
}

body.darkmode .icon-link:hover {
    color: var(--accent);
}

/* Verkaufskorb nur auf Sell-Seiten sichtbar */
.euro-icon {
    display: none;
}

body.sell-page .cart-icon {
    display: none;
}

body.sell-page .euro-icon {
    display: inline-block;
}

/* Responsive Styles */
@media (max-width: 768px) {
    /* Container Flexrichtung ändern */
    .header-container {
        flex-direction: column;
        align-items: center;
    }

    /* Linke Sektion: Logo zentriert */
    .header-left {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    /* Rechte Sektion: Hamburger-Menü und Icons in einer Zeile */
    .header-right {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Hamburger-Menü sichtbar */
    .menu-toggle {
        display: flex;
    }

    /* Navigation verstecken und als Dropdown anzeigen */
    .site-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px; /* Angepasst für Header-Höhe */
        right: 20px; /* Rechts ausrichten */
        background: var(--light);
        padding: 15px;
        gap: 10px;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }

    .site-nav ul.open {
        display: flex;
    }

    body.darkmode .site-nav ul {
        background: var(--dark);
        box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
    }

    /* Header Icons anpassen */
    .header-icons {
        gap: 10px;
    }

    /* Symbole für Warenkorb und Login */
    .icon-link {
        margin: 5px 0;
        font-size: 20px;
    }
}

/* Modal-Overlay */
.modal {
    display: none; /* Standardmäßig ausgeblendet */
    position: fixed;
    z-index: 2000; /* Höher als Header (z-index: 1000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Bei Bedarf scrollen */
    background-color: rgba(0, 0, 0, 0.5); /* Schwarzer Hintergrund mit Transparenz */
}

/* Modal-Inhalt */
.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* Zentriert vertikal mit 10% Abstand vom oberen Rand */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px; /* Maximale Breite des Modals */
    border-radius: 10px;
    position: relative;
    transition: background 0.3s, color 0.3s;
}

body.darkmode .modal-content {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #555;
}

/* Schließen-Button */
.close-button {
    color: #aaa;
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
}

/* Formular-Stile */
#loginForm {
    display: flex;
    flex-direction: column;
}

#loginForm label {
    margin-top: 15px;
    font-weight: bold;
}

#loginForm input {
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s, border 0.3s;
}

body.darkmode #loginForm input {
    background-color: #555;
    color: #e0e0e0;
    border: 1px solid #777;
}

#loginForm button {
    margin-top: 20px;
    padding: 10px;
    background-color: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

#loginForm button:hover {
    background-color: #1669c1;
}

body.darkmode #loginForm button {
    background-color: #1a73e8;
    color: #fff;
}

body.darkmode #loginForm button:hover {
    background-color: #1669c1;
}

/* Registrierungslink-Stile */
.register-link {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    color: inherit;
}

.register-link a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.register-link a:hover {
    text-decoration: underline;
}

body.darkmode .register-link {
    color: #e0e0e0;
}

body.darkmode .register-link a {
    color: #ffd700; /* Akzentfarbe im Darkmode */
}

/* Minimalistisches Styling für die Icons */
.icon-link i {
    display: inline-block;
    vertical-align: middle;
    font-size: inherit; /* Erbt die Schriftgröße vom Elternelement (.icon-link) */
}
/* Sicherstellt gleichmäßige Abstände zwischen den Icons */
.header-icons .icon-link {
    margin-right: 10px; /* Passe den Wert nach Bedarf an */
}
@media (max-width: 768px) {
    /* ... bestehende mobile Styles ... */

    /* Erhöht den Abstand zwischen dem Toggle-Switch und den Icons */
    .header-icons .toggle-switch {
        margin-left: 10px; /* Passe den Wert nach Bedarf an */
    }

    /* Sicherstellt gleichmäßige Abstände zwischen den Icons */
    .header-icons .icon-link {
        margin-right: 10px; /* Passe den Wert nach Bedarf an */
    }

    /* Optional: Erhöht die Größe der Icons für bessere Sichtbarkeit */
    .header-icons .icon-link {
        font-size: 22px; /* Optional: Größere Icons */
    }
}
