/* ============================================================
   ХЕДЕР І САЙДБАР — спільні стилі всього сайту.
   ------------------------------------------------------------
   Раніше цей блок (35 КБ) жив інлайном у views/templates/header.php,
   а його підключають 118 вʼюх. Тобто 35 КБ їхали заново з КОЖНОЮ
   сторінкою і не кешувались браузером ніколи.
   Винесено у файл: завантажується один раз, далі береться з кешу.
============================================================ */
/* =========================
   HEADER & SIDEBAR - ULTRA MODERN DESIGN
   Glassmorphism + Gradient Animations
   FIXED: Menu button always visible
   ========================= */

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

/* ===== MAIN HEADER ===== */
header {
    min-width: 100%;
    min-height: 160px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(232, 249, 240, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 4px 24px rgba(14, 165, 233, 0.08);
    position: relative;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header_element {
    display: inline-block;
}

#href_logo {
    text-decoration: none;
}

/* ===== LOGO ===== */
#logo {
    padding-bottom: 4px;
    max-width: 30%;
    padding-top: 4px;
    padding-left: 5%;
    transition: transform 0.3s ease;
}

#logo:hover {
    transform: translateY(-2px);
}

#logo_img {
    width: 120px;
    padding-top: 20px;
    filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.2));
    transition: filter 0.3s ease;
}

/* ===== ЄДИНИЙ ПЕРЕМИКАЧ ТЕМИ (тільки в хедері) ===== */
/* ховаємо будь-які старі per-page тумблери — лишається лише хедерний */
.dark-mode-toggle { display: none !important; }

#hdrThemeBtn {
    position: fixed;
    top: 22px;
    right: 78px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(16, 185, 129, 0.25);
    background: rgba(255, 255, 255, 0.9);
    color: #0f766e;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
#hdrThemeBtn:hover { transform: scale(1.08); }
#hdrThemeBtn svg { width: 20px; height: 20px; }
body.dark-mode #hdrThemeBtn {
    background: rgba(30, 41, 59, 0.92);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}
@media (max-width: 768px) {
    #hdrThemeBtn { top: 15px; right: 72px; width: 42px; height: 42px; }
}
@media (max-width: 600px) {
    #hdrThemeBtn { top: 12px; right: 64px; width: 40px; height: 40px; }
}

#logo:hover #logo_img {
    filter: drop-shadow(0 6px 12px rgba(16, 185, 129, 0.3));
}

#logo span {
    font-family: 'Poppins', 'Kanit', sans-serif;
    font-size: 17.6px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

#med {
    color: #eb2138;
    background: linear-gradient(135deg, #eb2138 0%, #d81b33 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#online {
    color: #10b981;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== MENU PART ===== */
#menu_part {
    position: relative;
}

/* ===== MENU BUTTON - ALWAYS FIXED ===== */
#open_menu {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#open_menu:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Коли меню відкрите - іконка рухається вліво */
#menu_block.active ~ #menu_part #open_menu {
    right: auto !important;
    left: 420px !important;
}

/* ===== MENU ICON ===== */
#imgmenu {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(14, 165, 233, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(224, 242, 254, 0.9) 100%);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
    display: block;
}

#imgmenu:hover {
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.95) 0%, rgba(186, 230, 253, 0.95) 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.25);
}

/* ===== MENU BLOCK (SIDEBAR) ===== */
#menu_block {
    position: fixed;
    top: 0;
    right: 0;
    width: 0;
    min-width: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 249, 255, 0.98) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 9998;
    overflow: hidden;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(14, 165, 233, 0.15);
    border-left: 1px solid rgba(14, 165, 233, 0.2);
    overflow-y: auto;
    max-height: 100vh;
}

#menu_block.active {
    width: 400px;
    min-width: 400px;
}

/* ===== MENU HEADER ===== */
#menu_text {
    text-align: center;
    padding: 24px 0;
    font-size: 30px;
    font-weight: 800;
    font-family: 'Poppins', 'Ubuntu', sans-serif;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 1px solid rgba(14, 165, 233, 0.2);
    position: relative;
}

