/* ============================================
   CHRISTMAS THEME - ParandusApp
   ============================================ */

/* ============================================
   FALLING SNOW
   ============================================ */
.snowfall-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    /* Vaikimisi peidetud - aktiveerub mütsile klõpsates */
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Lumesadu aktiivne */
.snowfall-container.active {
    display: block;
    opacity: 1;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: #fff;
    font-size: 1rem;
    text-shadow: 0 0 3px rgba(255,255,255,0.6);
    user-select: none;
    pointer-events: none;
    opacity: 0;
    /* GPU kiirendus parema jõudluse jaoks */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Iga lumehelves - väga erinevad ajastused, et ei tekiks laineid */
.snowflake:nth-child(1) { left: 2%; font-size: 0.5rem; animation: snow-drift-1 18s linear infinite 0s; }
.snowflake:nth-child(2) { left: 5%; font-size: 0.7rem; animation: snow-drift-2 24s linear infinite 7s; }
.snowflake:nth-child(3) { left: 8%; font-size: 0.45rem; animation: snow-drift-3 21s linear infinite 3s; }
.snowflake:nth-child(4) { left: 11%; font-size: 0.6rem; animation: snow-drift-1 27s linear infinite 15s; }
.snowflake:nth-child(5) { left: 14%; font-size: 0.5rem; animation: snow-drift-2 19s linear infinite 11s; }
.snowflake:nth-child(6) { left: 17%; font-size: 0.65rem; animation: snow-drift-3 23s linear infinite 5s; }
.snowflake:nth-child(7) { left: 20%; font-size: 0.4rem; animation: snow-drift-1 29s linear infinite 19s; }
.snowflake:nth-child(8) { left: 23%; font-size: 0.55rem; animation: snow-drift-2 20s linear infinite 9s; }
.snowflake:nth-child(9) { left: 26%; font-size: 0.5rem; animation: snow-drift-3 26s linear infinite 1s; }
.snowflake:nth-child(10) { left: 29%; font-size: 0.6rem; animation: snow-drift-1 22s linear infinite 13s; }
.snowflake:nth-child(11) { left: 32%; font-size: 0.45rem; animation: snow-drift-2 28s linear infinite 17s; }
.snowflake:nth-child(12) { left: 35%; font-size: 0.55rem; animation: snow-drift-3 17s linear infinite 6s; }
.snowflake:nth-child(13) { left: 38%; font-size: 0.6rem; animation: snow-drift-1 25s linear infinite 21s; }
.snowflake:nth-child(14) { left: 41%; font-size: 0.5rem; animation: snow-drift-2 21s linear infinite 2s; }
.snowflake:nth-child(15) { left: 44%; font-size: 0.35rem; animation: snow-drift-3 30s linear infinite 12s; }
.snowflake:nth-child(16) { left: 47%; font-size: 0.55rem; animation: snow-drift-1 19s linear infinite 8s; }
.snowflake:nth-child(17) { left: 50%; font-size: 0.5rem; animation: snow-drift-2 24s linear infinite 16s; }
.snowflake:nth-child(18) { left: 53%; font-size: 0.65rem; animation: snow-drift-3 22s linear infinite 4s; }
.snowflake:nth-child(19) { left: 56%; font-size: 0.45rem; animation: snow-drift-1 26s linear infinite 10s; }
.snowflake:nth-child(20) { left: 59%; font-size: 0.55rem; animation: snow-drift-2 20s linear infinite 14s; }
.snowflake:nth-child(21) { left: 62%; font-size: 0.5rem; animation: snow-drift-3 23s linear infinite 0.5s; }
.snowflake:nth-child(22) { left: 65%; font-size: 0.6rem; animation: snow-drift-1 19s linear infinite 8.5s; }
.snowflake:nth-child(23) { left: 68%; font-size: 0.4rem; animation: snow-drift-2 27s linear infinite 3.5s; }
.snowflake:nth-child(24) { left: 71%; font-size: 0.55rem; animation: snow-drift-3 21s linear infinite 12.5s; }
.snowflake:nth-child(25) { left: 74%; font-size: 0.5rem; animation: snow-drift-1 25s linear infinite 6.5s; }
.snowflake:nth-child(26) { left: 77%; font-size: 0.65rem; animation: snow-drift-2 18s linear infinite 18s; }
.snowflake:nth-child(27) { left: 80%; font-size: 0.45rem; animation: snow-drift-3 28s linear infinite 1.5s; }
.snowflake:nth-child(28) { left: 83%; font-size: 0.55rem; animation: snow-drift-1 22s linear infinite 10.5s; }
.snowflake:nth-child(29) { left: 86%; font-size: 0.5rem; animation: snow-drift-2 26s linear infinite 5.5s; }
.snowflake:nth-child(30) { left: 89%; font-size: 0.6rem; animation: snow-drift-3 20s linear infinite 15.5s; }
.snowflake:nth-child(31) { left: 92%; font-size: 0.4rem; animation: snow-drift-1 24s linear infinite 2.5s; }
.snowflake:nth-child(32) { left: 95%; font-size: 0.55rem; animation: snow-drift-2 29s linear infinite 9.5s; }
.snowflake:nth-child(33) { left: 98%; font-size: 0.5rem; animation: snow-drift-3 19s linear infinite 13.5s; }
.snowflake:nth-child(34) { left: 4%; font-size: 0.6rem; animation: snow-drift-1 23s linear infinite 7.5s; }
.snowflake:nth-child(35) { left: 16%; font-size: 0.45rem; animation: snow-drift-2 27s linear infinite 4.5s; }
.snowflake:nth-child(36) { left: 31%; font-size: 0.55rem; animation: snow-drift-3 21s linear infinite 11.5s; }
.snowflake:nth-child(37) { left: 46%; font-size: 0.5rem; animation: snow-drift-1 25s linear infinite 16.5s; }
.snowflake:nth-child(38) { left: 61%; font-size: 0.6rem; animation: snow-drift-2 20s linear infinite 0.8s; }
.snowflake:nth-child(39) { left: 76%; font-size: 0.4rem; animation: snow-drift-3 28s linear infinite 6.8s; }
.snowflake:nth-child(40) { left: 91%; font-size: 0.55rem; animation: snow-drift-1 22s linear infinite 14.8s; }

/* Loomulik lumesadu - kerge tuul vasakule */
@keyframes snow-drift-1 {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    25% {
        transform: translateY(25vh) translateX(-15px) rotate(90deg);
    }
    50% {
        transform: translateY(50vh) translateX(10px) rotate(180deg);
    }
    75% {
        transform: translateY(75vh) translateX(-20px) rotate(270deg);
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(105vh) translateX(-10px) rotate(360deg);
        opacity: 0;
    }
}

/* Loomulik lumesadu - kerge tuul paremale */
@keyframes snow-drift-2 {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    20% {
        transform: translateY(20vh) translateX(20px) rotate(60deg);
    }
    40% {
        transform: translateY(40vh) translateX(5px) rotate(120deg);
    }
    60% {
        transform: translateY(60vh) translateX(25px) rotate(200deg);
    }
    80% {
        transform: translateY(80vh) translateX(10px) rotate(280deg);
    }
    95% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(105vh) translateX(15px) rotate(360deg);
        opacity: 0;
    }
}

