:root {
    --gold-gradient: linear-gradient(45deg, #d4af37 0%, #f1c40f 50%, #d4af37 100%);
    --gold: #d4af37;
    --black: #050505;
    --gray-dark: #121212;
    --gray-light: #1e1e1e;
    --white: #f5f5f5;
    --red: #ff4444;
    --torn-clip: polygon(0% 0%, 5% 10%, 10% 0%, 15% 12%, 20% 2%, 25% 15%, 30% 5%, 35% 18%, 40% 8%, 45% 20%, 50% 10%, 55% 22%, 60% 12%, 65% 25%, 70% 15%, 75% 28%, 80% 18%, 85% 30%, 90% 20%, 95% 32%, 100% 22%, 100% 100%, 0% 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --radius: 16px;
    --text-muted: #a0a0a0;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--black); color: var(--white); font-family: 'Inter', sans-serif; margin: 0; padding: 0; overflow-x: hidden; }
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* --- GLOBAL VIEW TRANSITIONS (FLOW EFFECT) --- */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.4s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- ФОНОВІ ЕФЕКТИ (Liquid Glass) --- */
.background-blobs {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    top: -10%; left: -10%; width: 50vh; height: 50vh;
    background: radial-gradient(circle, var(--gold), transparent);
}

.blob-2 {
    bottom: -10%; right: -10%; width: 60vh; height: 60vh;
    background: radial-gradient(circle, #333, transparent);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%; right: -20%; width: 40vh; height: 40vh;
    background: radial-gradient(circle, #222, transparent);
    animation-delay: -2s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.torn-divider { display: none; }

header { 
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    margin: 15px;
    padding: 15px;
    text-align: center;
    position: sticky;
    top: 10px;
    z-index: 100;
    border-radius: var(--radius);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo { font-size: clamp(1.5rem, 8vw, 2.5rem); font-weight: 900; letter-spacing: 4px; background: var(--gold-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-transform: uppercase; display: block; max-height: 100px; transition: all 0.5s ease; overflow: hidden; }

.lang-switcher {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 5px;
}

/* Ховаємо перемикач у хедері на мобільних за замовчуванням */
header .lang-switcher {
    display: none;
}

.lang-btn {
    background: none;
    border: 1px solid #444;
    color: #888;
    border-radius: 4px;
    padding: 2px 5px;
    cursor: pointer;
    font-size: 0.7rem;
}

main { flex: 1; padding-bottom: 100px; }
.screen { padding: 15px; max-width: 600px; margin: 0 auto; animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- NEW ANIMATIONS --- */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.9) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-card {
    opacity: 0; /* Початковий стан - приховано */
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.clickable:active {
    transform: scale(0.96) !important;
}

h1 { font-size: 1.2rem; text-transform: uppercase; color: var(--gold); text-align: center; margin: 20px 0; font-weight: 800; }

.card { 
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-radius: var(--radius);
    margin-bottom: 15px; 
    padding: 16px; 
    transition: all 0.3s ease;
    color: white;
}

/* GALLERY GRID */
.gallery-collage {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    grid-auto-rows: 110px;
    grid-auto-flow: dense;
    gap: 8px;
    padding-bottom: 20px;
}

.gallery-slot {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    background: #111;
    /* Без transform transition — не спричиняємо repaint при зміні фото */
}

/* Розміри комірок — фіксовані, не змінюються в runtime */
.gallery-slot.span-2x2 { grid-column: span 2; grid-row: span 2; }
.gallery-slot.span-2x1 { grid-column: span 2; }
.gallery-slot.span-1x2 { grid-row: span 2; }

/* Золота рамка при наведенні */
.gallery-slot::after {
    content: ''; position: absolute; inset: 0;
    border: 2px solid var(--gold); border-radius: 12px;
    opacity: 0; transition: opacity 0.4s; pointer-events: none;
    z-index: 3;
}
.gallery-slot:hover::after { opacity: 1; }

/* ===== CROSSFADE: два шари зображень ===== */
/* Back — нижній шар, завантажує нове фото непомітно */
.gallery-img-back {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
    /* Тихий Ken Burns ефект на фоні */
    animation: kenburns-slow 12s ease-in-out infinite alternate;
}

/* Front — верхній шар, видимий користувачу */
.gallery-img-front {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.7s ease-in-out;
    animation: kenburns-slow 12s ease-in-out infinite alternate;
}

/* Плавне зникнення front → видно back з новим фото */
.gallery-img-front.fade-out {
    opacity: 0;
}

/* Тихий Ken Burns для живого відчуття без мигання */
@keyframes kenburns-slow {
    from { transform: scale(1.0) translate(0%, 0%); }
    to   { transform: scale(1.08) translate(-1.5%, -1.5%); }
}

@media (min-width: 768px) {
    .gallery-collage {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-auto-rows: 150px;
    }
}

@media (max-width: 480px) {
    .gallery-collage {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 100px;
        gap: 6px;
    }
    /* На малих екранах тільки горизонтальний span */
    .gallery-slot.span-1x2 { grid-row: unset; }
}


/* ADMIN GALLERY GRID FIX */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #333;
    background: #000;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* РЕШТА СТИЛІВ */
.gold-btn { 
    background: linear-gradient(135deg, var(--gold), #b8962e);
    border: none;
    color: #000;
    font-weight: 800;
    padding: 14px;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: 0.3s;
    margin: 10px 0;
}
.gold-btn:hover {
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}
.gold-btn.btn-secondary { background: transparent; border: 1px solid var(--gold); color: var(--gold); box-shadow: none; }

#bottom-nav { 
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 500px;
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: var(--radius);
    display: flex; justify-content: space-around; padding: 10px; z-index: 999;
}
#bottom-nav button { background: transparent; border: none; color: var(--text-muted); font-size: 0.7rem; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; transition: 0.3s; }
#bottom-nav button.active { color: var(--gold); }
#bottom-nav button svg { width: 20px; height: 20px; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-card { background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); width: 90%; max-width: 400px; border-radius: var(--radius); }
.modal-content { padding: 30px; text-align: center; }

/* Глобальне модальне вікно (Alert/Confirm) має бути поверх інших */
#modal-overlay { z-index: 3000; }

input { background: rgba(0, 0, 0, 0.2); border: 1px solid var(--glass-border); color: white; padding: 12px; border-radius: 10px; width: 100%; font-size: 1rem; margin-bottom: 10px; }
input:focus { outline: none; border-color: var(--gold); background: rgba(0, 0, 0, 0.4); }

.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 15px; }
.time-slot { 
    background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 10px; text-align: center; border-radius: var(--radius); cursor: pointer; font-size: 0.9rem; transition: 0.2s;
    opacity: 0; /* Початковий стан для animate-card */
}
.time-slot.selected { background: var(--gold); color: black; }
.time-slot.disabled { opacity: 0.15; cursor: not-allowed; text-decoration: line-through; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#date-scroll {
    display: flex;
    overflow-x: auto;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    scrollbar-width: none;
    position: relative;
}
#date-scroll::-webkit-scrollbar { display: none; }

.date-card { 
    background: var(--glass-bg); 
    backdrop-filter: blur(16px); 
    border: 1px solid var(--glass-border); 
    border-radius: 50%; 
    width: 60px; 
    height: 60px; 
    min-width: 60px; 
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer; 
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0; /* Забороняємо стискання кружечків */
}
.date-card.selected { background: var(--gold); color: black; }
.date-card.disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(100%);
    background: rgba(255, 255, 255, 0.05);
    border-color: transparent;
}

/* Обгортка та стрілки для дат */
.date-wrapper { position: relative; display: flex; align-items: center; }

.scroll-btn {
    position: absolute;
    z-index: 10;
    background: rgba(0,0,0,0.8);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    padding-bottom: 5px;
    transition: 0.3s;
}
.scroll-btn:hover { background: var(--gold); color: black; }
.scroll-btn.left { left: -10px; }
.scroll-btn.right { right: -10px; }

@media (max-width: 768px) {
    .scroll-btn { display: none; } /* Ховаємо стрілки на мобільних */
}

/* Стилі для згорнутої шапки */
header.collapsed {
    padding-top: 5px;
    padding-bottom: 5px;
}
header.collapsed .logo-wrapper {
    max-height: 0;
    opacity: 0;
    margin: 0;
    overflow: hidden;
}

/* --- RESOURCE SCHEDULER (АДМІН КАЛЕНДАР) --- */
.scheduler-wrapper {
    overflow-x: auto;
    background: #222;
    border: 1px solid #333;
    border-radius: 12px;
    position: relative;
    margin-top: 20px;
    /* Тіні для підказки скролу */
    box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.5);
}
.scheduler-header {
    display: flex;
    border-bottom: 1px solid #444;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #222;
}
.scheduler-time-spacer, .scheduler-time-col {
    min-width: 50px;
    width: 50px;
    border-right: 1px solid #444;
    background: #222;
    position: sticky;
    left: 0;
    z-index: 20;
    flex-shrink: 0;
}
.scheduler-barber-header {
    min-width: 140px;
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    border-right: 1px solid #333;
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scheduler-body { display: flex; position: relative; }
.time-label { height: 60px; border-bottom: 1px solid #333; font-size: 0.7rem; color: #888; text-align: center; padding-top: 5px; box-sizing: border-box; }
.scheduler-barber-col {
    min-width: 140px;
    flex: 1;
    border-right: 1px solid #333;
    position: relative;
    /* Лінії сітки кожну годину (60px) */
    background: repeating-linear-gradient(to bottom, transparent 0px, transparent 59px, #2a2a2a 60px);
}
.scheduler-event {
    position: absolute; left: 2px; right: 2px; border-radius: 4px; padding: 4px; font-size: 0.75rem; overflow: hidden; cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); border-left: 3px solid var(--gold); background: rgba(212, 175, 55, 0.2); color: white; z-index: 5;
    transition: transform 0.2s;
}
.scheduler-event:hover { transform: scale(1.02); z-index: 10; background: rgba(212, 175, 55, 0.3); }
.scheduler-event.completed { border-left-color: green; background: rgba(0, 128, 0, 0.2); }

.current-time-line {
    position: absolute;
    left: 50px; /* Відступ, щоб не перекривати колонку з годинами */
    right: 0;
    border-top: 2px solid var(--red);
    z-index: 25;
    pointer-events: none; /* Щоб крізь лінію можна було клікати на записи */
}
.current-time-line::before {
    content: ''; position: absolute; left: -6px; top: -5px;
    width: 10px; height: 10px; background: var(--red); border-radius: 50%;
}

/* --- ADMIN CALENDAR DAYS --- */
.adm-cal-day:hover, .cal-day:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* --- CHART INTERACTIVITY --- */
.chart-bar-hover:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
    transform-origin: bottom;
}

/* --- COMPACT SERVICE CARDS --- */
.service-list-container { display: flex; flex-direction: column; gap: 8px; }

.service-card-compact {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.service-card-compact:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.08); }

.service-card-compact img {
    width: 45px; height: 45px; border-radius: 8px; object-fit: cover; background: #222;
}
.service-card-compact .info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.service-card-compact .name { font-weight: 600; font-size: 0.95rem; color: white; line-height: 1.2; }
.service-card-compact .meta { font-size: 0.75rem; color: #888; margin-top: 2px; }
.service-card-compact .price {
    font-weight: 700; color: var(--gold); font-size: 0.95rem;
    background: rgba(212, 175, 55, 0.1); padding: 6px 10px; border-radius: 8px; white-space: nowrap;
}

/* --- BARBER GRID --- */
.barber-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 в ряд */
    gap: 10px;
}
@media (max-width: 400px) {
    .barber-grid { grid-template-columns: repeat(2, 1fr); } /* 2 в ряд на вузьких екранах */
}

.barber-card-compact {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease; /* Виправляє блимання при появі */
    cursor: pointer;
}
.barber-card-compact:active { transform: scale(0.95); border-color: var(--gold); }

.barber-card-compact img {
    width: 65px; height: 65px; border-radius: 50%; object-fit: cover;
    border: 2px solid transparent; transition: 0.2s; background: #222;
}
.barber-card-compact:hover img { border-color: var(--gold); }
.barber-card-compact .name { font-size: 0.85rem; font-weight: 600; color: white; }

/* --- INSTALL PROMPT --- */
.install-prompt {
    position: fixed;
    bottom: 90px; /* Трохи вище нижнього меню */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 998;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* --- DESKTOP ADAPTATION --- */
@media (min-width: 1024px) {
    /* Layout */
    body { background-attachment: fixed; }
    .screen { max-width: 1100px; padding: 40px; }
    
    /* Header & Nav */
    header {
        display: flex; align-items: center; justify-content: flex-start;
        padding: 15px 40px; margin: 0; border-radius: 0; border: none; border-bottom: 1px solid var(--glass-border);
        position: sticky; top: 0;
    }
    header .logo-wrapper { margin: 0; margin-right: auto; align-items: flex-start; text-align: left; }
    header .logo { font-size: 2rem; }
    
    .lang-switcher {
        margin-top: 0;
        margin-right: 20px;
        margin-left: auto;
    }
    
    /* На комп'ютері показуємо перемикач у хедері */
    header .lang-switcher { display: flex; }

    /* На комп'ютері ховаємо перемикачі всередині екранів (щоб не дублювати) */
    .mobile-only-switcher { display: none; }

    #user-info { margin: 0 0 0 20px; order: 3; text-align: right; font-size: 1rem !important; }
    
    #bottom-nav {
        top: 0; bottom: auto; width: auto; max-width: none;
        background: transparent; border: none; backdrop-filter: none;
        padding: 22px 0; display: flex; gap: 30px; justify-content: center; z-index: 1001;
    }
    #bottom-nav button {
        flex-direction: row; font-size: 1rem; gap: 8px; color: #ccc;
    }
    #bottom-nav button:hover { color: white; }
    #bottom-nav button.active { color: var(--gold); }
    #bottom-nav button svg { width: 18px; height: 18px; }

    /* Grids */
    .service-list-container {
        display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px;
    }
    .barber-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .time-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Admin Dashboard */
    .stats-container { grid-template-columns: repeat(4, 1fr) !important; }
    .admin-nav { display: flex !important; gap: 10px; justify-content: center; }
    .admin-nav button { width: auto; padding: 10px 25px !important; font-size: 0.9rem !important; }
    
    /* Hide mobile elements */
    .torn-divider { display: none; }
    header.collapsed .logo-wrapper { max-height: 100px; opacity: 1; margin: 0; margin-right: auto; } /* Disable collapse */
    header.collapsed { padding-top: 15px; padding-bottom: 15px; }
    footer { padding-bottom: 15px !important; }
}

/* --- ADMIN EDIT STYLES --- */
.day-selector {
    flex: 1; height: 40px; border-radius: 8px; background: #222; color: #888;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    font-size: 0.8rem; transition: 0.2s; border: 1px solid #333;
}
.day-selector:hover { background: #333; }
.day-selector.selected {
    background: var(--gold); color: black; font-weight: bold; border-color: var(--gold);
}
.blocked-date-tag {
    background: rgba(255, 68, 68, 0.1); padding: 6px 12px; border-radius: 20px; font-size: 0.85rem;
    display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255, 68, 68, 0.3); color: #ffcccc;
}
.blocked-date-tag span { cursor: pointer; color: #ff4444; font-weight: bold; font-size: 1.1rem; line-height: 0.8; }
.service-checkbox-card {
    background: #1a1a1a; border: 1px solid #333; border-radius: 10px; padding: 12px;
    cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.service-checkbox-card:hover { background: #222; }
.service-checkbox-card.checked {
    border-color: var(--gold); background: rgba(212, 175, 55, 0.1);
}
.switch { position: relative; display: inline-block; width: 50px; height: 26px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--gold); }
input:checked + .slider:before { transform: translateX(24px); }

/* --- ADMIN FIXED SUB-MENU --- */
.admin-sub-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    position: fixed;
    bottom: 90px; /* Розміщуємо над основним нижнім меню */
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 600px;
    z-index: 998;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}
.admin-sub-tabs button {
    padding: 8px 2px !important;
    font-size: 0.75rem !important;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- ADMIN SCROLLABLE NAV --- */
.admin-nav-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
    cursor: grab; /* Курсор "рука" */
}
.admin-nav-scroll:active { cursor: grabbing; }

.admin-nav-scroll::-webkit-scrollbar { height: 4px; display: block; }
.admin-nav-scroll::-webkit-scrollbar-track { background: transparent; }
.admin-nav-scroll::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }
.admin-nav-scroll::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.admin-nav-scroll button {
    flex: 0 0 auto; /* Не стискати кнопки */
    width: auto;
    padding: 10px 20px;
    font-size: 0.85rem;
    white-space: nowrap;
    margin: 0;
}

/* --- DESKTOP ADMIN LAYOUT --- */
@media (min-width: 1024px) {
    #admin-screen {
        max-width: 1400px;
        padding: 30px 50px;
    }
    
    .admin-layout-body {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 40px;
        align-items: start;
        margin-top: 20px;
    }

    /* Sidebar Navigation */
    .admin-nav-scroll {
        flex-direction: column;
        overflow: visible;
        position: sticky;
        top: 100px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--glass-border);
        border-radius: 16px;
        padding: 20px;
        gap: 10px;
        margin-bottom: 0;
        padding-bottom: 20px;
        cursor: default;
    }

    .admin-nav-scroll button {
        width: 100%;
        text-align: left;
        padding: 15px 20px;
        margin: 0;
        border-radius: 10px;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        transition: 0.2s;
    }
    
    .admin-nav-scroll button.btn-secondary:hover {
        background: rgba(255, 255, 255, 0.05);
        color: white;
        padding-left: 25px; /* Ефект зсуву при наведенні */
    }

    /* Content Area */
    #admin-content {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        padding: 40px;
        min-height: 70vh;
    }

    /* Dashboard Grid Desktop */
    .dashboard-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* --- SETTINGS UI IMPROVEMENTS --- */
.settings-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    transition: 0.3s;
}
.settings-group:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}
.settings-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.day-circle-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #222;
    border: 1px solid #444;
    color: #888;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}
.day-circle-btn:hover { border-color: var(--gold); color: white; }
.day-circle-btn.selected {
    background: rgba(255, 68, 68, 0.2);
    border-color: var(--red);
    color: var(--red);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.2);
}
.input-pill {
    background: #111; border: 1px solid #333; color: white;
    padding: 12px; border-radius: 12px; width: 100%;
    text-align: center; font-weight: bold; font-size: 1rem;
    transition: 0.2s;
}
.input-pill:focus { border-color: var(--gold); background: #000; }

/* --- RESPONSIVE DATE ROW (ADMIN) --- */
.admin-date-row {
    display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 10px; align-items: end;
}
@media (max-width: 480px) {
    .admin-date-row {
        grid-template-columns: 1fr; /* Елементи один під одним */
    }
    .admin-date-row button {
        grid-column: 1; width: 100% !important;
    }
}

/* --- LEGAL TEXT SCROLL --- */
.legal-text-scroll {
    max-height: 60vh;
    overflow-y: auto;
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #ccc;
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
}
.legal-text-scroll h3 { color: var(--gold); margin-top: 0; }
.legal-text-scroll h4 { color: white; margin-top: 15px; margin-bottom: 5px; }

/* --- COOKIE BANNER --- */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(20, 20, 20, 0.98); border-top: 1px solid var(--gold);
    padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px;
    z-index: 2500; /* Нижче модальних вікон, але вище меню */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    font-size: 0.8rem; color: #ccc; line-height: 1.4;
}

