/* Smooth transitions for Dream Mode elements */
body.dream-mode * {
    transition: all 1s ease !important;
}

/* Pre-Dream Mode black overlay */
#dream-pre-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,1);
    z-index: 9998;
    opacity: 0;
    display: none;
    transition: opacity 5s linear;
}

/* Full-screen Dream Mode overlay with fade-in */
body.dream-mode .dream-circle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(circle at center, rgba(255,255,255,0) 150px, rgba(0,0,0,0.98) 100%);
    opacity: 0;
    transition: opacity 5s linear;
}

/* Dream particles */
body.dream-mode .dream-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: #fff;
    opacity: 0.6;
    width: 5px;  /* JS overrides */
    height: 5px;
    animation: floatParticle 8s infinite ease-in-out;
}

@keyframes floatParticle {
    0% { transform: translate(0,0) scale(1); opacity:0.5; }
    50% { transform: translate(20px,-30px) scale(1.3); opacity:1; }
    100% { transform: translate(-15px,10px) scale(1); opacity:0.5; }
}

/* Sweet Dreams message centered (mobile + desktop) */
#dream-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 1s linear;
    max-width: 90%;
    word-wrap: break-word;
}

#dream-message .alarm-icon {
    margin-right: 10px;
}

/* Remove any shadows from overlay and particles */
#dream-overlay,
.dream-particles {
    box-shadow: none !important;
    filter: none !important;
}

/* Floating circular countdown */
#dream-countdown {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    z-index: 10001;
    pointer-events: none;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8em;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    opacity: 0; /* start hidden, JS will fade in */
    transition: opacity 1s linear;
}

/* Countdown SVG */
#dream-countdown svg {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
}

#dream-countdown circle {
    fill: none;
    stroke-width: 4;
}

#dream-countdown circle.bg {
    stroke: rgba(255,255,255,0.2);
}

#dream-countdown circle.progress {
    stroke: #fff;
    stroke-linecap: round;
    stroke-dasharray: 157; /* 2 * PI * r (r=25) */
    stroke-dashoffset: 157;
    transition: stroke-dashoffset 1s linear;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #dream-message {
        font-size: 1.5em;
        max-width: 95%;
    }
}
