:root {
    --bg-color: #f7f7f7;
    --card-bg: #ffffff;
    --text-primary: #5a5250;
    --text-secondary: #055101;
    --accent-color: #f07a01;
    --border-radius: 12px;
    --spacing: 20px;
    --border-color: #e0e0e0;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a8d5a3;
    --border-color: #404040;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1000px;
    position: relative;
    /* Increased for desktop side-by-side */
}

header {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
    /* For absolute positioning of clocks on desktop */
}

#world-clocks {
    display: flex;
    gap: 20px;
    margin-top: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.clock {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.clock-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.dark-mode-toggle {
    position: absolute;
    top: 10px;
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    z-index: 10;
}

.lang-toggle {
    position: absolute;
    top: 10px;
    left: 50px;
    /* Position next to dark mode toggle */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    height: 40px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10;
}

.dark-mode-toggle:hover,
.lang-toggle:hover {
    transform: scale(1.1);
    background: var(--bg-color);
}

/* Desktop - Side by Side */
@media (min-width: 768px) {
    .header-controls {
        display: contents;
    }

    main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
        gap: 40px;
        /* Increased gap between columns */
    }

    #world-clocks {
        position: absolute;
        top: 10px;
        right: 0;
        margin-top: 0;
        flex-direction: row;
        text-align: right;
    }

    .clock {
        align-items: flex-end;
    }

    .dark-mode-toggle {
        left: 0;
    }
}

@media (max-width: 767px) {
    header {
        margin-bottom: 20px;
    }

    .dark-mode-toggle {
        position: relative;
        left: auto;
        top: auto;
        display: inline-flex;
        margin: 0;
    }

    .lang-toggle {
        position: relative;
        left: auto;
        top: auto;
        display: inline-flex;
        margin: 0;
    }
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Remove gap between stacked cards */
}

#next-track {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    /* Separator */
}

#recent-tracks {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

#main-banner {
    height: 60px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.live-indicator {
    background-color: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

.title-live {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 0;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: var(--spacing);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

#artwork-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#track-artwork {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    background-color: #ddd;
    /* Placeholder color */
    /* Removed box-shadow */
}

#track-info {
    text-align: center;
    margin-bottom: 20px;
}

#track-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--accent-color);
}

#track-artist {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

#track-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0;
}

#controls {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.play-btn {
    background-color: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    color: white;
    /* Icon color */
}

.play-btn:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.play-btn:active {
    transform: scale(0.95);
}

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

#timer-container {
    text-align: center;
    font-family: monospace;
    font-size: 2rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 8px;
    width: fit-content;
    margin: 0 auto;
}

#recent-list {
    list-style: none;
    max-height: 350px;
    /* Adjust to match Now Playing height roughly */
    overflow-y: auto;
    padding-right: 10px;
    /* Space for scrollbar */
}

/* Custom Scrollbar */
#recent-list::-webkit-scrollbar {
    width: 8px;
}

#recent-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#recent-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

#recent-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.recent-artwork {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    background-color: #ddd;
}

.recent-info {
    flex: 1;
    min-width: 0;
}

.recent-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.recent-artist {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.recent-album {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.recent-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.recent-item:last-child {
    border-bottom: none;
}

.next-track-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

#next-track-artwork {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    background-color: #ddd;
}

.next-track-info {
    display: flex;
    flex-direction: column;
}

#next-track-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

#next-track-artist {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

#next-track-album {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.recent-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 60px;
    text-align: right;
}

@media (max-width: 480px) {
    .card {
        padding: 20px;
    }

    #track-title {
        font-size: 1.3rem;
    }
}

/* Album Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    text-align: center;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: scale(1.1);
}

#modal-artwork {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.modal-details h3 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.modal-details p {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

#track-artwork,
.recent-artwork,
#next-track-artwork {
    cursor: pointer;
    transition: transform 0.2s ease;
}

#track-artwork:hover,
.recent-artwork:hover,
#next-track-artwork:hover {
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .modal-content {
        padding: 30px 20px;
    }

    .modal-details h3 {
        font-size: 1.4rem;
    }

    .modal-details p {
        font-size: 1rem;
    }
}