/* ============================================
   Page Background Image (blurred ambient fill)
   ============================================ */
.page-background {
    position: fixed;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0a0a12;
    filter: blur(30px) brightness(0.7);
    opacity: 0;
    transition: opacity 1s ease;
}

.page-background.active {
    opacity: 0.3;
}

/* ============================================
   Screensaver
   ============================================ */
.screensaver {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    cursor: pointer;
}

.screensaver.active {
    opacity: 1;
    visibility: visible;
}

.screensaver-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000;
    opacity: 0;
    transition: opacity 1.5s ease;
}

/* Blurred background fill layer (behind sharp image) */
.screensaver-bg::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(30px) brightness(0.5);
}

/* Sharp image layer (on top, contained/centered) */
.screensaver-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: inherit;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.screensaver-bg.active {
    opacity: 1;
}

.screensaver-clock {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    text-align: right;
    z-index: 10;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.screensaver-time {
    font-size: 6rem;
    font-weight: 300;
    color: #fff;
    line-height: 1;
    letter-spacing: -2px;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.6);
    paint-order: stroke fill;
    text-shadow:
        -1px -1px 0 rgba(0, 0, 0, 0.5),
         1px -1px 0 rgba(0, 0, 0, 0.5),
        -1px  1px 0 rgba(0, 0, 0, 0.5),
         1px  1px 0 rgba(0, 0, 0, 0.5),
         2px  2px 8px rgba(0, 0, 0, 0.8);
}

.screensaver-date {
    font-size: 1.5rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.5rem;
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.5);
    paint-order: stroke fill;
    text-shadow:
        -1px -1px 0 rgba(0, 0, 0, 0.4),
         1px -1px 0 rgba(0, 0, 0, 0.4),
        -1px  1px 0 rgba(0, 0, 0, 0.4),
         1px  1px 0 rgba(0, 0, 0, 0.4);
}

/* Screensaver Spotify Display */
.screensaver-spotify {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 400px;
}

.screensaver-spotify-icon {
    width: 24px;
    height: 24px;
    filter: invert(65%) sepia(72%) saturate(520%) hue-rotate(80deg) brightness(95%);
    flex-shrink: 0;
}

.screensaver-spotify-art {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a2e;
    flex-shrink: 0;
}

.screensaver-spotify-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screensaver-spotify-info {
    flex: 1;
    min-width: 0;
}

.screensaver-spotify-track {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screensaver-spotify-artist {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive screensaver for tablets/kiosks */
@media (max-width: 1200px) {
    .screensaver-time {
        font-size: 5rem;
    }

    .screensaver-date {
        font-size: 1.25rem;
    }

    .screensaver-clock {
        bottom: 2rem;
        right: 2rem;
    }
}

@media (max-width: 768px) {
    .screensaver-time {
        font-size: 4rem;
    }

    .screensaver-date {
        font-size: 1rem;
    }

    .screensaver-clock {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .screensaver-spotify {
        bottom: 1.5rem;
        left: 1.5rem;
        max-width: calc(100% - 3rem);
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }

    .screensaver-spotify-art {
        width: 44px;
        height: 44px;
    }

    .screensaver-spotify-track {
        font-size: 0.95rem;
    }

    .screensaver-spotify-artist {
        font-size: 0.8rem;
    }
}
