/* WP RTSP to HTTP-FLV Player Styles */

.wp-rtsp-flv-player-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

.wp-rtsp-flv-player {
    position: relative;
    background: #000;
    overflow: hidden;
    border-radius: 8px;
}

.wp-rtsp-flv-video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #000;
}

.wp-rtsp-flv-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.wp-rtsp-flv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
}

.wp-rtsp-flv-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: wp-rtsp-spin 1s ease-in-out infinite;
}

@keyframes wp-rtsp-spin {
    to {
        transform: rotate(360deg);
    }
}

.wp-rtsp-flv-error-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-align: center;
    padding: 20px;
    pointer-events: auto;
}

.wp-rtsp-flv-error-overlay .error-icon {
    font-size: 32px;
    color: #ff6b6b;
}

.wp-rtsp-flv-error-overlay .error-message {
    font-size: 14px;
    max-width: 300px;
}

.wp-rtsp-flv-error-overlay .retry-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.wp-rtsp-flv-error-overlay .retry-btn:hover {
    background: #005a87;
}

.wp-rtsp-flv-stream-info {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.wp-rtsp-flv-stream-info .stream-name {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.wp-rtsp-flv-stream-info .stream-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wp-rtsp-flv-stream-info .stream-status.live {
    background: #e53935;
    color: #fff;
    animation: wp-rtsp-pulse 2s infinite;
}

@keyframes wp-rtsp-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.wp-rtsp-flv-stream-info .stream-status.offline {
    background: #757575;
    color: #fff;
}

/* Stream Grid */
.wp-rtsp-flv-stream-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 2), 1fr);
    gap: 15px;
}

.wp-rtsp-flv-stream-item {
    width: 100%;
}

/* Offline and Error States */
.wp-rtsp-flv-error,
.wp-rtsp-flv-no-streams {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* Modern Offline Container */
.wp-rtsp-flv-offline-container {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 12px;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.wp-rtsp-flv-offline-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 119, 115, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.wp-rtsp-flv-offline-content {
    text-align: center;
    color: #fff;
    z-index: 1;
    padding: 20px;
}

.wp-rtsp-flv-offline-content .offline-icon {
    margin-bottom: 16px;
    opacity: 0.7;
    color: #94a3b8;
}

.wp-rtsp-flv-offline-content .offline-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.wp-rtsp-flv-offline-content .offline-status {
    margin-bottom: 12px;
}

.wp-rtsp-flv-offline-content .status-badge {
    display: inline-block;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 6px 16px;
    border-radius: 20px;
    text-transform: uppercase;
}

.wp-rtsp-flv-offline-content .offline-title {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #f1f5f9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wp-rtsp-flv-offline-content .offline-message {
    margin: 0;
    font-size: 14px;
    color: #94a3b8;
    opacity: 0.9;
}

/* Responsive offline container */
@media (max-width: 480px) {
    .wp-rtsp-flv-offline-content .offline-icon svg {
        width: 48px;
        height: 48px;
    }
    
    .wp-rtsp-flv-offline-content .offline-title {
        font-size: 16px;
    }
    
    .wp-rtsp-flv-offline-content .offline-message {
        font-size: 12px;
    }
    
    .wp-rtsp-flv-offline-content .status-badge {
        font-size: 10px;
        padding: 4px 12px;
    }
}

/* Elementor Editor Placeholder */
.wp-rtsp-flv-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    color: #fff;
}

.wp-rtsp-flv-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
}

.wp-rtsp-flv-placeholder p {
    margin: 0;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-rtsp-flv-stream-grid {
        grid-template-columns: 1fr;
    }
    
    .wp-rtsp-flv-stream-info .stream-name {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .wp-rtsp-flv-stream-info .stream-status {
        font-size: 9px;
        padding: 3px 6px;
    }
}

/* Player Controls Enhancement */
.wp-rtsp-flv-video::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.wp-rtsp-flv-video::-webkit-media-controls-play-button,
.wp-rtsp-flv-video::-webkit-media-controls-volume-slider,
.wp-rtsp-flv-video::-webkit-media-controls-mute-button,
.wp-rtsp-flv-video::-webkit-media-controls-fullscreen-button {
    filter: brightness(1.2);
}

/* Hide progress bar/timeline for live streams */
.wp-rtsp-flv-video::-webkit-media-controls-timeline {
    display: none !important;
}

.wp-rtsp-flv-video::-webkit-media-controls-current-time-display,
.wp-rtsp-flv-video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

/* Hide loading when video is playing */
.wp-rtsp-flv-player.playing .wp-rtsp-flv-loading {
    display: none;
}

.wp-rtsp-flv-player.error .wp-rtsp-flv-loading {
    display: none;
}

.wp-rtsp-flv-player.error .wp-rtsp-flv-error-overlay {
    display: flex !important;
}
