:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.4);
    --power-off: #ef4444;
    --power-on: #22c55e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #050505;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(200, 0, 200, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 0% 0%, rgba(0, 200, 255, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(255, 200, 0, 0.25) 0%, transparent 50%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 20px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 20px);
    background-size: 200% 200%, 200% 200%, 200% 200%, 100% 100%, 100% 100%;
    animation: discoMove 10s ease infinite alternate;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

@keyframes discoMove {
    0% {
        background-position: 0% 0%, 0% 0%, 0% 0%, 0 0, 0 0;
    }
    100% {
        background-position: 100% 100%, 100% 0%, 0% 100%, 50px 50px, -50px 50px;
    }
}

.app-container {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(145deg, #162032, #0f1623);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    height: 95vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allow scrolling if content is tall */
}

/* Header & Tabs */
header {
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.zone-tabs {
    display: flex;
    background: #1e293b;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.zone-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.zone-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.model {
    color: var(--accent);
    font-weight: 300;
}

.connection-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--power-on);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--power-on);
}

/* Power Button */
.power-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.power-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: #1e293b;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 5px 5px 10px #0b111a, -5px -5px 10px #212d40;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.power-btn.active {
    color: var(--power-on);
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
    box-shadow: inset 2px 2px 5px #0b111a, inset -2px -2px 5px #212d40;
}

.status-text {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Volume Control */
.volume-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.volume-container h2 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.volume-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    text-shadow: 0 0 15px var(--accent-glow);
}

.unit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--accent);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #334155;
    border-radius: 2px;
}

.mute-btn {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.mute-btn.active {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Inputs */
.inputs-container h2, .surround-container h2 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 10px;
    margin-bottom: 15px;
}

.inputs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.input-card {
    background: var(--card-bg);
    border: none;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.input-card i {
    font-size: 1.5rem;
}

.input-card span {
    font-size: 0.7rem;
    font-weight: 500;
}

.input-card:hover {
    background: #28364d;
    transform: translateY(-2px);
}

.input-card.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Surround Modes */
.surround-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.surround-btn {
    background: var(--card-bg);
    border: 1px solid #334155;
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.surround-btn:hover {
    background: #28364d;
    border-color: var(--accent);
}

.info-card {
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
    margin-top: 20px;
}

/* Tuner Controls */
.tuner-controls-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
}

.tuner-grid, .preset-grid-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.preset-grid-container {
    flex-wrap: wrap;
    max-width: 250px;
    justify-content: flex-start;
}

.tuner-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tuner-row:last-child {
    margin-bottom: 0;
}

.row-label {
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    width: 60px;
}

.tuner-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    flex: 1;
}

.tuner-btn {
    border: none;
    background: #1e293b;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 4px 4px 8px #0b111a, -4px -4px 8px #212d40;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preset-btn {
    width: 100%;
    height: 50px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 2px 2px 5px #0b111a, -2px -2px 5px #212d40;
}

.tuner-btn:active {
    box-shadow: inset 2px 2px 5px #0b111a, inset -2px -2px 5px #212d40;
    color: var(--accent);
}

.tuner-label {
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.tuner-status {
    background: #000;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.tuner-status .freq-unit {
    font-size: 1rem;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
}

.tuner-status .station-name {
    font-size: 1.2rem;
    color: #4ade80;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
}

.tuner-status .freq-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.tuner-status .preset-num {
    font-size: 1rem;
    color: #f59e0b;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 2rem;
    text-align: center;
}

.tuner-status .preset-num:empty {
    display: none;
}

/* Seek buttons - highlight for auto mode */
.tuner-btn.seek-btn {
    background: linear-gradient(135deg, #1e3a2f, #1e293b);
    border: 1px solid #4ade80;
}

.tuner-btn.seek-btn:hover {
    background: linear-gradient(135deg, #2d5442, #2d3b52);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

/* Save button */
.save-row {
    justify-content: center;
    margin-top: 1rem;
}

.save-btn {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid #f59e0b;
    color: #f59e0b;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-btn:hover {
    background: linear-gradient(135deg, #2d3b4f, #1a2332);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
}

.save-btn:active {
    transform: translateY(0);
}
