:root {
    --main-bg: #f4edd9;
    --sidebar-color: #004080;
    --text-color: #333;
    --transition-speed: 0.4s;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    overflow-x: hidden;
    font-size: 17px;
}

#camoCanvas {display: block; position: absolute; left: 0; top: 0; z-index: -1; width: 100vw; height: 100vh;}

/* --- КОНТЕЙНЕР --- */
.wrapper {
    display: flex;
    min-height: 100vh;
    background-position: 0 0;
    background-size: cover;
    position: relative;
}

/* --- ОСНОВНИЙ КОНТЕНТ --- */
.main-content {
    flex: 1;
    padding: 20px 80px 20px 20px;
    color: var(--text-color);
    z-index: 1;
    position: relative;
    transition: padding-right var(--transition-speed) ease;
}

/* Стилізація меню контенту */
.top-menu ul { list-style: none; padding: 0; display: flex; gap: 20px; flex-wrap: wrap;}
.top-menu a { text-decoration: none; color: #333; font-weight: bold; text-transform: uppercase; }

.sidebar-bg {
    position: fixed;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background-color: var(--sidebar-color);
    mix-blend-mode: multiply; 
    z-index: 50;
    transition: width var(--transition-speed) ease;
    pointer-events: none; /* Пропускає кліки крізь себе, якщо потрібно */
}

.sidebar-ui {
    position: fixed;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    
    z-index: 100; 
    transition: width var(--transition-speed) ease;
    box-sizing: border-box;
    overflow: hidden;
    
    background: transparent; 
}

.sidebar-teroborona {
    display: none;
}

#footer-cat {margin: 20px 0; display: flex; justify-content: flex-end;}
#footer-cat img {display: block; width: 100%; max-width: 360px; height: auto;}

.logo {width: 70%; margin: 0 auto;}
.logo a {
    display: block; 
    height: auto; 
    background-image: url(https://i1.poltava.to/ai-moderator/poltava_to_square.svg);
    padding-bottom: 100%; 
    background-repeat: no-repeat; 
    background-position: center center; 
    width: 40px; 
    margin: 64px auto 32px auto; 
}

body.menu-open .logo a {
    width: 100%; 
    background-image: url(https://i1.poltava.to/ai-moderator/poltava_to.svg);
    padding-bottom: 19.23%; 
}


/* Елементи всередині UI */
.sidebar-menu {
    width: 70%;
    margin: 32px auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    white-space: nowrap;
    padding: 0;
    transition: opacity 0.3s;
    opacity: 0; 
}

.sidebar-menu a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 17px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 15px;
}
.sidebar-menu a:hover { color: #fff; }

/* ІКОНКИ СОЦМЕРЕЖ */

.social-icons {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    transition: opacity 0.3s;
    flex-direction: column;
}

.social-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    position: relative;
    left: 0;
    top: 0;
}

.social-icon > span {
    display: block; 
    width: 36px; 
    height: 36px; 
    background-color: rgba(255,255,255,0.3);
    background-size: cover;
    border-radius: 4px;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 4px;
}

.social-icon:hover > span {
    left: -4px; 
    top: -4px;
    height: 44px;
    width: 44px;
}

.icon-facebook {background-image: url(https://i1.poltava.to/img3/icons/facebook.svg);}
.icon-instagram {background-image: url(https://i1.poltava.to/img3/icons/instagram.svg);}
.icon-telegram {background-image: url(https://i1.poltava.to/img3/icons/telegram.svg);}
.icon-tiktok {background-image: url(https://i1.poltava.to/img3/icons/tiktok.svg);}

/* СЕНДВІЧ - ХРЕСТИК */
.toggle-btn {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    position: absolute;
    height: 40px;
    top: 10px;
    right: 10px;
    z-index: 101;
}

.toggle-btn span {
    display: block;
    width: 32px;
    height: 3px;
    background-color: #fff;
    transition: 0.3s;
}

/* СТАН: РОЗГОРНУТО (Клас .active на BODY) */
body.menu-open .sidebar-bg, 
body.menu-open .sidebar-ui {
    width: 300px;
}

body.menu-open .sidebar-menu {
    opacity: 1;
    pointer-events: auto;
}

body.menu-open .social-icons {
    flex-direction: row;
    width: 100%;
}

/* Анімація хрестика */
body.menu-open .toggle-btn span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
body.menu-open .toggle-btn span:nth-child(2) { opacity: 0; }
body.menu-open .toggle-btn span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }


@media (min-width: 640px) {

    .main-content {padding: 20px 88px 20px 28px;}

}

@media (min-width: 901px) {
    
    /* Задаємо ширину обом шарам */
    .sidebar-bg, 
    .sidebar-ui {
        width: 300px;
    }

    .logo a {
        width: 100%; 
        background-image: url(https://i1.poltava.to/ai-moderator/poltava_to.svg);
        padding-bottom: 19.23%; 
    }

    .main-content {
        padding-right: 328px; /* 300px панель + 28px відступ */
    }

    .sidebar-menu { margin-top: 0; opacity: 1; padding: 20px; }
    .toggle-btn { display: none; } /* Ховаємо кнопку на ПК */
    .social-icons { flex-direction: row; }
}

@media (min-width: 1200px) {

    .sidebar-teroborona {
        display: block;
        position: fixed;
        bottom: 3vh;
        right: 210px;
        width: 30vw;
        height: 90vh; 
        background-image: url(https://i1.poltava.to/ai-moderator/cat.png);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: right bottom;
        z-index: 101;
    }

    #footer-cat {display: none;}

    .main-content {
        padding-left: 64px;
        padding-right: calc(30vw + 220px);; /* 300px панель + 28px відступ */
    }

}
