/* =====================================================================
 * PM Christmas / Snow Animation — anim-natal.css
 * Snow overlay (global) + [pm_natal] section + floating music player
 * ===================================================================== */

/* ── Snow overlay canvas (global) ────────────────────────────── */
#pm-snow-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9990;
    overflow: hidden;
}

.pm-snowflake {
    position: absolute;
    top: -12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    pointer-events: none;
    will-change: transform, opacity;
    filter: blur(0.5px);
    animation: pmSnowFall var(--sf-dur, 8s) var(--sf-delay, 0s) linear infinite;
}

@keyframes pmSnowFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    5%  { opacity: var(--sf-op, 0.85); }
    95% { opacity: var(--sf-op, 0.85); }
    100% {
        transform: translateY(105vh) translateX(var(--sf-drift, 30px)) rotate(360deg);
        opacity: 0;
    }
}

/* ── [pm_natal] section ───────────────────────────────────────── */
.pm-natal-section {
    position: relative;
    width: 100%;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    margin: 0 auto 2.5rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(180, 20, 20, 0.4) 0%, transparent 60%),
        linear-gradient(180deg, #0c1f0c 0%, #0a2a0a 40%, #071507 100%);
    box-shadow: 0 8px 48px rgba(0,0,0,0.7), 0 0 80px rgba(180,20,20,0.2);
}

/* Stars in the Christmas sky */
.pm-natal-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 10% 20%, rgba(255,255,200,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 20% 12%, rgba(255,255,200,0.7) 0%, transparent 100%),
        radial-gradient(2px 2px at 35% 8%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 15%, rgba(255,255,200,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 70% 10%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 18%, rgba(255,255,200,0.7) 0%, transparent 100%),
        radial-gradient(2px 2px at 90% 8%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 5%, rgba(255,255,200,0.85) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 25% 25%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 62% 22%, rgba(255,255,200,0.7) 0%, transparent 100%),
        radial-gradient(2px 2px at 5%  30%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 92% 28%, rgba(255,255,200,0.65) 0%, transparent 100%);
    pointer-events: none;
    animation: pmStarPulse 3s ease-in-out infinite alternate;
}

@keyframes pmStarPulse {
    from { opacity: 0.7; }
    to   { opacity: 1.0; }
}

/* Ground snow at bottom */
.pm-natal-section::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(0deg, rgba(255,255,255,0.12) 0%, transparent 100%);
    border-radius: 0 0 12px 12px;
    pointer-events: none;
}

/* ── Christmas Tree SVG container ─────────────────────────────── */
.pm-natal-tree-wrap {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(280px, 50vw);
    opacity: 0.9;
}

.pm-natal-tree-wrap svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 200, 80, 0.5));
}

/* Tree lights twinkling */
.pm-natal-light {
    animation: pmLightBlink var(--lt-dur, 1.2s) var(--lt-delay, 0s) ease-in-out infinite alternate;
}

@keyframes pmLightBlink {
    from { opacity: 0.3; filter: brightness(0.5); }
    to   { opacity: 1.0; filter: brightness(2.0) drop-shadow(0 0 4px currentColor); }
}

/* ── Content area ─────────────────────────────────────────────── */
.pm-natal-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem 2rem 8rem;
    max-width: 680px;
}

/* Star above title */
.pm-natal-star {
    display: block;
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    animation: pmStarSpin 8s linear infinite;
    filter: drop-shadow(0 0 12px rgba(255, 220, 0, 0.8));
}

@keyframes pmStarSpin {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.pm-natal-title {
    font-family: 'Bebas Neue', 'Montserrat', sans-serif !important;
    font-size: clamp(2.5rem, 8vw, 5rem) !important;
    font-weight: 900 !important;
    color: #fff !important;
    letter-spacing: 4px !important;
    text-shadow: 0 0 30px rgba(255,80,80,0.8), 0 0 60px rgba(255,80,80,0.4) !important;
    margin: 0 0 0.5rem !important;
    line-height: 1.1 !important;
}

.pm-natal-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.95rem, 2.5vw, 1.3rem);
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 2px;
    margin: 0 0 1.5rem;
    text-transform: uppercase;
}

.pm-natal-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    font-family: 'Bebas Neue', 'Montserrat', sans-serif;
    font-size: 1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(192,57,43,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pm-natal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(192,57,43,0.7);
    color: #fff;
}

/* ── Floating Christmas music player ─────────────────────────── */
#pm-natal-player {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: rgba(10, 30, 10, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,80,80,0.2);
    min-width: 200px;
    max-width: 260px;
    animation: pmPlayerSlideIn 0.5s 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pmPlayerSlideIn {
    from { transform: translateY(80px) scale(0.9); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

#pm-natal-player.pm-player--minimized {
    min-width: 0;
    padding: 10px 14px;
}

#pm-natal-player.pm-player--minimized .pm-player-track,
#pm-natal-player.pm-player--minimized .pm-player-vol-wrap {
    display: none;
}

.pm-player-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    animation: pmSnowIconPulse 2s ease-in-out infinite alternate;
    line-height: 1;
}

@keyframes pmSnowIconPulse {
    from { transform: scale(1) rotate(-5deg); }
    to   { transform: scale(1.1) rotate(5deg); }
}

.pm-player-body {
    flex: 1;
    min-width: 0;
}

.pm-player-track {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pm-player-track-dot {
    display: inline-block;
    width: 5px; height: 5px;
    background: #e74c3c;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pmTrackDot 1s ease-in-out infinite alternate;
}

@keyframes pmTrackDot {
    from { opacity: 0.4; }
    to   { opacity: 1; }
}

.pm-player-vol-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pm-player-vol-icon {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    flex-shrink: 0;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.pm-player-vol {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(to right, #e74c3c var(--vol-pct, 70%), rgba(255,255,255,0.2) var(--vol-pct, 70%));
    outline: none;
    cursor: pointer;
}

.pm-player-vol::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 4px rgba(255,255,255,0.5);
    cursor: pointer;
}

.pm-player-vol::-moz-range-thumb {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

.pm-player-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pm-player-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    padding: 4px;
    line-height: 1;
    font-size: 1rem;
    transition: color 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
}

.pm-player-btn:hover { color: #fff; transform: scale(1.15); }

.pm-player-btn--play {
    background: rgba(231,76,60,0.9);
    border-radius: 50%;
    width: 32px; height: 32px;
    color: #fff;
    font-size: 0.9rem;
    justify-content: center;
}

.pm-player-btn--play:hover { background: #e74c3c; transform: scale(1.1); }

.pm-player-btn--min {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}

/* ── Autoplay prompt banner ───────────────────────────────────── */
#pm-autoplay-prompt {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(10, 30, 10, 0.95);
    border: 1px solid rgba(231,76,60,0.4);
    border-radius: 50px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    z-index: 9998;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
    opacity: 0;
}

#pm-autoplay-prompt.pm-prompt--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#pm-autoplay-prompt:hover { background: rgba(20, 50, 20, 0.98); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    #pm-natal-player { right: 12px; bottom: 12px; min-width: 160px; }
    .pm-natal-content { padding: 2rem 1rem 6rem; }
    .pm-natal-tree-wrap { width: min(220px, 60vw); }
}

@media (prefers-reduced-motion: reduce) {
    .pm-snowflake         { animation: none; opacity: 0; }
    .pm-natal-star        { animation: none; }
    .pm-natal-light       { animation: none; opacity: 1; }
    .pm-natal-section::before { animation: none; }
    .pm-player-track-dot  { animation: none; opacity: 1; }
    #pm-natal-player      { animation: none; }
}
