/* ========================================================== */
/* ALAN DESIGN - LAB 2 (THE HIVE / ÚLIK)                      */
/* ========================================================== */
:root {
    --bg-page: #f4f6fa;
    --hex-b: linear-gradient(145deg, #ffffff, #cbd5e1);
    --hex-i: linear-gradient(145deg, #e2e8f0, #ffffff);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --cyan-accent: #0284c7;
    --cyan-glow: rgba(2, 132, 199, 0.32);
    --cyan-neon-hover: #00aaff;
    --alan-blue: #00e5ff;
    --alan-pink: #ff00c8;
    --flat-hex: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);

    /* Geometria úlika (presný pomer 1 : 0.866) */
    --cell-w: 224px;
    --cell-h: 194px;
    --cell-gap: 8px;
}

body.dark-theme {
    --bg-page: #010409;
    --hex-b: linear-gradient(145deg, #00f0ff, #0284c7);
    --hex-i: linear-gradient(145deg, #050b14, #0b1329);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --cyan-accent: #00f0ff;
    --cyan-glow: rgba(0, 240, 255, 0.45);
    --cyan-neon-hover: #00f0ff;
}

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

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.6s ease;
}

#cyberCanvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
}

/* ========================================================== */
/* HLAVIČKA & NAVIGÁCIA (ZACHOVANÁ Z LAB 1)                   */
/* ========================================================== */
.main-header {
    position: fixed; top: 20px; left: 20px; width: auto; height: 100vh;
    display: flex; flex-direction: column; justify-content: flex-start;
    align-items: center; gap: 22px; z-index: 100; pointer-events: none;
}
.main-header > * { pointer-events: auto; }
.hamburger { display: none; font-size: 32px; color: var(--cyan-accent); cursor: pointer; text-shadow: 0 0 10px var(--cyan-accent); }
.nav-links { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 30px; }

.nav-hex.hex-logo { width: 210px; height: 182px; perspective: 1200px; }
.nav-hex.hex-logo .hex-inner {
    position: relative; padding: 0 !important; background: transparent !important;
    box-shadow: none !important; clip-path: none !important;
    transform-style: preserve-3d; transition: transform 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.nav-hex.hex-logo.is-flipped .hex-inner { transform: rotateY(180deg); }

.flip-card-front, .flip-card-back {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    clip-path: var(--flat-hex); overflow: hidden;
}
.flip-card-front { background: #f0f2f5; transform: rotateY(0deg) scale(1.02); z-index: 2; }
.flip-card-back { background: #ffffff; transform: rotateY(180deg) scale(1.02); z-index: 1; }
.nav-hex.hex-logo.is-flipped .flip-card-front { opacity: 0; transition: opacity 0.1s 0.3s; }
.nav-hex.hex-logo:not(.is-flipped) .flip-card-front { opacity: 1; transition: opacity 0.1s 0.3s; }

.nav-hex.hex-logo .hex-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain !important; transform: scale(0.82); clip-path: none !important;
    transition: opacity 0.3s ease;
}
.logo-dark, .logo-dark-back { opacity: 0; pointer-events: none; }
.logo-light, .logo-light-back { opacity: 1; }
.logo-light { mix-blend-mode: multiply; }
body.dark-theme .logo-light, body.dark-theme .logo-light-back { opacity: 0 !important; visibility: hidden !important; }
body.dark-theme .logo-dark, body.dark-theme .logo-dark-back { opacity: 1 !important; visibility: visible !important; z-index: 10; }
body.dark-theme .flip-card-front, body.dark-theme .flip-card-back { background: #010409 !important; }
body.dark-theme .nav-hex.hex-logo .hex-border { background: linear-gradient(145deg, var(--cyan-accent), var(--alan-blue)) !important; }

.nav-hex {
    width: 96px; height: 83px; clip-path: var(--flat-hex); background: var(--hex-b);
    display: flex; justify-content: center; align-items: center; text-decoration: none;
    color: var(--text-main); filter: drop-shadow(0 4px 12px var(--cyan-glow)); transition: 0.3s;
}
.nav-hex:hover { filter: drop-shadow(0 0 18px var(--cyan-neon-hover)); }
.nav-hex:hover .hex-border { background: var(--cyan-neon-hover); }
.nav-hex .hex-border { width: 100%; height: 100%; clip-path: var(--flat-hex); background: var(--hex-i); padding: 2px; transition: 0.3s; }
.nav-hex .hex-inner {
    width: 100%; height: 100%; clip-path: var(--flat-hex);
    background: linear-gradient(145deg, #ffffff, #e0e5ec) !important;
    display: flex; justify-content: center; align-items: center;
    font-family: 'Orbitron', sans-serif; font-size: 9.5px; font-weight: 700;
}
body.dark-theme .nav-hex .hex-inner { background: linear-gradient(145deg, #081120, #02050a) !important; }

.lang-hex { width: 44px; height: 38px; clip-path: var(--flat-hex); background: var(--hex-b); display: flex; justify-content: center; align-items: center; transition: 0.3s; }
.lang-hex .hex-border { width: 100%; height: 100%; clip-path: var(--flat-hex); padding: 1px; }
.lang-hex .hex-inner { width: 100%; height: 100%; clip-path: var(--flat-hex); padding: 0; }
.lang-hex img { width: 100%; height: 100%; object-fit: cover; clip-path: var(--flat-hex); opacity: 0.65; transition: 0.3s; }
.lang-hex.active img, .lang-hex:hover img { opacity: 1; }
.lang-hex.active .hex-border { background: var(--cyan-accent); }

.sys-toggle-hex { cursor: pointer; }
.sys-toggle-hex .hex-inner { flex-direction: column; gap: 4px; }
.env-text { color: var(--cyan-accent); font-size: 8.5px; letter-spacing: 1px; }
.toggle-track { width: 32px; height: 16px; background: rgba(150,150,150,0.2); border-radius: 8px; position: relative; border: 1px solid var(--cyan-accent); }
.toggle-thumb { width: 10px; height: 10px; background: var(--cyan-accent); border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: left 0.4s; }
.sys-toggle-hex.active .toggle-thumb { left: 18px; }

/* ========================================================== */
/* ZÁKLAD HEXAGÓNU                                            */
/* ========================================================== */
.hex-border {
    width: 100%; height: 100%; clip-path: var(--flat-hex);
    background: var(--hex-i); padding: 3px; transition: 0.3s;
}
.hex-inner {
    width: 100%; height: 100%; clip-path: var(--flat-hex);
    background: linear-gradient(145deg, #ffffff, #c8d4e3) !important;
    box-shadow: inset 3px 3px 10px rgba(255,255,255,0.95), inset -3px -3px 12px rgba(0,0,0,0.12) !important;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 14px 26px; transition: 0.35s ease;
}
body.dark-theme .hex-inner {
    background: linear-gradient(145deg, #071226, #02050c) !important;
    box-shadow: inset 2px 2px 10px rgba(0, 240, 255, 0.08), inset -3px -3px 12px rgba(0,0,0,0.9) !important;
}

.video-inner, .image-inner { padding: 0 !important; position: relative; }
.hex-video, .hex-img { width: 100%; height: 100%; object-fit: cover; clip-path: var(--flat-hex); filter: brightness(1.08); transition: transform 0.35s ease; }

.cam-overlay {
    position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.85); color: var(--cyan-accent);
    font-family: 'Orbitron', sans-serif; font-size: 9.5px; letter-spacing: 1px;
    padding: 4px 10px; border: 1px solid var(--cyan-accent); border-radius: 2px;
    white-space: nowrap; text-shadow: 0 0 6px var(--cyan-accent);
}
.core-overlay { font-size: 14px; bottom: 12%; padding: 7px 18px; border-width: 2px; }

/* ========================================================== */
/* HLAVNÝ ÚLIK (THE HIVE MOTHERSHIP)                          */
/* ========================================================== */
.hive-mothership {
    max-width: 1220px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    position: relative;
    z-index: 10;
}

/* 1. JADRO ÚLIKA - KOMPAKTNÝ ZAKLIESNENÝ KOKPIT (10px ŠTRBINY) */
.hive-core-cluster {
    position: relative;
    width: 100%;
    max-width: 1060px;
    height: 510px;
    margin: 0 auto 10px;
}

.hex-node {
    position: absolute;
    clip-path: var(--flat-hex);
    background: var(--hex-b);
    filter: drop-shadow(0 8px 20px var(--cyan-glow));
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease, filter 0.3s ease;
}

.hex-node:hover {
    filter: drop-shadow(0 0 28px var(--cyan-neon-hover));
    transform: translate(-50%, -50%) scale(1.03);
    z-index: 25;
}

.hex-node:hover .hex-border { background: var(--cyan-neon-hover); }
.hex-node:hover .hex-video { transform: scale(1.06); }

/* Stredové jadro (480 × 416 px) */
.node-center-core {
    width: 480px;
    height: 416px;
    top: 50%;
    left: 50%;
    z-index: 10;
}
.core-border { background: linear-gradient(145deg, var(--cyan-accent), var(--alan-pink)); }

/* 4 zväčšené satelity (280 × 242 px) zakliesnené presne po bokoch jadra */
.node-top-left  { width: 280px; height: 242px; top: calc(50% - 126px); left: calc(50% - 319px); z-index: 8; }
.node-top-right { width: 280px; height: 242px; top: calc(50% - 126px); left: calc(50% + 319px); z-index: 8; }
.node-mid-left  { width: 280px; height: 242px; top: calc(50% + 126px); left: calc(50% - 319px); z-index: 9; }
.node-mid-right { width: 280px; height: 242px; top: calc(50% + 126px); left: calc(50% + 319px); z-index: 9; }


/* ========================================================== */
/* 2. SÚVISLÝ PLÁST (INTERLOCKING HONEYCOMB)                  */
/* ========================================================== */
.hive-matrix {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 90px;
}

.hive-sector-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto 26px;
    padding: 7px 24px;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--cyan-accent);
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid var(--cyan-accent);
    clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
    text-shadow: 0 0 10px var(--cyan-glow);
}

.hive-sector-spaced {
    margin-top: 120px;
}

/* Riadok plástu: každý párny hexagón je posunutý dole o 50% výšky a zasunutý doľava */
.hive-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: var(--cell-gap);
}

.hive-cell {
    width: var(--cell-w);
    height: var(--cell-h);
    flex: 0 0 var(--cell-w);
    clip-path: var(--flat-hex);
    background: var(--hex-b);
    filter: drop-shadow(0 6px 16px var(--cyan-glow));
    text-decoration: none;
    color: var(--text-main);
    cursor: pointer;
    position: relative;
    transition: transform 0.28s ease, filter 0.28s ease;
    /* Zasunutie do šikmého okraja predchádzajúceho hexagónu */
    margin-left: calc(var(--cell-w) * -0.22);
}

.hive-cell:first-child {
    margin-left: 0;
}

/* Každý párny hexagón v riadku sa posunie o polovicu výšky nadol -> pravý včelí plást */
.hive-cell:nth-child(even) {
    transform: translateY(calc(var(--cell-h) / 2 + var(--cell-gap) / 2));
}

.hive-cell:hover {
    filter: drop-shadow(0 0 26px var(--cyan-neon-hover));
    z-index: 25;
}
.hive-cell:hover .hex-border { background: var(--cyan-neon-hover); }
.hive-cell:hover .hex-video,
.hive-cell:hover .hex-img { transform: scale(1.06); }

/* Ikony a texty v bunkách */
.icon { font-size: 26px; margin-bottom: 8px; }
.icon.cyan { color: var(--alan-blue); filter: drop-shadow(0 0 8px var(--alan-blue)); }
.icon.pink { color: var(--alan-pink); filter: drop-shadow(0 0 8px var(--alan-pink)); }

.hive-cell h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
.hive-cell p {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.25;
}
.contact-val {
    color: var(--cyan-accent) !important;
    font-weight: 700 !important;
    font-size: 13px !important;
}

.hive-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -60px;
}

.hive-row-contact {
    margin-bottom: 110px;
}

.copyright-bar {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

/* ========================================================== */
/* KONTAKTNÝ FORMULÁR                                         */
/* ========================================================== */
.signal-form-wrapper {
    width: 100%;
    max-width: 720px;
    margin: 20px auto 20px;
    padding: 32px;
    background: var(--hex-i);
    border: 1px solid var(--cyan-accent);
    box-shadow: 0 0 30px var(--cyan-glow);
    border-radius: 12px;
    position: relative;
    z-index: 20;
}
.signal-form-box h3 {
    font-family: 'Orbitron', sans-serif; color: var(--cyan-accent);
    text-align: center; margin-bottom: 22px; letter-spacing: 2px; font-size: 17px;
}
.signal-form-box .form-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; }
.signal-form-box label { font-family: 'Orbitron', sans-serif; font-size: 11px; color: var(--text-main); letter-spacing: 1px; }
.signal-form-box input[type="text"],
.signal-form-box input[type="email"],
.signal-form-box textarea {
    width: 100%; padding: 12px 15px; background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--cyan-accent); color: var(--text-main);
    font-family: 'Rajdhani', sans-serif; font-size: 16px; border-radius: 6px; outline: none;
}
.checkbox-group { display: flex; gap: 22px; flex-wrap: wrap; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 600; }
.slider-btn {
    background: transparent; border: 1px solid var(--cyan-accent); color: var(--cyan-accent);
    cursor: pointer; transition: 0.3s; box-shadow: 0 0 10px var(--cyan-glow);
}
.slider-btn:hover { background: var(--cyan-accent); color: var(--bg-page); }

/* ========================================================== */
/* INTERAKTÍVNY HEXAGÓNOVÝ HUD PANEL (DOLE)                   */
/* ========================================================== */
.info-hex.is-active {
    filter: drop-shadow(0 0 28px var(--alan-pink)) !important;
    z-index: 35 !important;
}
.info-hex.is-active .hex-border {
    background: linear-gradient(145deg, var(--alan-blue), var(--alan-pink)) !important;
}

.hex-hud-panel {
    position: absolute;
    width: 440px;
    max-width: calc(100vw - 32px);
    z-index: 999;
    padding: 3px;
    background: linear-gradient(135deg, var(--cyan-accent), var(--alan-pink));
    clip-path: polygon(12% 0%, 88% 0%, 100% 50%, 88% 100%, 12% 100%, 0% 50%);
    filter: drop-shadow(0 15px 35px var(--cyan-glow));
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.hex-hud-panel.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.hex-hud-inner {
    background: linear-gradient(145deg, #ffffff, #e2eaf4);
    clip-path: polygon(12% 0%, 88% 0%, 100% 50%, 88% 100%, 12% 100%, 0% 50%);
    padding: 32px 62px 30px;
    color: var(--text-main);
    text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 220px; position: relative;
}
body.dark-theme .hex-hud-inner { background: linear-gradient(145deg, #071226, #02050c); }

.hex-hud-close {
    position: absolute; top: 12px; right: 54px;
    background: transparent; border: 1px solid var(--cyan-accent); color: var(--cyan-accent);
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 12px; transition: 0.2s;
}
.hex-hud-close:hover { background: var(--cyan-accent); color: var(--bg-page); }

.hex-hud-title {
    font-family: 'Orbitron', sans-serif; font-size: 13px; font-weight: 700;
    color: var(--cyan-accent); letter-spacing: 1px; text-transform: uppercase;
    margin: 6px 0 10px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(2, 132, 199, 0.25); width: 100%;
}
.hex-hud-text {
    font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 600;
    line-height: 1.48; color: var(--text-main); margin: 0;
}
.hex-hud-link {
    margin-top: 14px; display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 16px; font-family: 'Orbitron', sans-serif; font-size: 11px;
    font-weight: 700; letter-spacing: 1px; color: #ffffff;
    background: linear-gradient(135deg, var(--cyan-accent), var(--alan-pink));
    text-decoration: none; border-radius: 4px; transition: 0.2s;
}
.hex-hud-link:hover { transform: translateY(-2px); box-shadow: 0 0 14px var(--cyan-accent); }

/* ========================================================== */
/* RESPONZIVITA (DESKTOP / TABLET / MOBIL)                    */
/* ========================================================== */
@media (min-width: 1201px) {
    .main-header { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
    .main-header::-webkit-scrollbar { display: none; }
    body { padding-left: 230px; }
}

@media (max-width: 1200px) {
    :root {
        --cell-w: 190px;
        --cell-h: 165px;
    }
    .main-header {
        flex-direction: row; width: 100%; height: auto; left: 0; padding: 0 30px;
        justify-content: space-between;
    }
    .nav-hex.hex-logo { width: 125px; height: 108px; }
    body { padding-left: 0; padding-top: 120px; }
    .hamburger { display: block; }
    .nav-links {
        position: absolute; top: 75px; right: 30px; flex-direction: column; align-items: flex-end;
        background: rgba(3, 7, 18, 0.95); padding: 22px; border: 1px solid var(--cyan-accent);
        border-radius: 15px; opacity: 0; pointer-events: none; transition: 0.3s;
        max-height: calc(100vh - 100px); overflow-y: auto;
    }
    .nav-links.show { opacity: 1; pointer-events: auto; }

    .hive-core-cluster {
        display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; height: auto;
    }
    .hex-node { position: relative !important; top: auto !important; left: auto !important; right: auto !important; transform: none !important; }
    .node-center-core { order: -1; width: 90vw; height: calc(90vw * 0.866); max-width: 500px; max-height: 433px; }
}

@media (max-width: 900px) {
    /* Na menších obrazovkách sa plást pekne rozbalí do čistej mriežky bez prekrývania */
    .hive-row {
        flex-wrap: wrap;
        gap: 14px;
        margin-bottom: 14px;
    }
    .hive-cell {
        margin-left: 0 !important;
        transform: none !important;
    }
    .hive-sector-spaced { margin-top: 40px; }
    .hive-footer { margin-top: 0; }
    .hive-row-contact { margin-bottom: 30px; }
}

@media (max-width: 768px) {
    .hex-hud-panel {
        position: fixed !important; left: 14px !important; right: 14px !important;
        bottom: 16px !important; top: auto !important; width: auto !important; max-width: none !important;
        clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
    }
    .hex-hud-inner {
        clip-path: polygon(17px 0, 100% 0, 100% calc(100% - 17px), calc(100% - 17px) 100%, 0 100%, 0 17px);
        padding: 24px 22px 22px; min-height: auto;
    }
    .hex-hud-close { top: 12px; right: 14px; }
}

/* ========================================================== */
/* HEXAGÓNOVÝ DOK (RÁM) POD SMARTSUPP BUBLINOU                */
/* ========================================================== */
.hex-chat-btn {
    position: fixed;
    right: -6px;
    bottom: -2px;
    width: 144px;
    height: 125px;
    z-index: 950;
    background: var(--hex-b);
    border: none;
    padding: 0;
    clip-path: var(--flat-hex);
    filter: drop-shadow(0 6px 20px var(--cyan-glow));
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.hex-chat-btn:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 0 24px var(--cyan-neon-hover));
}

/* Čistý modro-cyan rám bez ružovej */
.hex-chat-btn .core-border {
    background: linear-gradient(145deg, var(--cyan-accent), var(--alan-blue));
}

.hex-chat-btn .hex-inner {
    padding: 10px;
    position: relative;
}

/* Skryjeme pôvodnú ikonku a text vnútri, aby neprekážali za modrou bublinou */
.hex-chat-btn i,
.hex-chat-btn span:not(.chat-online-dot) {
    display: none;
}

/* Pulzujúca zelená online bodka hore v strede hexagónu */
.chat-online-dot {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 8px #00ff88;
    animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.4; transform: translateX(-50%) scale(0.8); }
}

@media (max-width: 768px) {
    .hex-chat-btn {
        right: -4px;
        bottom: -2px;
        width: 132px;
        height: 114px;
    }
}