/**
 * 🔍 Stream Debug Panel Styles
 * Visual debugging tool for match streams
 */

/* Debug Panel Container */
#stream-debug-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background: #1a1a1a;
    color: #ffffff;
    z-index: 99999;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#stream-debug-panel.visible {
    right: 0;
}

.debug-panel-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.debug-panel-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.debug-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
}

.debug-icon {
    font-size: 20px;
}

.debug-match-id {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.debug-panel-actions {
    display: flex;
    gap: 8px;
}

.debug-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.debug-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.debug-btn-close {
    padding: 6px 10px;
}

/* Content */
.debug-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #1a1a1a;
}

.debug-panel-content::-webkit-scrollbar {
    width: 8px;
}

.debug-panel-content::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.debug-panel-content::-webkit-scrollbar-thumb {
    background: #f59e0b;
    border-radius: 4px;
}

/* Stats Grid */
.debug-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.debug-stat-card {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.debug-stat-icon {
    font-size: 28px;
}

.debug-stat-content {
    flex: 1;
}

.debug-stat-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.debug-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #f59e0b;
}

.debug-stat-time {
    font-size: 16px;
}

/* Sections */
.debug-section {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.debug-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3a3a3a;
}

.debug-section-icon {
    font-size: 18px;
}

.debug-section-title {
    font-weight: 700;
    font-size: 15px;
    color: #f59e0b;
}

/* API Info */
.debug-api-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.debug-api-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1a1a1a;
    border-radius: 6px;
}

.debug-api-label {
    font-weight: 600;
    color: #999;
    font-size: 12px;
}

.debug-api-value {
    color: #fff;
    font-weight: 500;
}

.debug-api-url {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #f59e0b;
}

/* Badges */
.debug-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.debug-badge-live {
    background: #ef4444;
    color: white;
}

.debug-badge-scheduled {
    background: #3b82f6;
    color: white;
}

.debug-badge-finished {
    background: #6b7280;
    color: white;
}

.debug-badge-hd,
.debug-badge-fhd {
    background: #10b981;
    color: white;
}

.debug-badge-sd {
    background: #f59e0b;
    color: white;
}

.debug-badge-success {
    background: #10b981;
    color: white;
}

.debug-badge-error {
    background: #ef4444;
    color: white;
}

.debug-badge-info {
    background: #3b82f6;
    color: white;
}

/* Sources Grid */
.debug-sources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.debug-source-card {
    background: #1a1a1a;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s;
}

.debug-source-card:hover {
    border-color: #f59e0b;
    transform: translateY(-2px);
}

.debug-source-status {
    font-size: 24px;
    margin-bottom: 6px;
}

.debug-source-name {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.debug-source-count {
    font-size: 10px;
    color: #999;
}

.debug-source-success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.debug-source-empty {
    border-color: #6b7280;
    opacity: 0.6;
}

/* Streams List */
.debug-streams-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.debug-stream-item {
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 12px;
}

.debug-stream-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.debug-stream-number {
    background: #f59e0b;
    color: #1a1a1a;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
}

.debug-stream-source {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
}

.debug-stream-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.debug-stream-detail {
    display: flex;
    gap: 8px;
    font-size: 12px;
}

.debug-detail-label {
    color: #999;
    font-weight: 600;
    min-width: 70px;
}

.debug-detail-value {
    color: #fff;
    word-break: break-all;
}

code.debug-detail-value {
    background: #0a0a0a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

/* Errors List */
.debug-errors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.debug-error-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid;
}

.debug-error-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
}

.debug-error-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
}

.debug-error-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.debug-error-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.debug-error-content {
    flex: 1;
}

.debug-error-message {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}

.debug-error-suggestion {
    font-size: 11px;
    color: #999;
    line-height: 1.5;
}

/* States */
.debug-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

.debug-empty {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.debug-info {
    text-align: center;
    padding: 12px;
    color: #999;
}

.debug-error {
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 6px;
    color: #ef4444;
    text-align: center;
}

/* Floating Toggle Button */
.debug-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    z-index: 99998;
    transition: all 0.3s;
}

.debug-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(245, 158, 11, 0.6);
}

.debug-toggle-icon {
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #stream-debug-panel {
        width: 100%;
        right: -100%;
    }
    
    .debug-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .debug-sources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .debug-toggle-btn {
        bottom: 10px;
        right: 10px;
        padding: 12px 16px;
    }
    
    .debug-toggle-text {
        display: none;
    }
}

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

@keyframes slideIn {
    from {
        right: -600px;
    }
    to {
        right: 0;
    }
}
