/**
 * CyaStream - IPTV Panel Admin Styles
 */

/* ============================================================================
   IPTV Panel Section
   ============================================================================ */

.iptv-panel-container {
    display: grid;
    gap: 24px;
}

.iptv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.iptv-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.iptv-header h2 svg {
    width: 28px;
    height: 28px;
    color: var(--accent, #059669);
}

/* Status Indicator */
.status-indicator {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.active {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.25);
}

.status-indicator.active::before {
    background: #059669;
}

.status-indicator.inactive {
    background: rgba(156, 163, 175, 0.12);
    color: #6b7280;
    border: 1px solid rgba(156, 163, 175, 0.25);
}

.status-indicator.inactive::before {
    background: #6b7280;
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Reseller Stats */
.reseller-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.stat-card {
    padding: 16px;
    background: var(--surface-2, #f8fafc);
    border-radius: 12px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    text-align: center;
}

.stat-card.active {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.2);
}

.stat-card.inactive {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--ink, #1e293b);
}

/* IPTV Cards */
.iptv-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    border-radius: var(--radius-lg, 16px);
    padding: 24px;
    box-shadow: var(--shadow-card, 0 4px 20px rgba(0, 0, 0, 0.04));
    transition: var(--transition, 0.25s ease);
}

.iptv-card:hover {
    box-shadow: var(--shadow-card-hover, 0 6px 30px rgba(0, 0, 0, 0.08));
    border-color: #cbd5e1;
}

.iptv-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.iptv-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.iptv-card-header h3 svg {
    width: 20px;
    height: 20px;
    color: var(--accent, #059669);
}

/* Form Styles */
.iptv-form {
    display: grid;
    gap: 20px;
}

.iptv-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.iptv-field {
    display: grid;
    gap: 8px;
}

.iptv-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink, #1e293b);
}

.iptv-field input,
.iptv-field select {
    padding: 12px 14px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
    border-radius: 10px;
    background: var(--surface-2, #f8fafc);
    font-size: 14px;
    color: var(--ink, #1e293b);
    transition: all 0.2s;
}

.iptv-field input:focus,
.iptv-field select:focus {
    outline: none;
    border-color: var(--accent, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.iptv-field input::placeholder {
    color: var(--muted, #94a3b8);
}

.iptv-field .field-hint {
    font-size: 12px;
    color: var(--muted, #94a3b8);
}

/* Checkbox Toggle */
.toggle-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: 0.3s;
}

.toggle-slider::before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent, #059669);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink, #1e293b);
}

/* Button Styles */
.iptv-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm, 8px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition, 0.25s ease);
    letter-spacing: 0.01em;
}

.iptv-btn svg {
    width: 16px;
    height: 16px;
}

.iptv-btn-primary {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.iptv-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

.iptv-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.iptv-btn-secondary {
    background: var(--surface-2, #f1f5f9);
    color: var(--ink, #1e293b);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.iptv-btn-secondary:hover {
    background: #e2e8f0;
}

.iptv-btn-outline {
    background: transparent;
    color: var(--accent, #059669);
    border: 1px solid var(--accent, #059669);
}

.iptv-btn-outline:hover {
    background: rgba(5, 150, 105, 0.08);
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--muted, #64748b);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--surface-2, #f1f5f9);
    color: var(--accent, #059669);
}

.iptv-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

/* Orders Table */
.orders-table-container {
    overflow-x: auto;
    margin-top: 16px;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.orders-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--surface-2, #f8fafc);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted, #64748b);
    border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.orders-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.06));
    vertical-align: middle;
}

.orders-table tr:hover {
    background: rgba(5, 150, 105, 0.02);
}

.orders-table .empty-state,
.orders-table .error-state {
    text-align: center;
    padding: 40px;
    color: var(--muted, #64748b);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.completed {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
}

.status-badge.partial {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.status-badge.pending {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

/* Info & Error Messages */
.info-message {
    padding: 16px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    color: #2563eb;
    font-size: 14px;
    text-align: center;
}

.error-message {
    padding: 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #dc2626;
    font-size: 14px;
    text-align: center;
}

.success-message {
    padding: 16px;
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: 10px;
    color: #059669;
    font-size: 14px;
}

/* Toast Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Grid Layout for Cards */
.iptv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .iptv-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .iptv-form-row {
        grid-template-columns: 1fr;
    }

    .reseller-stats {
        grid-template-columns: 1fr 1fr;
    }

    .orders-table {
        font-size: 13px;
    }

    .orders-table th,
    .orders-table td {
        padding: 10px 12px;
    }
}

/* API Key Field (masked) */
.api-key-field {
    position: relative;
}

.api-key-field input {
    padding-right: 44px;
}

.api-key-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted, #64748b);
    padding: 4px;
}

.api-key-toggle:hover {
    color: var(--accent, #059669);
}