/* ===================================
   CSS Variables & Reset
   =================================== */
:root {
    --color-bg: #25363e;
    --color-hex: #dcae56;
    --color-hex-hover: #e4bc6f;
    --color-hex-active: #c99d45;
    --color-text-dark: #25363e;
    --color-text-light: #ffffff;
    --color-icon: #fbe8bd;
    --color-footer: #dcae56;

    --hex-size: 180px;
    --hex-margin: 0px;
    --transition-speed: 0.4s;

    /* Breakpoints */
    --bp-mobile: 576px;
    --bp-tablet: 768px;
    --bp-desktop: 992px;
    --bp-xl: 1200px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-light);
    height: 100vh;
    overflow: hidden;
}

/* ===================================
   Main Container
   =================================== */
.main-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

/* ===================================
   Hexagon Grid Layout
   =================================== */
.hexagon-grid {
    display: flex;
    flex-wrap: wrap;
    width: 95vmin;
    height: 95vmin;
    position: relative;
    aspect-ratio: 1;
    transition: opacity var(--transition-speed) ease;
}

.hexagon-grid.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===================================
   Hexagon Shape
   =================================== */
.hexagon {
    width: 32.2%;
    height: 37.2%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: absolute;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    background: linear-gradient(145deg, var(--color-hex), #e6be6f);
    box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.3),
                inset -5px -5px 10px rgba(255, 255, 255, 0.3),
                5px 5px 10px rgba(0, 0, 0, 0.4);
}

/* Hexagon Positionen */
.hexagon:nth-child(1) {
    background: white;
    top: 32%;
    left: 32%;
}
.hexagon:nth-child(2) { top: 32%; left: 64%; }
.hexagon:nth-child(3) { top: 32%; left: 0; }
.hexagon:nth-child(4) { top: 59.8%; left: 16%; }
.hexagon:nth-child(5) { top: 59.8%; left: 48%; }
.hexagon:nth-child(6) { top: 4.2%; left: 16%; }
.hexagon:nth-child(7) { top: 4.2%; left: 48%; }

.hexagon-logo {
    cursor: default;
}

.hex-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    padding: 20px;
}

