:root {
    --primary-color: #ff5757;
    --background-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #ffffff;
    --text-secondary: #b3b3b3;
    --sidebar-width: 240px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    transition: margin-left 0.3s ease;
}

/* Mobile detection - ensure these are at the top of the file */
.mobile-device .desktop-interface {
    display: none !important;
}

.desktop-device .mobile-interface {
    display: none !important;
}

/* Mobile car radio interface */
.mobile-interface {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    margin: 10px auto;
    overflow: hidden;
}

.car-radio-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.car-radio-display {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    width: 100%;
}

.mobile-album-art {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.mobile-album-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: rgba(0, 0, 0, 0.1);
}

.car-radio-display h2 {
    font-size: 18px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

@keyframes scroll-text {
    0% { transform: translateX(0); }
    10% { transform: translateX(0); } /* Initial pause */
    60% { transform: translateX(calc(-100% + 250px)); } /* Adjusted to ensure full visibility */
    90% { transform: translateX(calc(-100% + 250px)); } /* End pause */
    100% { transform: translateX(0); }
}

.car-radio-display h2.scrolling {
    animation: scroll-text 15s linear infinite;
    text-overflow: clip;
    padding-right: 50px; /* Add space at the end of scrolling text */
    display: inline-block; /* Ensures the text doesn't break into multiple lines */
    white-space: nowrap; /* Ensures text stays on a single line */
    width: 100%; /* Take full width of container */
}

.car-radio-visualizer {
    height: 30px;
    margin: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.visualizer-bar {
    width: 5px;
    height: 5px;
    background-color: #000;
    margin: 0 2px;
    border-radius: 2px;
}

.car-radio-controls {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.car-radio-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    transition: background-color 0.3s ease;
    cursor: pointer;
    padding: 0;
}

.car-radio-btn svg {
    width: 24px;
    height: 24px;
    color: currentColor;
}

.car-radio-btn.play-pause {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
}

.car-radio-btn.play-pause svg {
    width: 32px;
    height: 32px;
}

.car-power-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, #f55, #a11);
    border: 2px solid #222;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 10px;
    right: 10px;
}

.car-radio-time {
    font-size: 16px;
    margin-top: 5px;
}

.car-radio-progress {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 10px 0;
    overflow: hidden;
    width: 100%; /* Ensure full width */
}

.car-radio-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.1s linear; /* Smooth progress updates */
}

.bg-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(50px) brightness(0.4);
    z-index: -1;
    opacity: 0.7;
}

/* Sidebar toggle button */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: left 0.3s ease, opacity 0.3s ease;
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
    color: white;
}

.sidebar-toggle.sidebar-visible {
    left: calc(var(--sidebar-width) + 20px);
}

.container {
    margin-left: 0;
    max-width: 900px;
    padding: 20px;
    position: relative;
    z-index: 1;
    margin: 0 auto;
    transition: margin-left 0.3s ease;
}

.container.sidebar-visible {
    margin-left: var(--sidebar-width);
    max-width: calc(900px - var(--sidebar-width));
    margin-right: 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    color: var(--primary-color);
}