/* --- GOOGLE BUTTON --- */
.google-btn {
    background: white;
    color: #444;
    border: none;
    font-weight: bold;
    padding: 14px;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    margin: 10px 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.google-btn:hover {
    background: #eee;
}

/* --- PASSWORD TOGGLE & REMEMBER ME --- */
.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}
.password-wrapper input {
    margin-bottom: 0; /* Прибираємо відступ у інпута, бо він тепер у обгортки */
    padding-right: 45px; /* Місце для іконки */
}
.toggle-password {
    position: absolute; right: 0; top: 0; bottom: 0;
    background: none; border: none; color: #888; cursor: pointer;
    padding: 0 15px; display: flex; align-items: center; justify-content: center;
}
.remember-me {
    display: flex; align-items: center; gap: 10px; margin-bottom: 15px; font-size: 0.9rem; color: #ccc; cursor: pointer;
}
.remember-me input { width: auto; margin: 0; }

/* --- PASSWORD STRENGTH METER --- */
.strength-meter {
    height: 4px;
    background: #333;
    margin-top: 5px;
    border-radius: 2px;
    overflow: hidden;
    display: none; /* Приховано, поки не почнуть вводити */
}
.strength-bar { height: 100%; width: 0; transition: width 0.3s, background-color 0.3s; }
.strength-label {
    font-size: 0.7rem; text-align: right; margin-top: 4px; min-height: 14px; font-weight: bold;
    transition: color 0.3s;
}

/* --- CONTACT SCREEN STYLES --- */
.contact-header {
    text-align: center;
    margin-bottom: 30px;
}
.contact-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3); /* Gold Glow */
    margin-bottom: 15px;
    border: 2px solid var(--gold);
}
.logo-text {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold);
    font-size: 1.2rem;
}
.map-container {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    margin-top: 20px;
    background: #222;
}
.map-container iframe {
    display: block;
    /* Dark Mode Map Filter: інвертує кольори мапи, роблячи її темною */
    filter: grayscale(100%) invert(92%) contrast(83%);
}

/* --- SOCIAL BUTTONS --- */
.social-btn {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    display: flex; align-items: center; justify-content: center;
    color: white;
    transition: 0.3s;
}
.social-btn:hover {
    background: var(--gold);
    color: black;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}
