/* =============================
   ADMIN LAYOUT — WINTER / NEW YEAR (SOFT BABY-BLUE MENU)
   File: resources/css/admin/layout.css
   Full file replacement
================================ */

/* =============================
   VARIABLES
================================ */

:root {
    /* page */
    --admin-page-bg: #f3f6ff;

    /* soft winter palette */
    --ny-blue:   #7bbcff;   /* нежнее */
    --ny-cyan:   #67e8f9;
    --ny-violet: #c4b5fd;
    --ny-pink:   #fda4af;
    --ny-gold:   #ffd59a;
    --ny-green:  #86efac;

    /* text in sidebar */
    --admin-text: #eef6ff;
    --admin-text-muted: rgba(238, 246, 255, 0.70);

    /* layout */
    --sidebar-w: 250px;

    /* ✅ нежные "ледяные" стеклянные плашки */
    --menu-glass: rgba(255,255,255,0.08);
    --menu-glass-2: rgba(255,255,255,0.06);

    --menu-border: rgba(210, 230, 255, 0.22);
    --menu-border-2: rgba(210, 230, 255, 0.16);

    --menu-link-bg: rgba(255,255,255,0.07);
    --menu-link-border: rgba(255,255,255,0.10);

    --menu-link-hover-bg: rgba(255,255,255,0.10);
    --menu-link-hover-border: rgba(255,255,255,0.16);

    /* active: нежный голубой градиент */
    --menu-active-bg-1: rgba(123,188,255,0.20);
    --menu-active-bg-2: rgba(103,232,249,0.12);
    --menu-active-border: rgba(123,188,255,0.28);

    --shadow-strong: 0 18px 45px rgba(0,0,0,0.45);
    --shadow-soft: 0 10px 30px rgba(15,23,42,0.10);
}

/* =============================
   RESET / BASE
================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

/* ✅ no horizontal scroll */
html { overflow-x: hidden; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #111827;
    overflow-x: hidden;

    /* мягкий зимний фон страницы */
    background:
        radial-gradient(1200px 700px at 18% -10%, rgba(123,188,255,.18), transparent 60%),
        radial-gradient(900px 600px at 85% 10%, rgba(196,181,253,.14), transparent 58%),
        radial-gradient(800px 500px at 40% 120%, rgba(103,232,249,.10), transparent 55%),
        linear-gradient(180deg, #f7fbff 0%, #f3f6ff 60%, #f7fbff 100%);
}

/* lock scroll when sidebar open */
body.sidebar-open {
    overflow: hidden;
    overscroll-behavior: contain;
}

/* =============================
   LAYOUT
================================ */

.admin-wrap {
    min-height: 100vh;
    position: relative;
}

/* лёгкая текстура */
.admin-wrap::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;

    background:
        radial-gradient(900px 520px at 15% 8%, rgba(123,188,255,0.12), transparent 60%),
        radial-gradient(760px 480px at 85% 14%, rgba(103,232,249,0.10), transparent 58%),
        radial-gradient(650px 480px at 55% 88%, rgba(255,213,154,0.08), transparent 55%);
}

/* =============================
   WINTER GARLANDS
================================ */

.winter-garland {
    position: absolute;
    left: 0;
    right: 0;
    height: 44px;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.winter-garland::before {
    content: "";
    position: absolute;
    left: -12px;
    right: -12px;
    top: 18px;
    height: 26px;

    background:
        radial-gradient(40px 18px at 20px 12px, rgba(255,255,255,0.10), transparent 60%) 0 0/120px 26px repeat-x,
        radial-gradient(40px 18px at 80px 18px, rgba(255,255,255,0.08), transparent 60%) 0 0/120px 26px repeat-x;

    opacity: 0.9;
    filter: blur(0.2px);
}

.winter-garland::after {
    content: "";
    position: absolute;
    left: -10px;
    right: -10px;
    top: 2px;
    height: 44px;

    background:
        radial-gradient(circle at 10px 28px, rgba(255,213,154,0.98) 0 3.2px, rgba(255,213,154,0.22) 4px, transparent 10px) 0 0/34px 44px repeat-x,
        radial-gradient(circle at 27px 22px, rgba(134,239,172,0.98) 0 3.1px, rgba(134,239,172,0.20) 4px, transparent 10px) 0 0/34px 44px repeat-x,
        radial-gradient(circle at 44px 29px, rgba(123,188,255,0.98) 0 3.0px, rgba(123,188,255,0.20) 4px, transparent 10px) 0 0/34px 44px repeat-x,
        radial-gradient(circle at 61px 23px, rgba(196,181,253,0.92) 0 2.6px, rgba(196,181,253,0.16) 3.6px, transparent 10px) 0 0/34px 44px repeat-x;

    opacity: 0.92;
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.24));
    animation: garlandTwinkle 4.8s ease-in-out infinite;
}

@keyframes garlandTwinkle {
    0%, 100% { opacity: 0.78; transform: translateY(0); }
    50%      { opacity: 1;    transform: translateY(1px); }
}