#menu_text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9 0%, #6366f1 100%);
    border-radius: 999px;
}

/* ===== MENU CONTENT ===== */
#menu_content {
    padding: 24px;
    font-family: 'Inter', 'Raleway', sans-serif;
    position: relative;
}

/* ===== MENU BLOCKS ===== */
.block_of_menu {
    margin-bottom: 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 251, 255, 0.9) 100%);
    backdrop-filter: blur(12px);
    padding: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.block_of_menu::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.block_of_menu:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
}

.block_of_menu:hover::before {
    opacity: 1;
}

/* ===== MENU HEADER INSIDE BLOCK ===== */
.menu_header {
    display: flex;
    align-items: center;
    padding: 8px;
    position: relative;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.menu_header:hover {
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.4) 0%, rgba(186, 230, 253, 0.4) 100%);
}

.img_for_block_menu {
    width: 32px;
    margin-right: 12px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.block_of_menu:hover .img_for_block_menu {
    transform: scale(1.1) rotate(5deg);
}

.header_of_menu_block {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #0f172a;
    letter-spacing: -0.01em;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* ===== SUBITEMS ===== */
.block_of_subitems {
    padding-left: 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.block_of_subitems.active {
    max-height: 600px;
    margin-top: 12px;
}

.subitem_div {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 12px;
    margin-bottom: 4px;
}

.subitem_div:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    transform: translateX(6px);
}

.subitem_div:hover .menu-img {
    transform: scale(1.15);
}

.menu-img {
    width: 24px;
    margin-right: 10px;
    transition: transform 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.href_menu {
    text-decoration: none;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 4px;
    border-radius: 6px;
    display: block;
    position: relative;
    transition: color 0.2s ease;
}

.href_menu:hover {
    color: #0ea5e9;
}

/* ===== NOTIFICATION BADGES ===== */
.notification-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.4);
    }
}

.notification-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-family: 'Poppins', 'Kanit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    min-width: 20px;
    min-height: 20px;
    line-height: 12px;
    text-align: center;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===== NEW BADGE ===== */
.menu-new {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 5px 12px;
    border-radius: 999px;
    font: 800 11px/1 'Poppins', 'Inter', system-ui, sans-serif;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #1b1b1b;
    background: linear-gradient(135deg, #FF9D42 0%, #FF7A1A 100%);
    border: 1px solid #FF7A1A;
    box-shadow: 0 8px 18px rgba(255, 122, 26, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.35);
    pointer-events: none;
    animation: new-pulse 1.8s ease-in-out infinite;
}

.menu-new::after {
    content: "";
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 45%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.9;
}

.menu-new::before {
    content: "";
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    transform: skewX(-20deg);
    animation: new-shimmer 3.2s ease-in-out infinite;
}

@keyframes new-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 140, 0, 0.45),
                    0 8px 18px rgba(255, 122, 26, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.35);
        transform: translateY(-50%) scale(1);
    }
    55% {
        box-shadow: 0 0 0 12px rgba(255, 140, 0, 0),
                    0 14px 26px rgba(255, 122, 26, 0.4),
                    inset 0 1px 0 rgba(255, 255, 255, 0.35);
        transform: translateY(-50%) scale(1.06);
    }
}

@keyframes new-shimmer {
    0% { left: -30%; opacity: 0; }
    10% { opacity: 0.9; }
    50% { left: 110%; opacity: 0; }
    100% { left: 110%; opacity: 0; }
}

.block_of_menu:hover .menu-new {
    transform: translateY(-50%) scale(1.04);
}

/* ===== COURSE SWITCHER ===== */
.course-switcher {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 12px 0 20px;
    padding: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.6) 0%, rgba(186, 230, 253, 0.6) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.08);
}

.course-btn {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    background: transparent;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-btn.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2),
                0 6px 14px rgba(14, 165, 233, 0.35);
}

