* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 1400px;
    width: 80%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.tab-nav {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 10px 16px;
    font-size: 15px;
    border-radius: 10px;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.local-m3u-card {
    margin-top: 0.25rem;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    padding: 1rem;
    background: #f8fafc;
}


.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

input,
select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
}

input:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 0;
}

.button-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.button-row button {
    margin-top: 0;
    flex: 1 1 220px;
}

button:hover {
    transform: translateY(-2px);
}

.secondary-button {
    background: #eef2ff;
    color: #334155;
    border: 1px solid #c7d2fe;
    font-size: 14px;
    padding: 10px 14px;
}

.button-row button.toggle-active {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.providers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.provider-card {
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    padding: 1rem;
    background: #f8fafc;
}

.provider-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.full-span {
    grid-column: 1 / -1;
}

.provider-row-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.info {
    margin-top: 1.5rem;
    text-align: center;
    color: #666;
    font-size: 14px;
}

@media (max-width: 900px) {
    .provider-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ── Log Viewer ─────────────────────────────────────────── */
.log-panel {
    margin-top: 1.5rem;
    border: 1px solid #334155;
    border-radius: 10px;
    overflow: hidden;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #1e293b;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.log-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.log-btn {
    background: #334155;
    color: #94a3b8;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0;
    transition: background 0.2s;
}

.log-btn:hover {
    background: #475569;
    transform: none;
}

.log-body {
    height: 300px;
    overflow-y: auto;
    padding: 0.75rem;
    background: #0f172a;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 12px;
    line-height: 1.55;
    color: #94a3b8;
}

.log-body.log-collapsed {
    display: none;
}

.log-line {
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-line.log-error { color: #f87171; }
.log-line.log-warn  { color: #fbbf24; }
.log-line.log-info  { color: #86efac; }