.hexagon:not(.hexagon-logo):not(.active):hover {
    background: linear-gradient(145deg, #e6be6f, var(--color-hex));
    filter: drop-shadow(8px 8px 15px rgba(0, 0, 0, 0.4));
    transform: scale(1.05);
}

.hexagon.active {
    width: calc(100vh * 0.866);
    height: 100vh;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    z-index: 10;
    overflow: visible;
}

.hexagon.active .hex-inner {
    padding: 28% 20% 22%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Spezielles Padding für Mini-Hex und Slider Content */
.hexagon.active.active-mini-hex .hex-inner,
.hexagon.active.active-slider .hex-inner {
    padding: 28% 9% 22% !important;
    align-items: flex-start !important;
}

.hexagon-grid.active .hexagon:not(.active) {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* ===================================
   Hexagon Content
   =================================== */
.hex-icon {
    width: 50%;
    height: auto;
    margin-bottom: 10px;
    color: var(--color-icon);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-icon img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.hex-icon svg {
    width: 100%;
    height: auto;
    display: block;
}

.hex-title {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Logo Hexagon */
.hexagon-logo .hex-inner {
    padding: 10px;
}

.hexagon-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hex-logo {
    text-align: center;
}

.logo-content {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo-content span {
    font-size: 14px;
    font-weight: 400;
    display: block;
    margin-top: 5px;
}

/* ===================================
   Expanded View
   =================================== */
.expanded-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
}

.expanded-view.active {
    opacity: 1;
    pointer-events: all;
}

.expanded-content {
    width: calc(100vh * 0.866);
    height: 100vh;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    background-color: var(--color-hex);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: relative;
    padding: 8% 12%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: expandHex var(--transition-speed) ease;
}

@keyframes expandHex {
    from {
        transform: scale(0.1);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Overlay Close Button - fixed, außerhalb clip-path, immer klickbar */
.overlay-close-btn {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(37, 54, 62, 0.25);
    border: 2px solid var(--color-text-dark);
    border-radius: 50%;
    font-size: 28px;
    color: var(--color-text-dark);
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.25s ease, background 0.2s ease;
    line-height: 1;
    padding: 0;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-close-btn:hover {
    transform: translateX(-50%) rotate(90deg);
    background: rgba(37, 54, 62, 0.45);
}

.content-area {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--color-text-dark);
    padding: 0;
}

/* Scrollbar Styling */
.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--color-text-dark);
    border-radius: 10px;
}

/* ===================================
   Content Templates
   =================================== */

/* Text Content */
.content-text {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    overflow-y: auto;
    max-height: 46vh;
    scrollbar-width: thin;
    scrollbar-color: var(--color-text-dark) transparent;
}

.content-text::-webkit-scrollbar {
    width: 5px;
}
.content-text::-webkit-scrollbar-track {
    background: transparent;
}
.content-text::-webkit-scrollbar-thumb {
    background: var(--color-text-dark);
    border-radius: 10px;
}

.content-text h2 {
    font-size: clamp(1.8rem, 5vh, 3rem);
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--color-text-dark);
}

.content-text hr {
    background-color: var(--color-text-dark);
    border: 0;
    padding: 0.15rem;
    margin: 1.5rem 25%;
}

.content-text p {
    font-size: clamp(1rem, 2.2vh, 1.3rem);
    line-height: 1.7;
    margin-bottom: 1.2rem;
    color: var(--color-text-dark);
    text-align: justify;
}

/* Mini Hexagons Content */
.content-mini-hex {
    display: flex;
    height: 100%;
    width: 100%;
    max-width: 800px;
    margin: 0;
    gap: 25px;
    align-items: flex-start;
    padding-top: 0;
}

.mini-hex-sidebar {
    width: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    padding-top: 0;
    margin-top: 0;
}

/* Scrollbar für Mini-Hex Sidebar */
.mini-hex-sidebar::-webkit-scrollbar {
    width: 4px;
}

.mini-hex-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.mini-hex-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-text-dark);
    border-radius: 10px;
}

.mini-hex {
    width: 70px;
    height: calc(70px * 1.1547);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.mini-hex:hover {
    transform: scale(1.08);
}

.mini-hex.active {
    transform: scale(1.12);
}

.mini-hex-inner {
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.5);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.mini-hex.active .mini-hex-inner {
    background-color: var(--color-text-dark);
}

/* Inaktive Icons: Weiß-Ton für sichtbaren Kontrast auf halbdunklem Hintergrund */
.mini-hex-icon {
    width: 40%;
    color: rgba(255, 255, 255, 0.85);
}

/* Aktive Icons: Gold für Kontrast auf dunklem Hintergrund */
.mini-hex.active .mini-hex-icon {
    color: var(--color-hex);
}

.mini-hex-icon svg {
    width: 100%;
    height: auto;
}

.mini-hex-content {
    flex: 1;
    padding-left: 25px;
    padding-right: 12px;
    padding-top: 0;
    border-left: 2px solid var(--color-text-dark);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 40vh;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Scrollbar für Mini-Hex Content */
.mini-hex-content::-webkit-scrollbar {
    width: 6px;
}

.mini-hex-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.mini-hex-content::-webkit-scrollbar-thumb {
    background: var(--color-text-dark);
    border-radius: 10px;
}

.mini-hex-content h2 {
    font-size: clamp(1.1rem, 2.8vh, 1.8rem);
    margin-bottom: 0.8rem;
    color: var(--color-text-dark);
}

.mini-hex-content p {
    font-size: clamp(0.85rem, 1.8vh, 1rem);
    line-height: 1.5;
    color: var(--color-text-dark);
    text-align: left;
}

/* Slider Content */
.content-slider {
    display: flex;
    height: 100%;
    width: 100%;
    max-width: 800px;
    margin: 0;
}

.slider-container {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 25px;
    width: 100%;
}

.slider-sidebar {
    width: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.slider-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
}

.slider-title {
    font-size: clamp(1.3rem, 3vh, 1.8rem);
    margin-bottom: 0;
    text-align: left;
    color: var(--color-text-dark);
}

.slider-img-wrap {
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
}

.slider-image {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    border-radius: 10px;
    transition: opacity 0.22s ease, transform 0.22s ease;
    display: block;
}

.slider-desc {
    font-size: clamp(0.85rem, 1.8vh, 1rem);
    color: var(--color-text-dark);
    margin-top: 8px;
    font-style: italic;
}

/* Thumbnail Mini-Hex für Slider (Bild als Hintergrund) */
.mini-hex-inner.mini-hex-img {
    background-color: transparent;
}

/* Contact Form */
.content-contact {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    overflow-y: auto;
    max-height: 46vh;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-text-dark) transparent;
}

.content-contact::-webkit-scrollbar {
    width: 5px;
}
.content-contact::-webkit-scrollbar-track {
    background: transparent;
}
.content-contact::-webkit-scrollbar-thumb {
    background: var(--color-text-dark);
    border-radius: 10px;
}

.content-contact h2 {
    font-size: clamp(1.2rem, 3.2vh, 1.8rem);
    margin-bottom: 1rem;
    text-align: center;
    color: var(--color-text-dark);
}

.content-contact form {
    width: 100%;
}

/* 2-Spalten-Layout für Name + E-Mail */
.contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 9px 11px;
    border: 2px solid var(--color-text-dark);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text-dark);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a252f;
    background-color: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 85px;
}

/* Button-Zeile */
.contact-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.btn-submit {
    background-color: var(--color-text-dark);
    color: var(--color-hex);
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex-shrink: 0;
}

.btn-submit:hover {
    background-color: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #25D366;
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-whatsapp:hover {
    background-color: #20BA5A;
    transform: translateY(-2px);
}

/* ===================================
   Mobile Navigation
   =================================== */
.mobile-nav {
    display: none;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    background: var(--color-hex);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.hamburger-btn span {
    width: 24px;
    height: 3px;
    background-color: var(--color-text-dark);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 40px;
    color: var(--color-text-dark);
    cursor: pointer;
    z-index: 10;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-hex);
    z-index: 10005; /* Über allem: aktivem Hex (9999), Mobile-Nav (10001) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

/* Schließen-Button innerhalb des mobilen Menüs */
.mobile-menu-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    font-size: 36px;
    color: var(--color-text-dark);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.mobile-menu-close:hover {
    background: rgba(37, 54, 62, 0.12);
}

.mobile-menu-item {
    font-size: 24px;
    color: var(--color-text-dark);
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
}

.mobile-menu-item:hover {
    background-color: rgba(44, 62, 80, 0.1);
}

/* ===================================
   Footer
   =================================== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    color: var(--color-footer);
    padding: 15px 20px;
    text-align: center;
    font-size: 13px;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Footer mit Hintergrund wenn Hexagon aktiv ist */
.hexagon-grid.active ~ .footer {
    background-color: rgba(37, 54, 62, 0.85);
    backdrop-filter: blur(5px);
}

.footer p {
    margin-bottom: 3px;
    font-size: 12px;
}

.footer-links {
    font-size: 13px;
}

.footer-links a {
    color: var(--color-footer);
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-hex-hover);
}

/* ===================================
   Responsive Design
   =================================== */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 575px) {
    :root {
        --hex-size: 80px;
        --hex-margin: 5px;
    }

    /* Mobile-Nav bleibt standardmäßig display:none – wird nur per CSS gezeigt wenn Hexagon aktiv */

    .hexagon-grid {
        padding-top: 0;
    }

    /* Mobile: Aktives Hexagon wird Fullscreen ohne Hexagon-Form */
    .hexagon.active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        clip-path: none !important;
        background-color: var(--color-hex) !important;
        z-index: 9999 !important;
        transform: none !important;
    }

    .hexagon.active .hex-inner {
        width: 100% !important;
        height: 100% !important;
        padding: 70px 20px 80px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        clip-path: none !important;
        background-color: var(--color-hex) !important;
        display: block !important;
        align-items: unset !important;
    }

    /* Overlay-Close-Button auf Mobile ausblenden – die Mobile-Nav übernimmt das Schließen */
    .overlay-close-btn {
        display: none !important;
    }

    /* Hamburger: normaler Flex-Child der Mobile-Nav (kein fixed, nur sichtbar wenn Nav aktiv) */
    .hamburger-btn {
        position: static !important;
        display: flex !important;
        background-color: transparent !important;
        border: none !important;
        width: 36px !important;
        height: 36px !important;
        border-radius: 6px !important;
        z-index: auto !important;
        top: auto !important;
        left: auto !important;
        cursor: pointer;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        padding: 6px;
    }

    .hamburger-btn span {
        display: block;
        width: 22px;
        height: 2px;
        background-color: var(--color-hex);
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    /* X-Schließen-Button: sichtbar (Gold auf dunklem Nav-Hintergrund) */
    .mobile-close {
        position: static !important;
        color: var(--color-hex) !important;
        font-size: 32px !important;
        top: auto !important;
        right: auto !important;
        z-index: auto !important;
        padding: 0 4px;
        line-height: 1;
        background: none;
        border: none;
        cursor: pointer;
    }

    /* Mobile Menüband oben (immer sichtbar wenn Content offen) */
    .hexagon-grid.active ~ .mobile-nav {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 60px !important;
        background-color: var(--color-text-dark) !important;
        z-index: 10001 !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 15px !important;
    }

    .content-mini-hex {
        flex-direction: column;
    }

    .mini-hex-sidebar {
        width: 100%;
        flex-direction: row;
        padding-right: 0;
        padding-bottom: 20px;
        overflow-x: auto;
    }

    .mini-hex-content {
        padding-left: 0;
        padding-top: 20px;
        border-left: none;
        border-top: 2px solid var(--color-text-dark);
    }

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

    .slider-sidebar {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
    }

    /* Content Text Styling für Mobile */
    .content-text {
        color: var(--color-text-dark);
    }

    .content-text h2 {
        color: var(--color-text-dark);
    }

    /*
     * FIX: Desktop-Regel .hexagon.active.active-mini-hex .hex-inner (Spezifität 0,3,1)
     * überschreibt die Mobile-Regel (0,2,1) trotz !important.
     * Gleiche Spezifität hier → später im Dokument → Mobile-Werte gewinnen.
     */
    .hexagon.active.active-mini-hex .hex-inner,
    .hexagon.active.active-slider .hex-inner {
        padding: 70px 20px 80px !important;
        align-items: unset !important;
    }

    /* Kein scale-Transform auf Mobile – würde die Hex-Kanten außerhalb des
       overflow:hidden Containers schieben und dort abgeschnitten werden. */
    .mini-hex.active {
        transform: none !important;
    }

    /* Mini-Hex Sidebar auf Mobile: Padding für sauberen Abstand oben */
    .mini-hex-sidebar {
        padding-top: 4px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    :root {
        --hex-size: 100px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    :root {
        --hex-size: 120px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 992px) {
    :root {
        --hex-size: 140px;
    }
}

@media (min-width: 1200px) {
    :root {
        --hex-size: 160px;
    }
}

/* ===================================
   Utility Classes
   =================================== */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