.course-btn:not(.active):hover {
    background: rgba(14, 165, 233, 0.08);
    color: #0ea5e9;
}

/* ===== COURSE BLOCKS ANIMATION ===== */
.course-3-block,
.course-4-block {
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
}

.course-hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    max-height: 0 !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: 0 !important;
    overflow: hidden;
}

/* ===== FIRE ICON ===== */
.fire-title {
    position: relative;
    padding-right: 32px;
}

.fire-title::after {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-60%);
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.8));
    animation: flame-flicker 1.25s ease-in-out infinite,
               flame-float 2.4s ease-in-out infinite;
}

@keyframes flame-flicker {
    0%, 100% {
        transform: translateY(-60%) scale(1) rotate(0deg);
        filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.8));
    }
    40% {
        transform: translateY(-62%) scale(1.1) rotate(-2deg);
        filter: drop-shadow(0 0 12px rgba(255, 140, 0, 1));
    }
    70% {
        transform: translateY(-58%) scale(0.95) rotate(2deg);
    }
}

@keyframes flame-float {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -2px; }
}

/* ===== BLINK LINK ===== */
.blink-link {
    position: relative;
    font-weight: 700;
    animation: glow-pulse 1.8s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        text-shadow: 0 0 0 rgba(255, 196, 0, 0);
    }
    50% {
        text-shadow: 0 0 10px rgba(255, 196, 0, 0.9);
    }
}

.blink-link::after {
    content: "";
    position: absolute;
    top: 6px;
    right: -14px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff3b3b;
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.6);
    animation: ping 1.6s ease-out infinite;
}

@keyframes ping {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.6);
    }
    70% {
        transform: scale(1.35);
        box-shadow: 0 0 0 12px rgba(255, 59, 59, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(255, 59, 59, 0);
    }
}

/* ===== DARK MODE ===== */
body.dark-mode header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    border-bottom: 1px solid rgba(51, 65, 85, 0.8);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode #logo span {
    color: #f1f5f9;
}

body.dark-mode #med {
    background: linear-gradient(135deg, #ff8a8a 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode #online {
    background: linear-gradient(135deg, #a3e4b8 0%, #86d4a1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode #menu_block {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
    border-left: 1px solid rgba(51, 65, 85, 0.8);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
}

body.dark-mode #menu_text {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom-color: rgba(51, 65, 85, 0.8);
}

body.dark-mode #menu_text::after {
    background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 100%);
}

body.dark-mode .block_of_menu {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border-color: rgba(51, 65, 85, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .block_of_menu::before {
    background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 70%);
}

body.dark-mode .header_of_menu_block {
    color: #f1f5f9;
}

body.dark-mode .menu_header:hover {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.6) 0%, rgba(17, 24, 39, 0.6) 100%);
}

body.dark-mode .subitem_div:hover {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
}

body.dark-mode .href_menu {
    color: #cbd5e1;
}

body.dark-mode .href_menu:hover {
    color: #0ea5e9;
}

body.dark-mode .img_for_block_menu,
body.dark-mode .menu-img {
    filter: brightness(0.9) invert(0.9);
}

body.dark-mode #imgmenu {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(31, 41, 55, 0.9) 100%);
    border-color: rgba(51, 65, 85, 0.8);
}

body.dark-mode #imgmenu:hover {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
}

body.dark-mode .course-switcher {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-color: rgba(51, 65, 85, 0.8);
}

body.dark-mode .course-btn {
    color: #e5e7eb;
}

body.dark-mode .course-btn.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