.winter-garland--sidebar { top: 4px; opacity: 0.98; }

.winter-garland--topbar {
    top: 0;
    height: 34px;
    opacity: 0.70;
}
.winter-garland--topbar::before { top: 12px; }
.winter-garland--topbar::after  { top: -6px; }

@media (prefers-reduced-motion: reduce) {
    .winter-garland::after { animation: none !important; }
}

/* =============================
   SIDEBAR
================================ */

.admin-sidebar {
    position: fixed;
    z-index: 1040;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);

    /* ✅ нежный голубой "ночной лёд" без чёрной ямы */
    background:
        radial-gradient(1000px 540px at 10% 0%, rgba(123,188,255,0.22), transparent 55%),
        radial-gradient(900px 560px at 90% 10%, rgba(103,232,249,0.16), transparent 58%),
        radial-gradient(800px 520px at 40% 110%, rgba(255,213,154,0.10), transparent 60%),
        linear-gradient(180deg, #0f2044 0%, #0a1530 55%, #070e22 100%);

    padding: 14px 14px 12px;
    color: var(--admin-text);
    display: flex;
    flex-direction: column;

    border-right: 1px solid var(--menu-border);

    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-strong);

    overflow: hidden; /* ✅ */
}

body.sidebar-open .admin-sidebar { transform: translateX(0); }

/* =============================
   WINTER DECOR (inside sidebar)
================================ */

.winter-snow,
.winter-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.winter-snow::before,
.winter-snow::after {
    content: "";
    position: absolute;
    inset: -40px -30px;
    background-repeat: repeat;
    opacity: 0.60;

    background-image:
        radial-gradient(circle, rgba(255,255,255,0.85) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.65) 0 1.5px, transparent 2.6px),
        radial-gradient(circle, rgba(255,255,255,0.40) 0 2px, transparent 3.2px);
    background-size: 120px 120px, 170px 170px, 240px 240px;
    background-position: 0 0, 40px 60px, 20px 120px;

    filter: blur(0.2px);
    transform: translateY(-40px);
    animation: snowFall 12s linear infinite;
}

.winter-snow::after {
    opacity: 0.35;
    background-size: 160px 160px, 220px 220px, 320px 320px;
    background-position: 20px 0, 70px 80px, 40px 160px;
    animation-duration: 18s;
}

@keyframes snowFall {
    from { transform: translateY(-60px); }
    to   { transform: translateY(160px); }
}

.winter-sparkles::before {
    content: "";
    position: absolute;
    inset: -20px;
    background:
        radial-gradient(circle at 18% 22%, rgba(255,255,255,0.22), transparent 22%),
        radial-gradient(circle at 68% 30%, rgba(123,188,255,0.18), transparent 24%),
        radial-gradient(circle at 42% 68%, rgba(103,232,249,0.14), transparent 24%),
        radial-gradient(circle at 82% 78%, rgba(255,213,154,0.12), transparent 28%);
    filter: blur(0.6px);
    opacity: 0.65;
    animation: sparkles 5.6s ease-in-out infinite;
}

@keyframes sparkles {
    0%, 100% { opacity: 0.55; transform: translateY(0); }
    50%      { opacity: 0.80; transform: translateY(2px); }
}

@media (prefers-reduced-motion: reduce) {
    .winter-snow::before,
    .winter-snow::after,
    .winter-sparkles::before { animation: none !important; }
}

/* =============================
   SIDEBAR HEADER
================================ */

.admin-sidebar-header {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    z-index: 3;
}

.admin-sidebar-header::after {
    content: "";
    position: absolute;
    left: -14px;
    right: -14px;
    bottom: -10px;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(123,188,255,0.30),
    rgba(103,232,249,0.22),
    rgba(255,213,154,0.18),
    transparent
    );
    opacity: 0.9;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;

    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,0.70), transparent 45%),
        radial-gradient(circle at 70% 70%, rgba(123,188,255,0.30), transparent 55%),
        linear-gradient(135deg, rgba(123,188,255,0.95), rgba(103,232,249,0.72));

    box-shadow:
        0 10px 22px rgba(0,0,0,0.28),
        inset 0 1px 0 rgba(255,255,255,0.30);

    border: 1px solid rgba(255,255,255,0.18);
}

.admin-brand-logo-letter {
    font-weight: 800;
    font-size: 14px;
    color: rgba(6,10,24,0.92);
    text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}

.admin-brand-title {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0.2px;
    line-height: 1.1;
    color: var(--admin-text);
}

.admin-brand-subtitle {
    font-size: 11px;
    color: var(--admin-text-muted);
    line-height: 1.2;
}

/* =============================
   SIDEBAR NAV
================================ */

.admin-sidebar-divider {
    border-bottom: 1px solid var(--menu-border-2);
    margin: 10px 0 10px;
    z-index: 3;
}

.admin-nav-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    z-index: 3;
}

