/* Dynamic Stream CSS - Additional styles for stream management */

/* Loading states */
.player-container {
    position: relative;
}

/* Offline overlay */
.offline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border-radius: 10px;
    overflow: hidden;
}

.offline-overlay.show {
    display: flex;
}

.offline-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through when not loading */
}

.player-container.loading .loading-overlay {
    display: flex;
    pointer-events: auto; /* Enable pointer events when actually loading */
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #9333ea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Stream status indicators */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.live-indicator.live {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.live-indicator:not(.live) {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #d1d5db;
}

.live-dot, .offline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.live-dot {
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.offline-dot {
    background: #9ca3af;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stream controls mini */
.stream-controls-mini {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn i {
    font-size: 14px;
}

/* Stream status section */
.stream-status {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stream-status h4 {
    color: #9333ea;
    margin-bottom: 10px;
    font-size: 1rem;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.status-label {
    color: #a1a1aa;
}

.status-value {
    color: white;
    font-weight: 500;
}

/* Enhanced iframe styling */
.stream-iframe {
    border-radius: 10px;
    transition: all 0.3s ease;
    pointer-events: auto; /* Ensure iframe is clickable */
    touch-action: auto; /* Enable touch interactions */
}

.player-container:hover .stream-iframe {
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stream-iframe {
        height: 300px; /* Increase mobile height for better usability */
        min-height: 300px;
        touch-action: manipulation; /* Optimize touch interactions */
    }
    
    .player-container {
        /* Ensure container doesn't interfere with touch */
        touch-action: auto;
    }
    
    .stream-controls-mini {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .status-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .loading-overlay p {
        font-size: 0.9rem;
        text-align: center;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    .stream-iframe {
        height: 250px;
        min-height: 250px;
    }
}

/* Admin panel styles (hidden by default) */
.admin-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(147, 51, 234, 0.3);
    color: white;
    display: none;
    z-index: 1000;
    min-width: 300px;
}

.admin-panel.show {
    display: block;
}

.admin-panel h3 {
    color: #9333ea;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-form input, .admin-form select {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 5px;
    font-size: 0.9rem;
}

.admin-form input::placeholder {
    color: #a1a1aa;
}

.admin-form button {
    padding: 10px 15px;
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-form button:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
}

/* Console access hint */
.console-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #a1a1aa;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.console-hint.show {
    display: block;
}

/* Error states */
.stream-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    text-align: center;
    font-weight: 500;
}

.stream-error i {
    margin-right: 8px;
}