body.dark-mode .menu-new {
    color: #111;
    background: linear-gradient(180deg, #FF9A36 0%, #FF6A0F 100%);
    border-color: #FF6A0F;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45),
                0 10px 22px rgba(255, 122, 26, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* ===== НОВОРІЧНИЙ РЕЖИМ ===== */
body.new-year-mode {
    position: relative;
    overflow-x: hidden;
}

/* Гірлянда зверху */
body.new-year-mode header::after {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
    background: radial-gradient(circle at 8% 50%, #ff3b3b 0%, transparent 10%),
                radial-gradient(circle at 23% 50%, #ffd93d 0%, transparent 10%),
                radial-gradient(circle at 38% 50%, #44cf46 0%, transparent 10%),
                radial-gradient(circle at 53% 50%, #40c4ff 0%, transparent 10%),
                radial-gradient(circle at 68% 50%, #ff8a65 0%, transparent 10%),
                radial-gradient(circle at 83% 50%, #7c4dff 0%, transparent 10%);
    background-size: 80px 80px;
    opacity: 0.9;
    animation: garland-glow 4s ease-in-out infinite;
    z-index: 10;
}

@keyframes garland-glow {
    0%, 100% { opacity: 0.7; }
    25% { opacity: 1; }
    50% { opacity: 0.8; }
    75% { opacity: 1; }
}

body.dark-mode.new-year-mode header::after {
    filter: brightness(1.4);
    opacity: 1;
}

/* Ялинка зліва від логотипу */
body.new-year-mode #logo {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px 0 15px 110px;
    margin-left: 20px;
    z-index: 10;
}

body.new-year-mode #logo::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 100px;
    background: url('/views/imgs/treegifts.svg') no-repeat center;
    background-size: contain;
    animation: tree-sway 8s ease-in-out infinite;
}

@keyframes tree-sway {
    0%, 100% { transform: translateY(-50%) rotate(0deg); }
    50% { transform: translateY(-50%) rotate(4deg); }
}

/* Санта що летить */
body.new-year-mode .santa-fly {
    position: fixed;
    width: 90px;
    height: 90px;
    cursor: pointer;
    z-index: 9997;
    pointer-events: auto;
    opacity: 1;
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.4, 1);
}

body.new-year-mode .santa-fly img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Лічильник Санта */
body.new-year-mode #santa-counter {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(254, 242, 242, 0.95) 100%);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    color: #d32f2f;
    box-shadow: 0 10px 30px rgba(211, 47, 47, 0.3);
    z-index: 9996;
    border: 3px solid #ff3b3b;
    animation: counter-glow 4s ease-in-out infinite;
    transition: transform 0.3s ease;
}

body.new-year-mode #santa-counter:hover {
    transform: scale(1.05);
}

body.new-year-mode #santa-counter img {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

body.new-year-mode #santa-counter span {
    font-size: 22px;
}

@keyframes counter-glow {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(211, 47, 47, 0.3),
                    0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 15px 40px rgba(211, 47, 47, 0.5),
                    0 0 0 10px rgba(239, 68, 68, 0);
    }
}

body.dark-mode.new-year-mode #santa-counter {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    color: #ff6b6b;
    border-color: #ff9a9e;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
    #menu_block.active {
        width: 70vw;
        min-width: 70vw;
    }

    #menu_block.active ~ #menu_part #open_menu {
        left: calc(70vw + 20px) !important;
    }

    #menu_text {
        font-size: 26px;
    }

    #menu_content {
        padding: 20px;
    }

    .header_of_menu_block {
        font-size: 16px;
    }

    .href_menu {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    #open_menu {
        top: 15px !important;
        right: 15px !important;
    }

    #menu_block.active ~ #menu_part #open_menu {
        left: calc(70vw + 15px) !important;
        top: 15px !important;
    }

    body.new-year-mode #logo {
        padding: 10px 0 10px 80px;
        margin-left: 10px;
    }

    body.new-year-mode #logo::before {
        left: 10px;
        width: 60px;
        height: 80px;
    }

    body.new-year-mode .santa-fly {
        width: 70px;
        height: 70px;
    }

    body.new-year-mode #santa-counter {
        top: 10px;
        left: 10px;
        padding: 10px 16px;
        font-size: 15px;
    }

    body.new-year-mode #santa-counter img {
        width: 35px;
        height: 35px;
    }

    body.new-year-mode #santa-counter span {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    #menu_block.active {
        width: 85vw;
        min-width: 85vw;
    }

    #open_menu {
        top: 12px !important;
        right: 12px !important;
    }

    #menu_block.active ~ #menu_part #open_menu {
        left: calc(85vw + 12px) !important;
        top: 12px !important;
    }

    #menu_text {
        font-size: 24px;
        padding: 20px 0;
    }

    #menu_content {
        padding: 16px;
    }

    .block_of_menu {
        padding: 14px;
        margin-bottom: 12px;
    }

    .header_of_menu_block {
        font-size: 15px;
    }

    .href_menu {
        font-size: 13px;
    }

    .img_for_block_menu {
        width: 28px;
    }

    .menu-img {
        width: 20px;
    }

    .course-switcher {
        padding: 5px;
        margin: 10px 0 8px; /* ← ЗМІНА: було 16px, стало 8px */
    }


    .course-btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    .menu-new {
        right: 8px;
        padding: 4px 10px;
        font-size: 10px;
    }

    #imgmenu {
        width: 42px;
        height: 42px;
        padding: 8px;
    }
}

