/**
 * IPTV Diagnostics Widget Styles
 * 
 * Dark theme server card styling matching server-monitor-plugin design
 */

/* ===== Server Grid Container ===== */
.iptv-diag-server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* ===== Server Card ===== */
.server-card {
    background: #0e1a2b;
    border-radius: 12px;
    border: 1px solid #1e3a5f;
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #475569;
}

.server-card.online::before {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.server-card.offline::before {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* ===== Card Header ===== */
.server-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.server-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.server-icon svg {
    width: 24px;
    height: 24px;
}

.server-name {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #f8fafc;
}

.server-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.server-status-badge.online {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.server-status-badge.offline {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.server-status-badge .status-icon {
    width: 12px;
    height: 12px;
}

/* ===== Stability Row ===== */
.server-stability {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #1e3a5f;
    margin-bottom: 12px;
}

.stability-label {
    font-size: 14px;
    color: #94a3b8;
}

.stability-value {
    font-size: 16px;
    font-weight: 600;
    color: #22c55e;
}

.server-card.offline .stability-value {
    color: #ef4444;
}

/* ===== Channel Analysis ===== */
.channel-analysis {
    margin-bottom: 12px;
}

.analysis-toggle {
    width: 100%;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    color: #60a5fa;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.analysis-toggle:hover {
    background: rgba(59, 130, 246, 0.2);
}

.analysis-toggle .icon-pulse {
    width: 16px;
    height: 16px;
}

.analysis-toggle .analysis-title {
    flex: 1;
    font-weight: 500;
    text-align: left;
}

.analysis-toggle .analysis-hint {
    font-size: 11px;
    color: #94a3b8;
}

.analysis-toggle .icon-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.analysis-toggle[data-expanded="true"] .icon-chevron {
    transform: rotate(180deg);
}

/* ===== Analysis Details ===== */
.analysis-details {
    padding: 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0 0 8px 8px;
    margin-top: -4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #1e3a5f;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 12px;
    color: #94a3b8;
}

.stat-value {
    font-size: 12px;
    font-weight: 600;
    color: #f8fafc;
}

.stat-value.stat-online {
    color: #22c55e;
}

.stat-value.stat-offline {
    color: #ef4444;
}

.stat-value.stat-warning {
    color: #f59e0b;
}

/* ===== Pending Analysis State ===== */
.channel-analysis.pending {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.analysis-pending {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f59e0b;
    font-weight: 500;
    margin-bottom: 8px;
}

.analysis-status-text {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 4px 0;
}

.analysis-verification {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

/* ===== Report Button ===== */
.report-button {
    width: 100%;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 10px 16px;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.report-button:hover {
    background: linear-gradient(135deg, #1a1f2e 0%, #252b3d 100%);
    border-color: #fbbf24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

.report-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Downtime Indicator ===== */
.downtime-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid #1e3a5f;
    font-size: 12px;
    color: #64748b;
}

.downtime-indicator svg {
    width: 14px;
    height: 14px;
}

/* ===== Category Breakdown ===== */
.category-breakdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #1e3a5f;
}

.category-breakdown > div:first-child {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.channel-analysis-note-container {
    background: #84703a;
    border: 1px solid #dcb726;
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 15px;
    font-size: 0.7rem;
}

.channel-analysis-note-container p {
    color: #22200b;
}