:root {
    --primary-color: #FFD700;
    --secondary-color: #DC143C;
    --dark: #1a1a1a;
    --light: #f5f5f5;
    --border: #ddd;
    --success: #28a745;
    --danger: #dc3545;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: #333;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--dark);
    color: white;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    text-align: center;
}

.sidebar-header .logo {
    max-width: 100%;
    height: auto;
}

.sidebar-header h2 {
    margin: 0;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--secondary-color);
}

.sidebar-nav .icon {
    margin-right: 10px;
    font-size: 20px;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
}

.topbar {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.content {
    padding: 30px;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 48px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: 50%;
}

.stat-info h3 {
    font-size: 32px;
    margin: 0;
    color: var(--secondary-color);
}

.stat-info p {
    margin: 5px 0 0;
    color: #666;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #b81030;
}

.btn-secondary {
    background: var(--primary-color);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #e6c200;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--light);
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    font-weight: 600;
    color: var(--dark);
}

table tbody tr:hover {
    background: #f9f9f9;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal.show {
    display: block;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Now Playing */
.now-playing {
    display: flex;
    gap: 20px;
    align-items: center;
}

.song-artwork {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.song-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.default-artwork {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: 8px;
    font-size: 48px;
}

.song-info h3 {
    margin: 0 0 5px;
    color: var(--dark);
}

.song-info p {
    margin: 0 0 10px;
    color: #666;
}

.song-info small {
    color: #999;
}

/* Stream URL */
.stream-url {
    display: flex;
    gap: 10px;
}

.stream-url input {
    flex: 1;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 0;
    color: var(--dark);
}

/* Utilities */
.text-muted {
    color: #999;
}

.mt-3 {
    margin-top: 20px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
}

.info-group {
    margin-bottom: 20px;
}

.info-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .now-playing {
        flex-direction: column;
    }
    
    .song-artwork {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}


/* Mode Toggle Bar */
.mode-toggle-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.mode-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-label {
    font-weight: 600;
    color: #666;
}

.mode-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.mode-status.auto {
    background: #d4edda;
    color: #155724;
}

.mode-status.manual {
    background: #fff3cd;
    color: #856404;
}

.btn-toggle {
    background: var(--primary-color);
    color: var(--dark);
    font-weight: 600;
}

.btn-toggle:hover {
    background: #e6c200;
}

/* Current Playlist Info */
.current-playlist-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.current-playlist-info h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #666;
}

.playlist-badge {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
}

.playlist-badge .icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.playlist-badge.manual {
    background: #fff3cd;
    border-left: 4px solid var(--primary-color);
}

.playlist-badge.manual .icon {
    background: var(--primary-color);
}

.playlist-badge.scheduled {
    background: #d4edda;
    border-left: 4px solid var(--success);
}

.playlist-badge.scheduled .icon {
    background: var(--success);
    color: white;
}

.playlist-badge.random {
    background: #f8d7da;
    border-left: 4px solid var(--secondary-color);
}

.playlist-badge.random .icon {
    background: var(--secondary-color);
    color: white;
}

.playlist-badge strong {
    display: block;
    margin-bottom: 3px;
    color: var(--dark);
}

.playlist-badge small {
    color: #666;
    font-size: 12px;
}

/* Active Playlist Card */
.active-playlist {
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.playing-indicator {
    color: var(--secondary-color);
    animation: pulse 1.5s ease-in-out infinite;
    margin-right: 5px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Playlist Actions */
.playlist-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Alert Info */
.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive */
@media (max-width: 768px) {
    .mode-toggle-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .mode-info {
        flex-direction: column;
        text-align: center;
    }
    
    .playlist-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .playlist-actions .btn {
        width: 100%;
    }
    
    .playlist-badge {
        flex-direction: column;
        text-align: center;
    }
}