@media (max-width: 400px) {
    #open_menu {
        top: 10px !important;
        right: 10px !important;
    }

    #menu_block.active ~ #menu_part #open_menu {
        left: calc(85vw + 10px) !important;
        top: 10px !important;
    }

    #imgmenu {
        width: 40px;
        height: 40px;
        padding: 7px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .menu-new,
    .fire-title::after,
    .blink-link,
    .blink-link::after {
        animation: none !important;
    }

    .blink-link {
        text-shadow: none;
    }
}

/* ===== SCROLLBAR ===== */
#menu_block::-webkit-scrollbar {
    width: 8px;
}

#menu_block::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.3);
    border-radius: 10px;
}

#menu_block::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    border-radius: 10px;
}

#menu_block::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
}

body.dark-mode #menu_block::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
}

body.dark-mode #menu_block::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.6) 0%, rgba(99, 102, 241, 0.6) 100%);
}


/* ========================================
   MOBILE PERFORMANCE - HEADER & SIDEBAR
   ======================================== */

@media (max-width: 900px) {
  /* Відключити backdrop-filter */
  header,
  #menu_block,
  .block_of_menu,
  #imgmenu,
  .course-switcher,
  #santa-counter {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }


    .course-switcher {
        margin: 8px 0 6px !important; /* Мінімальний відступ */
    }
    
    .course-hidden {
        display: none !important; /* Повністю приховати */
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }

  /* Solid backgrounds замість gradient+backdrop */
  header {
    background: #ffffff !important;
  }

  body.dark-mode header {
    background: #1e293b !important;
  }

  #menu_block {
    background: #ffffff !important;
  }

  body.dark-mode #menu_block {
    background: #1e293b !important;
  }

  .block_of_menu {
    background: #f9fafb !important;
  }

  body.dark-mode .block_of_menu {
    background: #1f2937 !important;
  }

  #imgmenu {
    background: #ffffff !important;
  }

  body.dark-mode #imgmenu {
    background: #1e293b !important;
  }

  #imgmenu:hover {
    background: #e0f2fe !important;
  }

  body.dark-mode #imgmenu:hover {
    background: #1f2937 !important;
  }

  .course-switcher {
    background: #e0f2fe !important;
  }

  body.dark-mode .course-switcher {
    background: #1f2937 !important;
  }

  .course-btn.active {
    background: #0ea5e9 !important;
  }

  .menu_header:hover {
    background: rgba(224, 242, 254, 0.5) !important;
  }

  body.dark-mode .menu_header:hover {
    background: rgba(31, 41, 55, 0.7) !important;
  }

  .subitem_div:hover {
    background: #e0f2fe !important;
  }

  body.dark-mode .subitem_div:hover {
    background: #1f2937 !important;
  }

  .course-btn:not(.active):hover {
    background: rgba(14, 165, 233, 0.1) !important;
  }

  #santa-counter {
    background: #ffffff !important;
  }

  body.dark-mode #santa-counter {
    background: #1e293b !important;
  }

  /* Спростити тіні */
  header {
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.08) !important;
  }

  body.dark-mode header {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  }

  #menu_block {
    box-shadow: -6px 0 20px rgba(14, 165, 233, 0.1) !important;
  }

  body.dark-mode #menu_block {
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.4) !important;
  }

  .block_of_menu {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
  }

  body.dark-mode .block_of_menu {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }

  .block_of_menu:hover {
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.12) !important;
  }

  #imgmenu {
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1) !important;
  }

  #imgmenu:hover {
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15) !important;
  }

  .course-switcher {
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08) !important;
  }

  .course-btn.active {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2) !important;
  }

  #santa-counter {
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2) !important;
  }

  .menu-new {
    box-shadow: 0 4px 12px rgba(255, 122, 26, 0.2) !important;
  }

  body.dark-mode .menu-new {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  }

  /* Прибрати декоративні ::before та ::after */
  .block_of_menu::before,
  #menu_text::after {
    display: none !important;
  }

  /* Спростити gradient text */
  #menu_text {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: #0ea5e9 !important;
  }

  body.dark-mode #menu_text {
    color: #38bdf8 !important;
  }

  #med {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: #eb2138 !important;
  }

  body.dark-mode #med {
    color: #ff8a8a !important;
  }

  #online {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: #10b981 !important;
  }

  body.dark-mode #online {
    color: #a3e4b8 !important;
  }

  /* Відключити hover transforms */
  #logo:hover,
  #open_menu:hover,
  #imgmenu:hover,
  .block_of_menu:hover,
  .subitem_div:hover,
  #santa-counter:hover {
    transform: none !important;
  }

  /* Залишити тільки scale на елементах меню */
  .block_of_menu:hover .img_for_block_menu {
    transform: scale(1.05) !important;
  }

  .subitem_div:hover .menu-img {
    transform: scale(1.1) !important;
  }

  /* Відключити menu новорічні анімації на мобільних */
  body.new-year-mode header::after,
  body.new-year-mode #logo::before {
    display: none !important;
  }

  body.new-year-mode #logo {
    padding: 4px 0 4px 5% !important;
    margin-left: 0 !important;
  }

  /* Спростити transitions */
  header,
  #logo,
  #logo_img,
  #open_menu,
  #imgmenu,
  #menu_block,
  .block_of_menu,
  .menu_header,
  .img_for_block_menu,
  .header_of_menu_block,
  .block_of_subitems,
  .subitem_div,
  .menu-img,
  .href_menu,
  .course-switcher,
  .course-btn,
  #santa-counter,
  .menu-new {
    transition-duration: 0.15s !important;
  }

  .block_of_subitems {
    transition-duration: 0.3s !important;
  }

  /* Відключити анімації */
  .notification-dot,
  .notification-badge,
  .menu-new,
  .menu-new::before,
  .fire-title::after,
  .blink-link,
  .blink-link::after,
  body.new-year-mode header::after,
  body.new-year-mode #logo::before {
    animation: none !important;
  }

  /* Спростити notification-badge */
  .notification-badge {
    background: #ef4444 !important;
  }

  /* Спростити menu-new */
  .menu-new {
    background: #FF9D42 !important;
  }

  .menu-new::after {
    display: none !important;
  }

  body.dark-mode .menu-new {
    background: #FF9A36 !important;
  }

  /* Спростити filter effects */
  #logo_img {
    filter: none !important;
  }

  #logo:hover #logo_img {
    filter: none !important;
  }

  .img_for_block_menu,
  .menu-img {
    filter: none !important;
  }

  body.dark-mode .img_for_block_menu,
  body.dark-mode .menu-img {
    filter: brightness(0.9) !important;
  }

  /* Спростити scrollbar */
  #menu_block::-webkit-scrollbar-thumb {
    background: #0ea5e9 !important;
  }

  #menu_block::-webkit-scrollbar-thumb:hover {
    background: #0284c7 !important;
  }

  body.dark-mode #menu_block::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.6) !important;
  }

  /* Спростити course-hidden animation */
  .course-hidden {
    transition-duration: 0.2s !important;
  }

  /* Відключити fire icon animation */
  .fire-title::after {
    transform: translateY(-60%) !important;
    filter: none !important;
  }

  /* Відключити blink-link effects */
  .blink-link {
    text-shadow: none !important;
  }

  .blink-link::after {
    display: none !important;
  }

  /* Спростити new-year Santa */
  body.new-year-mode .santa-fly {
    transition-duration: 0.8s !important;
  }

  body.new-year-mode .santa-fly img {
    filter: none !important;
  }

  body.new-year-mode #santa-counter img {
    filter: none !important;
  }

  /* Спростити garland (якщо залишаємо) */
  body.new-year-mode header::after {
    opacity: 0.6 !important;
  }

  body.dark-mode.new-year-mode header::after {
    opacity: 0.7 !important;
  }
}

