/* ==================== ROOT VARIABLES & DESIGN SYSTEM ==================== */
:root {
    --bg-dark: #070913;
    --bg-card: rgba(13, 17, 28, 0.75);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-glow: rgba(0, 242, 254, 0.15);
    
    /* Cyber Accent Colors */
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --accent-pink: #ff007f;
    --accent-green: #39ff14;
    --accent-red: #ff3366;
    --accent-yellow: #f1c40f;
    
    /* Text Colors */
    --text-primary: #f0f3fa;
    --text-secondary: #8ea0c2;
    --text-muted: #536485;
    
    /* Font Families */
    --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition-speed: 0.3s;
}

/* ==================== BASE STYLES & LAYOUT ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Cybernetic Glowing Background */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(255, 0, 127, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(13, 17, 28, 0.99) 0%, #07080f 100%);
}

.dashboard-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== HEADER ==================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px var(--accent-cyan));
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.system-time-status {
    display: flex;
    align-items: center;
    gap: 24px;
}

.time-display {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* ==================== STATUS BADGE & ANIMATION ==================== */
.status-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
}

.pulse-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Active Live State */
.status-badge.live {
    background: rgba(57, 255, 20, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(57, 255, 20, 0.3);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.15);
}

.status-badge.live .pulse-indicator {
    background-color: var(--accent-green);
    animation: pulse 1.5s infinite;
}

/* Offline state */
.status-badge.offline {
    background: rgba(255, 51, 102, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(255, 51, 102, 0.3);
}

.status-badge.offline .pulse-indicator {
    background-color: var(--accent-red);
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(57, 255, 20, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0);
    }
}

/* ==================== DASHBOARD GRID SYSTEM ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    flex-grow: 1;
}

.grid-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==================== CARDS ==================== */
.dashboard-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.dashboard-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 8px 32px rgba(0, 242, 254, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-cyan);
}

/* ==================== SYSTEM TELEMETRY ==================== */
.telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tel-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.02);
    padding: 14px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tel-item:nth-child(1), .tel-item:nth-child(2) {
    grid-column: span 2;
}

.tel-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.tel-val {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 600;
    align-self: flex-end;
}

.tel-val-text {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-cyan);
}

/* Progress bar */
.progress-bar-container {
    background: rgba(255, 255, 255, 0.05);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 3px;
    transition: width 1s ease-in-out;
}

/* ==================== CURRENTLY PLAYING CARD ==================== */
.playing-body {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.no-stream-placeholder {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.stream-active-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.track-thumb-container {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.track-thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-details h4 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-details p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stream-stats-row {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sub-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sub-label {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sub-val {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-cyan);
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #000;
    font-weight: 800;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
}

.btn-glow {
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.btn-danger {
    background: rgba(255, 51, 102, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 51, 102, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-pink), #c800ff);
    color: #fff;
}

.btn-accent:hover {
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.3);
}

.btn-dark {
    background: rgba(20, 24, 35, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-dark:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* ==================== FORMS ==================== */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    width: 100%;
    outline: none;
    transition: border-color var(--transition-speed);
}

.form-group input:focus {
    border-color: var(--accent-cyan);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 40px;
}

.btn-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==================== PLAYLIST MANAGER ==================== */
.add-song-row {
    display: flex;
    gap: 12px;
}

.add-song-row input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    font-size: 13px;
}

.add-song-row input:focus {
    border-color: var(--accent-pink);
}

.playlist-container {
    height: 280px;
    overflow-y: auto;
    margin-top: 10px;
    padding-right: 4px;
}

.playlist-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlist-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-size: 14px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.playlist-item.active {
    background: rgba(0, 242, 254, 0.05);
    border-color: rgba(0, 242, 254, 0.2);
}

.track-index {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    width: 20px;
}

.playlist-item.active .track-index {
    color: var(--accent-cyan);
}

.playlist-thumb {
    width: 50px;
    height: 38px;
    border-radius: 4px;
    object-fit: cover;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-details {
    flex-grow: 1;
    min-width: 0; /* allows text truncation */
}

.playlist-details h5 {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-details p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item.active h5 {
    color: var(--accent-cyan);
}

.playlist-item-controls {
    display: flex;
    gap: 4px;
}

.playlist-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.playlist-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.playlist-btn.btn-remove:hover {
    background: rgba(255, 51, 102, 0.1);
    color: var(--accent-red);
}

/* ==================== CONSOLE CARD ==================== */
.console-card {
    flex-grow: 1;
}

.console-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    user-select: none;
}

.console-wrapper {
    background: #04060b;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 16px;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.8);
}

.console-output {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 240px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #4af626; /* retro terminal green */
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ==================== FOOTER ==================== */
.dashboard-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ==================== RESPONSIVE LAYOUT ==================== */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
