:root {
    --bg-dark: #0f1115;
    --bg-card: #181b21;
    --bg-card-hover: #22262e;
    --accent: #1F6AA5;
    --accent-glow: rgba(31, 106, 165, 0.4);
    --text-main: #ffffff;
    --text-muted: #94apyb;
    --success: #00d26a;
    --error: #f8312f;
    --warning: #ffc107;
    --font-family: 'Inter', sans-serif;
    --glass-bg: rgba(30, 34, 40, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Fallback/Explicit Icon Class */
.material-icons-round {
    font-family: 'Material Icons Round';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    overflow: hidden;
    /* App feel */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Animation */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 20% 30%, #15202b 0%, var(--bg-dark) 50%),
        radial-gradient(circle at 80% 80%, #0e161c 0%, var(--bg-dark) 50%);
}

.app-container {
    width: 100%;
    max-width: 480px;
    /* Mobile App dimensions */
    height: 100vh;
    max-height: 900px;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

@media (min-width: 500px) {
    .app-container {
        height: 90vh;
        border-radius: 24px;
        border: 1px solid var(--glass-border);
    }
}

/* Force full width for admin/wide mode */
.app-container.container-wide {
    max-width: 98vw;
    /* Almost full screen width */
    width: 98vw;
    height: 95vh;
}

/* Ensure Add Button is visible */
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Common Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
    background: #257bc0;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    margin-bottom: 16px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
}

/* Login / Wizard Specific */
.login-header {
    text-align: center;
    padding: 40px 20px;
}

.login-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.toggle-btn {
    flex: 1;
    padding: 8px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--bg-card);
    color: white;
    font-weight: 600;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Status Indicators */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.online .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.offline .status-dot {
    background: var(--text-muted);
}

.unstable .status-dot {
    background: var(--warning);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

/* Player UI */
.player-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    width: 200px;
    height: 200px;
    max-width: 60vw;
    max-height: 60vw;
    background: #000;
    margin: 0 auto 20px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.logo-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.visualizer-container {
    height: 60px;
    width: 100%;
    padding: 0 20px;
    margin-bottom: 20px;
}

@media (max-height: 600px) {
    .logo-area {
        width: 120px;
        height: 120px;
        margin-bottom: 10px;
    }

    .player-header {
        padding: 10px;
    }

    .visualizer-container {
        height: 40px;
        margin-bottom: 10px;
    }

    .meta-info {
        padding-bottom: 10px;
    }

    .play-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

#viz-canvas {
    width: 100%;
    height: 100%;
}

.controls-area {
    padding: 20px;
    text-align: center;
}

.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--accent-glow);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.play-btn:active {
    transform: scale(0.95);
}

.meta-info {
    text-align: center;
    padding: 0 20px 20px;
}

.meta-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.meta-artist {
    color: var(--text-muted);
}