/* DEPLOYMENT: 5d81978 (04-12-2025 12:06:23) */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1e51;
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
}

/* Hide mouse cursor in player state */
body.player-hide-cursor {
    cursor: none !important;
}

/* App Container */
#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Screen States */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Container */
.container {
    max-width: 500px;
    width: 90%;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Player State Styles */
#player-screen {
    background: #000;
    overflow: hidden;
}

#player-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-item {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.content-item.active {
    opacity: 1;
}

.content-video,
.content-iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.content-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-web {
    width: 100%;
    height: 100%;
    border: none;
}

.content-app {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

/* Player loading overlay */
#player-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
}

#player-loading-overlay.hidden {
    display: none;
}

/* Player debug info */
#player-debug-info {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 999;
    display: none;
}

#player-debug-info.show {
    display: block;
}

/* Logo */
.logo-image {
    max-width: 200px;
    height: auto;
    margin-bottom: 16px;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.logo p {
    color: #b4b8ff;
    font-size: 1rem;
    margin-bottom: 30px;
}

/* Pairing Sections */
.pairing-section {
    display: block;
}

.pairing-section.hidden {
    display: none;
}

.pairing-section h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: #fff;
}

.pairing-section p {
    color: #b4b8ff;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 200px;
}

.btn-primary {
    background: #4753e0;
    color: white;
    box-shadow: 0 4px 15px rgba(71, 83, 224, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(71, 83, 224, 0.6);
    background: #3d47cc;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Pairing Code */
.pairing-code {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.5rem;
    color: #fff;
    background: rgba(71, 83, 224, 0.2);
    border: 3px solid #4753e0;
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Pairing Instructions */
.pairing-instructions {
    font-size: 0.9rem;
    color: #b4b8ff;
    margin-bottom: 16px;
}

/* Success States - NEW */
.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.success-details {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.success-details p {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #e5e7eb;
}

.success-details strong {
    color: #fff;
    font-weight: 600;
}

.status-paired {
    color: #22c55e;
    font-weight: 600;
}

.status-active {
    color: #3b82f6;
    font-weight: 600;
}

.loading-info {
    font-size: 0.9rem;
    color: #b4b8ff;
    margin-top: 16px;
}

.status-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.status-info p {
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #e5e7eb;
}

/* Device Info */
.device-info {
    font-size: 0.8rem;
    color: #b4b8ff;
    margin-top: 20px;
    font-family: 'SF Mono', Monaco, monospace;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: #4753e0;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-status {
    font-size: 0.9rem;
    color: #b4b8ff;
}

/* Spinners */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #4753e0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.spinner.small {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

#error-message {
    color: #ff6b6b;
    margin-bottom: 24px;
}

/* Status Messages */
.status {
    color: #b4b8ff;
    font-size: 0.9rem;
    margin-top: 16px;
}

/* Connection Status */
.connection-status.online {
    color: #51cf66;
}

.connection-status.offline {
    color: #ff6b6b;
}

.connection-status.paired {
    color: #22c55e;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .pairing-code {
        font-size: 2rem;
        letter-spacing: 0.3rem;
        padding: 16px;
    }
    
    .btn {
        min-width: 160px;
        padding: 14px 24px;
    }
    
    .success-details, .status-info {
        padding: 16px;
    }
}

/* Landscape orientation for mobile */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        max-width: 600px;
        padding: 20px;
    }
    
    .logo {
        margin-bottom: 20px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .pairing-code {
        font-size: 1.8rem;
        padding: 16px;
        margin: 16px 0;
    }
    
    .success-icon {
        font-size: 3rem;
        margin-bottom: 16px;
    }
}

/* Hide elements during loading */
.loading #pairing-screen,
.loading #error-screen {
    pointer-events: none;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .screen {
        transition: opacity 0.3s ease;
        transform: none;
    }
    
    .spinner {
        animation: none;
        border-top-color: #4753e0;
    }
    
    .success-icon {
        animation: none;
    }
}