/* Для дуже слабких пристроїв */
@media (max-width: 480px) and (max-height: 800px) {
  /* Мінімальні тіні */
  header,
  #menu_block,
  .block_of_menu {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
  }

  body.dark-mode header,
  body.dark-mode #menu_block,
  body.dark-mode .block_of_menu {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }

  /* Відключити анімації — ТІЛЬКИ в межах хедера/меню (не чіпаємо контент сторінок) */
  header *, #menu_part *, #open_menu, #santa-counter, .santa-fly {
    animation: none !important;
    transition-duration: 0.1s !important;
  }

  /* Спростити всі gradients */
  .course-btn.active {
    background: #0ea5e9 !important;
  }

  #santa-counter {
    background: #ffffff !important;
  }

  body.dark-mode #santa-counter {
    background: #1e293b !important;
  }

  /* Зменшити padding */
  #menu_content {
    padding: 16px !important;
  }

  .block_of_menu {
    padding: 12px !important;
    margin-bottom: 10px !important;
  }

  .menu_header {
    padding: 6px !important;
  }

  .subitem_div {
    padding: 8px 10px !important;
  }

  /* Зменшити іконки */
  .img_for_block_menu {
    width: 26px !important;
  }

  .menu-img {
    width: 18px !important;
  }

  #imgmenu {
    width: 38px !important;
    height: 38px !important;
    padding: 6px !important;
  }

  /* Спростити menu-new */
  .menu-new {
    padding: 4px 10px !important;
    font-size: 10px !important;
  }

  /* Спростити course-switcher */
  .course-switcher {
    padding: 4px !important;
    margin: 8px 0 14px !important;
  }

  .course-btn {
    padding: 7px 10px !important;
    font-size: 11px !important;
  }

  /* Спростити santa-counter */
  body.new-year-mode #santa-counter {
    padding: 8px 14px !important;
    font-size: 14px !important;
    border-width: 2px !important;
  }

  body.new-year-mode #santa-counter img {
    width: 32px !important;
    height: 32px !important;
  }

  body.new-year-mode #santa-counter span {
    font-size: 16px !important;
  }

  /* Спростити notification-badge */
  .notification-badge {
    font-size: 10px !important;
    padding: 3px 5px !important;
    min-width: 18px !important;
    min-height: 18px !important;
  }

  /* Спростити notification-dot */
  .notification-dot {
    width: 6px !important;
    height: 6px !important;
  }
}

/* Для landscape орієнтації */
@media (max-width: 900px) and (max-height: 500px) {
  #menu_content {
    padding: 16px !important;
  }

  .block_of_menu {
    padding: 12px !important;
    margin-bottom: 10px !important;
  }

  #menu_text {
    padding: 18px 0 !important;
    font-size: 22px !important;
  }

  .course-switcher {
    margin: 8px 0 14px !important;
  }

  body.new-year-mode #santa-counter {
    top: 8px !important;
    left: 8px !important;
  }
}
