/* Player Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

.player-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.player-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    position: relative;
    overflow: hidden;
}

/* Content Renderers */
.player-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: contentIn 0.5s ease-out;
}

@keyframes contentIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.player-content.exit {
    animation: contentOut 0.5s ease-out;
}

@keyframes contentOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Video Player */
.player-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

/* Photo Display */
.player-photo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}

/* Widget Display */
.player-widget {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000000;
}

/* Maintenance Mode */
.maintenance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: overlayFadeIn 0.3s ease-out;
}

.maintenance-overlay.active {
    display: flex;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.maintenance-message {
    text-align: center;
    padding: 40px;
}

.maintenance-text {
    font-size: 48px;
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.widget-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Screensaver */
.screensaver {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
}

.screensaver-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    animation: screensaverAnim 3s ease-in-out infinite;
}

@keyframes screensaverAnim {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.screensaver-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0.5;
}

.screensaver-text {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Network Quality Indicator */
.network-quality {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.network-quality.poor {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.network-quality.fair {
    background: rgba(251, 146, 60, 0.3);
    color: #fed7aa;
}

.network-quality.good {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Buffering Indicator */
.buffering-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 200;
}

.buffering-indicator.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(74, 144, 226, 0.2);
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.buffering-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Loading Bar */
.loading-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #4a90e2, #357abd);
    animation: loading 0.3s ease-out;
}

@keyframes loading {
    from {
        width: 0%;
    }
}

/* Responsive */
@media (max-width: 1920px) {
    .screensaver-text {
        font-size: 36px;
    }
}

@media (max-width: 1280px) {
    .screensaver-text {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .screensaver-text {
        font-size: 18px;
    }
}

/* Black Screen (Off-hours) */
.black-screen {
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.black-screen-text {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.3);
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* No Content */
.no-content {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

.no-content-icon {
    font-size: 72px;
    opacity: 0.5;
}

.no-content-text {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Animation: Page swap effect */
.page-swap-enter {
    animation: pageSwapEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pageSwapEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.page-swap-exit {
    animation: pageSwapExit 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes pageSwapExit {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
}