.logo svg {
    margin-right: 10px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.listeners {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.listeners svg {
    margin-right: 5px;
}

.player {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.desktop-interface .player {
    margin: 0 auto 30px;
    max-width: 800px;
}

.now-playing {
    display: flex;
    margin-bottom: 20px;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.album-art {
    width: 300px;
    height: 300px;
    background-color: #6c7ae0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: rgba(0, 0, 0, 0.1);
}

.track-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.track-info h2 {
    font-size: 20px;
    margin-bottom: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-container {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 10px 0; /* Restored margin to create space */
    overflow: hidden;
    width: 100%; /* Ensure full width */
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear; /* Smooth progress updates */
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 5px; /* Added slight spacing */
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

.control-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.control-btn svg {
    width: 24px;
    height: 24px;
    color: var(--text-color);
}

.control-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.skip-backward, .skip-forward {
    width: 40px;
    height: 40px;
}

.skip-backward svg, .skip-forward svg {
    width: 20px;
    height: 20px;
}

.play-pause {
    width: 60px;
    height: 60px;
}

.play-pause svg {
    width: 32px;
    height: 32px;
}

.next-up {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.next-up h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.upcoming-songs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.upcoming-song {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background-color 0.3s;
}

.upcoming-song:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.upcoming-song img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 10px;
}

.upcoming-song-info {
    flex-grow: 1;
    overflow: hidden;
}

.upcoming-song-title {
    font-size: 14px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upcoming-song-details {
    display: flex;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 3px;
}

.upcoming-song-duration, .upcoming-song-plays {
    margin-right: 10px;
}

/* Sidebar styles */
.sidebar {
    position: fixed;
    top: 0;
    left: -var(--sidebar-width);
    width: var(--sidebar-width);
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease, left 0.3s ease;
}

.sidebar.hidden {
    left: -100%; /* Completely off-screen */
    transform: translateX(-100%);
    pointer-events: none; /* Disable interactions when hidden */
}

.sidebar.visible {
    left: 0;
    transform: translateX(0);
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 10px;
}

.nav-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s;
    text-align: left;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.nav-btn.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

/* Playlist manager */
.playlist-manager {
    padding: 20px;
    display: none;
}

.playlist-manager h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.playlist-songs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.playlist-song {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    transition: background-color 0.3s;
}

.playlist-song:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.playlist-song img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 10px;
    object-fit: cover;
}

.playlist-song-info {
    flex-grow: 1;
    overflow: hidden;
}

.playlist-song-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-song-actions {
    display: flex;
    gap: 5px;
}

.playlist-song-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.3s, background-color 0.3s;
}

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

.playlist-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.playlist-btn {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--text-color);
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.playlist-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Mobile tabs */
.mobile-tabs {
    display: flex;
    margin-top: 15px;
}

.mobile-tab-btn {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.3s;
}

.mobile-tab-btn.active {
    background-color: var(--primary-color);
}

.mobile-tab-btn:first-child {
    border-radius: 5px 0 0 5px;
}

.mobile-tab-btn:last-child {
    border-radius: 0 5px 5px 0;
}

/* Volume controls */
.volume-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    gap: 10px;
}

.volume-slider {
    -webkit-appearance: none;
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    transition: opacity 0.2s;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

#volume-icon {
    width: 24px;
    height: 24px;
    color: var(--text-color);
}

.mobile-volume-controls {
    padding: 0 15px;
    margin: 10px 0;
}

.mobile-volume-controls .volume-slider {
    width: 100%;
}

/* Download progress */
.download-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 1000;
}

.download-progress-bar {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.download-progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.2s ease;
}

/* Add tooltip styles */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 100;
    pointer-events: none;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Mobile tooltips positioning adjustments */
@media (max-width: 768px) {
    [data-tooltip]::before {
        width: auto;
        white-space: normal;
        max-width: 200px;
        text-align: center;
    }
}

/* Media queries for mobile */
@media (max-width: 768px) {
    .sidebar {
        width: 80%;
        left: -80%;
    }
    
    .sidebar.hidden {
        left: -100%; /* Completely off-screen for mobile */
    }
    
    .sidebar-toggle {
        left: 10px;
    }
    
    .sidebar-toggle.sidebar-visible {
        left: calc(80% + 10px);
    }
    
    .container.sidebar-visible {
        margin-left: 80%;
        max-width: 100%;
    }
    
    .now-playing {
        flex-direction: column;
    }
    
    .album-art {
        width: 100%;
        max-width: 250px;
        height: auto;
        aspect-ratio: 1/1;
        margin: 0 auto 15px;
    }
    
    .player-controls {
        gap: 10px;
    }
    
    .car-radio-btn svg {
        width: 24px;
        height: 24px;
        display: block;
    }
    
    .car-radio-btn.play-pause svg {
        width: 32px;
        height: 32px;
    }
}

/* Add these scrollbar styles */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--primary-color) 80%, white);
}

/* Sidebar toggle visibility */
.sidebar.visible + .sidebar-toggle {
    opacity: 0;
    pointer-events: none;
}