/* Loomulik lumesadu - kõikuv */
@keyframes snow-drift-3 {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.75;
    }
    15% {
        transform: translateY(15vh) translateX(-25px) rotate(45deg);
    }
    30% {
        transform: translateY(30vh) translateX(15px) rotate(100deg);
    }
    45% {
        transform: translateY(45vh) translateX(-20px) rotate(160deg);
    }
    60% {
        transform: translateY(60vh) translateX(20px) rotate(220deg);
    }
    75% {
        transform: translateY(75vh) translateX(-15px) rotate(280deg);
    }
    90% {
        transform: translateY(90vh) translateX(10px) rotate(330deg);
    }
    95% {
        opacity: 0.55;
    }
    100% {
        transform: translateY(105vh) translateX(-5px) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================
   SANTA HAT - On user avatar
   ============================================ */

/* User avatar needs relative positioning */
.user-avatar {
    position: relative !important;
}

/* Santa hat button wrapper */
.avatar-santa-hat-btn {
    position: absolute !important;
    top: -18px !important;
    right: -12px !important;
    z-index: 10 !important;
    cursor: pointer;
    outline: none;
}

.avatar-santa-hat-btn:focus-visible {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Santa hat on avatar - KLÕPSATAV */
.avatar-santa-hat {
    width: 32px;
    height: auto;
    transform: rotate(20deg);
    pointer-events: none;
    transition: transform 0.2s ease, filter 0.2s ease;
}

/* Hover efekt - müts liigub */
.avatar-santa-hat-btn:hover .avatar-santa-hat {
    transform: rotate(30deg) scale(1.2);
}

/* Aktiivne olek - kui lumi sajab */
.avatar-santa-hat-btn.snow-active .avatar-santa-hat {
    animation: hat-wiggle 0.5s ease;
}

@keyframes hat-wiggle {
    0%, 100% { transform: rotate(20deg); }
    25% { transform: rotate(30deg); }
    50% { transform: rotate(15deg); }
    75% { transform: rotate(25deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .avatar-santa-hat-btn {
        top: -10px !important;
        right: -6px !important;
    }

    .avatar-santa-hat {
        width: 24px;
    }

    /* Näita ainult 14 lumehelvest tahvlil, levitatud üle ekraani */
    .snowflake:nth-child(n+15) {
        display: none;
    }

    /* Ümberjaotamine laiemalt ekraanile */
    .snowflake:nth-child(1) { left: 5% !important; }
    .snowflake:nth-child(2) { left: 15% !important; }
    .snowflake:nth-child(3) { left: 25% !important; }
    .snowflake:nth-child(4) { left: 35% !important; }
    .snowflake:nth-child(5) { left: 45% !important; }
    .snowflake:nth-child(6) { left: 55% !important; }
    .snowflake:nth-child(7) { left: 65% !important; }
    .snowflake:nth-child(8) { left: 75% !important; }
    .snowflake:nth-child(9) { left: 85% !important; }
    .snowflake:nth-child(10) { left: 95% !important; }
    .snowflake:nth-child(11) { left: 10% !important; }
    .snowflake:nth-child(12) { left: 30% !important; }
    .snowflake:nth-child(13) { left: 50% !important; }
    .snowflake:nth-child(14) { left: 70% !important; }
}

@media (max-width: 576px) {
    /* Mütsi positsioon telefonil */
    .avatar-santa-hat-btn {
        top: -12px !important;
        right: -4px !important;
    }

    .avatar-santa-hat {
        width: 22px;
    }

    /* Telefonil ainult 7 lumehelvest, ühtlaselt jaotatud */
    .snowflake:nth-child(n+8) {
        display: none;
    }

    .snowflake:nth-child(1) { left: 8% !important; }
    .snowflake:nth-child(2) { left: 22% !important; }
    .snowflake:nth-child(3) { left: 36% !important; }
    .snowflake:nth-child(4) { left: 50% !important; }
    .snowflake:nth-child(5) { left: 64% !important; }
    .snowflake:nth-child(6) { left: 78% !important; }
    .snowflake:nth-child(7) { left: 92% !important; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .snowflake {
        animation: none !important;
        display: none;
    }

    .snowfall-container {
        display: none;
    }
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] .snowflake {
    text-shadow: 0 0 6px rgba(255,255,255,0.6);
}

/* ============================================
   CHRISTMAS GREETING TOAST - Premium Design
   ============================================ */
.christmas-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-150px) scale(0.9);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.4s ease;
}

.christmas-toast.show {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Põhikonteiner - klaasefekt tumerohelisel taustal */
.christmas-toast-card {
    position: relative;
    background: linear-gradient(145deg,
        rgba(20, 60, 40, 0.95) 0%,
        rgba(15, 45, 30, 0.98) 50%,
        rgba(25, 55, 35, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    overflow: hidden;
}

/* Kuldne ülemine äär */
.christmas-toast-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.8) 20%,
        rgba(255, 215, 0, 1) 50%,
        rgba(212, 175, 55, 0.8) 80%,
        transparent 100%);
    border-radius: 2px;
}

/* Dekoratiivne sädelus nurgas */
.christmas-toast-card::after {
    content: '✦';
    position: absolute;
    top: 8px;
    right: 50px;
    font-size: 0.6rem;
    color: rgba(255, 215, 0, 0.6);
    animation: toast-sparkle 2s ease-in-out infinite;
}

@keyframes toast-sparkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Ikoon - kuusk kuldses ringis */
.christmas-toast-icon {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg,
        rgba(212, 175, 55, 0.2) 0%,
        rgba(212, 175, 55, 0.1) 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    font-size: 1.5rem;
    flex-shrink: 0;
    animation: toast-icon-glow 3s ease-in-out infinite;
}

@keyframes toast-icon-glow {
    0%, 100% {
        box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    }
}

/* Tekstiosa */
.christmas-toast-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.christmas-toast-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(212, 175, 55, 0.9);
    margin: 0;
}

.christmas-toast-message {
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Sulgemise nupp - elegantne X */
.christmas-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.christmas-toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    transform: rotate(90deg);
}

/* Dekoratiivsed lumehelbed taustal */
.christmas-toast-snow {
    position: absolute;
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.christmas-toast-snow:nth-child(1) { top: 30%; left: 8%; animation: toast-snow-float 4s ease-in-out infinite 0s; }
.christmas-toast-snow:nth-child(2) { top: 60%; right: 15%; animation: toast-snow-float 5s ease-in-out infinite 1s; }
.christmas-toast-snow:nth-child(3) { bottom: 20%; left: 20%; animation: toast-snow-float 4.5s ease-in-out infinite 0.5s; }

@keyframes toast-snow-float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.15; }
    50% { transform: translateY(-5px) rotate(180deg); opacity: 0.3; }
}

/* Mobiilivaade */
@media (max-width: 576px) {
    .christmas-toast {
        top: 12px;
        left: 12px;
        right: 12px;
        transform: translateX(0) translateY(-150px) scale(0.9);
    }

    .christmas-toast.show {
        transform: translateX(0) translateY(0) scale(1);
    }

    .christmas-toast-card {
        padding: 16px 20px;
        gap: 12px;
    }

    .christmas-toast-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .christmas-toast-message {
        font-size: 0.95rem;
    }

    .christmas-toast-close {
        top: 6px;
        right: 6px;
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   SPARKLING LOGO - Christmas Edition
   ============================================ */

.sidebar-header {
    position: relative;
}

.sidebar-brand {
    position: relative;
}

/* Kuldne pulseeriv kuma logo ümber */
.sidebar-brand img {
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.3));
    animation: logo-glow 4s ease-in-out infinite;
}

@keyframes logo-glow {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.25));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
    }
}