/* Success feedback animations */
.pairing-success-section {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status transitions */
.pairing-section {
    transition: all 0.3s ease-in-out;
}

.pairing-section.hidden {
    opacity: 0;
    transform: translateY(-10px);
}

/* Connection indicator improvements */
.connection-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.connection-status.online {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.connection-status.offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.connection-status.paired {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* PROFESSIONAL DEBUG OVERLAY - MINIMALIST MODERN DESIGN */
.debug-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: 12px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 12px;
    color: #ffffff;
    z-index: 9999;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 320px;
    max-width: 400px;
    line-height: 1.5;
}

.debug-overlay.show {
    display: block;
    animation: debugFadeIn 0.3s ease-out;
}

@keyframes debugFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Debug content styling */
.debug-overlay h3 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-overlay .debug-section {
    margin-bottom: 12px;
}

.debug-overlay .debug-section:last-child {
    margin-bottom: 0;
}

.debug-overlay .debug-label {
    color: #a0a0a0;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.debug-overlay .debug-value {
    color: #ffffff;
    font-size: 12px;
    font-weight: 400;
    word-break: break-all;
}

.debug-overlay .debug-status-good {
    color: #22c55e;
}

.debug-overlay .debug-status-bad {
    color: #ef4444;
}

.debug-overlay .debug-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.debug-overlay .debug-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Responsive for smaller screens */
@media (max-width: 640px) {
    .debug-overlay {
        bottom: 10px;
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
        font-size: 11px;
    }
    
    .debug-overlay .debug-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.content-audio {
    display: none; /* Audio element hidden, wrapper provides visual */
}

/* === SEAMLESS CONTENT TRANSITIONS STYLING === */

/* Download Progress */
.download-overlay-subtle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 16px;
    z-index: 1500;
    opacity: 1;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.download-overlay-subtle.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.download-content-subtle {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.download-icon {
    font-size: 20px;
    animation: downloadBounce 2s ease-in-out infinite;
}

@keyframes downloadBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.download-text {
    flex: 1;
    min-width: 0;
}

.download-message {
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-progress-mini {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.download-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #22c55e);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.download-percentage {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .download-overlay-subtle {
        bottom: 15px;
        right: 15px;
        max-width: 220px;
        padding: 10px 12px;
    }
    
    .download-message {
        font-size: 11px;
    }
    
    .download-percentage {
        font-size: 9px;
    }
}

/* Enhanced Content Item Transitions - No crossfade */
.content-item {
    /* No transition - hard cuts only */
}

.content-item.transitioning {
    opacity: 0.5;
}

/* Hard transition support - no crossfade */
.content-crossfade {
    /* No transition animations */
}

.content-crossfade.fade-out {
    opacity: 0;
}

.content-crossfade.fade-in {
    opacity: 1;
}

/* Seamless Transition Effects */
.seamless-transition {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.seamless-transition.entering {
    opacity: 0;
    transform: scale(0.95);
}

.seamless-transition.entered {
    opacity: 1;
    transform: scale(1);
}

.seamless-transition.exiting {
    opacity: 0;
    transform: scale(1.05);
}

/* Enhanced Loading States */
.content-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.1rem;
    z-index: 10;
}

.content-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: contentLoadingSpin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes contentLoadingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Error States for Seamless Transitions */
.content-error {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b2d 100%);
    border: 2px solid rgba(255, 107, 107, 0.3);
}

.content-error.transitioning {
    animation: errorPulse 2s ease-in-out infinite alternate;
}

@keyframes errorPulse {
    0% { 
        border-color: rgba(255, 107, 107, 0.3);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    100% { 
        border-color: rgba(255, 107, 107, 0.6);
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

/* Performance Optimizations */
.content-item {
    backface-visibility: hidden;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.download-overlay {
    will-change: opacity;
}

.download-progress-fill {
    will-change: width;
}
