/* Web Radio Broadcaster - Styles */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --border: #475569;
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Sections */
.section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.section h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.hidden {
    display: none !important;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

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

/* Error Messages */
.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.error-message.blocked {
    background: rgba(239, 68, 68, 0.25);
    font-weight: 600;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Status Bar */
.status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-item {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.status-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.status-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.status-connected {
    color: var(--success);
}

.status-disconnected {
    color: var(--danger);
}

.status-live {
    color: var(--danger);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-offline {
    color: var(--text-muted);
}

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

/* Audio Meter */
.meter-section {
    margin-bottom: 1.5rem;
}

.meter-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.meter-bar {
    height: 24px;
    background: var(--success);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s ease;
}

.meter-scale {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meter-value {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Settings */
.settings-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.settings-section .form-group {
    margin-bottom: 0;
}

/* Controls */
.controls-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Info Section */
.info-section {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.info-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.info-label {
    color: var(--text-muted);
}

.info-item a {
    color: var(--accent);
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

/* Log */
.log-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.log-container {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.log-entry {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.log-time {
    color: var(--text-muted);
}

.log-info {
    color: var(--text-secondary);
}

.log-success {
    color: var(--success);
}

.log-warn {
    color: var(--warning);
}

.log-error {
    color: var(--danger);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .status-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .controls-section {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
    }
}