.sidebar-brand:hover img {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.7));
    animation: none;
}

/* Kolm tähte erinevates kohtades - erinevad ajastused */
.sidebar-brand::before {
    content: '✦';
    position: absolute;
    top: 5px;
    left: 42px;
    font-size: 0.4rem;
    color: #ffd700;
    animation: star-float-1 6s ease-in-out infinite;
    pointer-events: none;
}

.sidebar-brand::after {
    content: '✦';
    position: absolute;
    bottom: 5px;
    left: 35px;
    font-size: 0.35rem;
    color: #ffd700;
    animation: star-float-2 7s ease-in-out infinite 2s;
    pointer-events: none;
}

.sidebar-header::before {
    content: '✦';
    position: absolute;
    top: 28px;
    left: 55px;
    font-size: 0.3rem;
    color: #ffd700;
    animation: star-float-3 5s ease-in-out infinite 1s;
    pointer-events: none;
    z-index: 5;
}

/* Peened ujuvad animatsioonid - mitte vilkumine, vaid sujuv liikumine */
@keyframes star-float-1 {
    0%, 100% {
        opacity: 0.6;
        transform: translateY(0) scale(1);
    }
    25% {
        opacity: 0.9;
        transform: translateY(-2px) scale(1.1);
    }
    50% {
        opacity: 0.7;
        transform: translateY(1px) scale(0.95);
    }
    75% {
        opacity: 1;
        transform: translateY(-1px) scale(1.05);
    }
}