/* scrollbar */
.admin-nav-scroll::-webkit-scrollbar { width: 8px; }
.admin-nav-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 999px;
}
.admin-nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(210,230,255,0.18);
    border-radius: 999px;
}
.admin-nav-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(210,230,255,0.26);
}

.admin-nav-section-title {
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(238,246,255,0.68);
    margin: 14px 0 7px;
    padding-left: 2px;
}

.admin-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;

    border-radius: 11px;
    padding: 8px 10px;
    margin-bottom: 6px;

    font-size: 13.5px;
    color: var(--admin-text);
    text-decoration: none;

    max-width: 100%;
    overflow: hidden;

    background: var(--menu-link-bg);
    border: 1px solid var(--menu-link-border);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    transition:
        transform .16s ease,
        background .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;
}

/* shimmer */
.admin-nav-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg,
        transparent 0%,
        rgba(255,255,255,0.12) 22%,
        rgba(255,255,255,0.04) 40%,
        transparent 60%);
    transform: translateX(-120%);
    opacity: 0;
    transition: transform .45s ease, opacity .25s ease;
    pointer-events: none;
}

.admin-nav-link:hover {
    background: var(--menu-link-hover-bg);
    border-color: var(--menu-link-hover-border);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.18);
}

.admin-nav-link:hover::after {
    opacity: 1;
    transform: translateX(120%);
}

.admin-nav-link.active {
    background:
        linear-gradient(135deg, var(--menu-active-bg-1), var(--menu-active-bg-2));
    border-color: var(--menu-active-border);
    box-shadow:
        0 14px 24px rgba(0,0,0,0.20),
        inset 0 1px 0 rgba(255,255,255,0.12);
}

/* active indicator */
.admin-nav-link.active::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(123,188,255,0.70));
    filter: drop-shadow(0 0 10px rgba(123,188,255,0.18));
}

.admin-nav-link-icon {
    width: 22px;
    display: inline-flex;
    justify-content: center;
    flex: 0 0 auto;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.22));
}

.admin-nav-link-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =============================
   SIDEBAR FOOTER
================================ */

.admin-sidebar-footer {
    padding-top: 10px;
    border-top: 1px dashed rgba(210,230,255,0.20);
    z-index: 3;
}

#adminLogoutBtn {
    border-radius: 11px;
    border-color: rgba(255,255,255,0.22) !important;
    color: rgba(255,255,255,0.92) !important;

    background:
        linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05)) !important;

    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

#adminLogoutBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(0,0,0,0.22);
    background:
        linear-gradient(135deg, rgba(123,188,255,0.16), rgba(103,232,249,0.10)) !important;
}

#adminLogoutBtn.disabled { opacity: .75; }

/* =============================
   OVERLAY (mobile)
================================ */

.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 24, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 1030;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

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

/* =============================
   MAIN LAYOUT
================================ */

.admin-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* =============================
   TOPBAR
================================ */

.admin-topbar {
    display: flex;
    align-items: center;
    padding: 10px 14px;

    background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.78));
    border-bottom: 1px solid rgba(15,23,42,0.06);

    position: sticky;
    top: 0;
    z-index: 20;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    overflow: hidden;
}

.admin-topbar .winter-garland--topbar {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 0;
}

.admin-topbar > * {
    position: relative;
    z-index: 1;
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-menu-toggle {
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.10);
    background: rgba(249,250,251,0.9);
    padding: 6px 11px;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 10px 18px rgba(15,23,42,0.08);
    transition: transform .16s ease, box-shadow .16s ease;
}

.admin-menu-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(15,23,42,0.12);
}

.admin-topbar-title {
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0.2px;
    margin: 0;
}

.admin-topbar-actions { margin-left: auto; }

/* =============================
   CONTENT
================================ */

.admin-content {
    flex: 1;
    padding: 16px 20px;
}

/* =============================
   DESKTOP
================================ */

@media (min-width: 992px) {
    .admin-sidebar {
        transform: none !important;
        box-shadow: none;
    }
    .admin-main { margin-left: var(--sidebar-w); }
    .admin-overlay { display: none !important; }
    .admin-content { padding: 18px 22px; }
}

/* =============================
   MOBILE
================================ */

@media (max-width: 575.98px) {
    .admin-topbar-title { font-size: 16px; }
    .admin-content { padding: 12px; }
}

.admin-nav-link{
    display:flex;
    align-items:center;
    gap:10px;
}

.admin-nav-link-label{
    flex:1;
    min-width:0;
}

@keyframes mwPulseDot {
    0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(139,92,246,.55); }
    70%  { transform: scale(1.18); box-shadow: 0 0 0 10px rgba(139,92,246,0); }
    100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(139,92,246,0); }
}

.mw-dot{
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-left: 10px;
    background: #8b5cf6; /* фіолетовий */
    box-shadow: 0 0 0 0 rgba(139,92,246,.55);
    animation: mwPulseDot 1.35s ease-out infinite;
}