@keyframes star-float-2 {
    0%, 100% {
        opacity: 0.5;
        transform: translateY(0) translateX(0);
    }
    33% {
        opacity: 0.85;
        transform: translateY(-2px) translateX(1px);
    }
    66% {
        opacity: 0.65;
        transform: translateY(1px) translateX(-1px);
    }
}

@keyframes star-float-3 {
    0%, 100% {
        opacity: 0.55;
        transform: scale(1);
    }
    40% {
        opacity: 0.95;
        transform: scale(1.15);
    }
    70% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

/* Collapsed sidebar - peida tähed */
.sidebar.collapsed .sidebar-brand::before,
.sidebar.collapsed .sidebar-brand::after,
.sidebar.collapsed .sidebar-header::before {
    display: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sidebar-brand img {
        animation: none;
        filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.35));
    }

    .sidebar-brand::before,
    .sidebar-brand::after,
    .sidebar-header::before {
        animation: none;
        opacity: 0.7;
    }
}

/* Mobiil */
@media (max-width: 768px) {
    .sidebar-brand::before {
        left: 36px;
        font-size: 0.35rem;
    }

    .sidebar-brand::after {
        left: 30px;
        font-size: 0.3rem;
    }

    .sidebar-header::before {
        left: 45px;
        font-size: 0.25rem;
    }
}
