:root {
    --primary-color: #ffffff;
    --secondary-color: #b3b3b3;
    --background-color: #121212;
    --player-bg: rgba(255, 255, 255, 0.1);
    --accent-color: #b0f2c2;
    --blur-strength: 60px;
}

/* ... existing code ... */

.control-btn.active {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(176, 242, 194, 0.6);
}

/* Custom Dropdown */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 60%;
    margin-bottom: 20px;
    z-index: 100;
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    font-size: 0.9rem;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.custom-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    position: relative;
    display: block;
    padding: 10px 15px;
    font-size: 0.9rem;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.custom-option:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.custom-option.selected {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

.arrow {
    transition: transform 0.3s;
}

.custom-select.open .fa-chevron-down {
    transform: rotate(180deg);
}

/* Scrollbar for options */
.custom-options::-webkit-scrollbar {
    width: 6px;
}

.custom-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.custom-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.custom-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}


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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--primary-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0;
}

/* Add a wrapper to organize everything */
.app-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin: auto;
}

.blur-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.blur-container.active {
    opacity: 1;
}

.blur-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(var(--blur-strength)) brightness(0.4);
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

.blur-layer.active {
    opacity: 1;
}

/* Settings Menu Styles */
.settings-container {
    position: relative;
    /* Flow relative now */
}

.settings-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.settings-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.settings-modal {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.settings-modal-overlay.open .settings-modal {
    transform: scale(1) translateY(0);
}

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

.settings-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.close-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.settings-modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    color: var(--primary-color);
    font-size: 0.85rem;
}

/* iOS Toggle Switch Styles */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #39393d;
    transition: .3s;
    border-radius: 20px;
}

.ios-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.ios-slider {
    background-color: #32d74b;
}

input:checked+.ios-slider:before {
    transform: translateX(16px);
}

.gradient-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.gradient-container.active {
    opacity: 1;
}

.background-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: gradientFlow 15s ease infinite;
    filter: brightness(0.6);
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

.background-gradient.active {
    opacity: 1;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.player-container {
    background: var(--player-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.album-art-container {
    width: 250px;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    position: relative;
}

.track-number-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    pointer-events: none;
    /* Let clicks pass through if needed, though img doesn't have click events */
}

.album-art-container:hover .track-number-overlay {
    opacity: 1;
}

.album-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.track-info {
    text-align: center;
    width: 100%;
}

#track-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#artist-name {
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: 400;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

#seek-bar {
    flex-grow: 1;
    appearance: none;
    -webkit-appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

#seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

#seek-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.control-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
}

.control-btn:hover {
    color: var(--primary-color);
}

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

.control-btn.active {
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(176, 242, 194, 0.4);
}

.play-btn {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Optically center the play triangle icon */
.play-btn i.fa-play {
    margin-left: 4px;
}

.play-btn:hover {
    background: #f0f0f0;
    color: #000;
    transform: scale(1.05);
}

.volume-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: var(--secondary-color);
}

#volume-bar {
    width: 100px;
    appearance: none;
    -webkit-appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
}

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

@media (max-width: 480px) {
    .player-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        justify-content: center;
    }

    .album-art-container {
        width: 280px;
        height: 280px;
    }

    .source-code-btn {
        bottom: auto;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(5px);
    }
}

.player-container {
    /* ... existing styles ... */
    position: relative;
    /* Ensure absolute children are relative to this */
}

.bottom-area {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 10;
    width: 100%;
}

.bottom-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.source-code-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.7rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.source-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.copyright {
    color: var(--secondary-color);
    font-size: 0.8rem;
    text-align: center;
}

@media (max-width: 480px) {
    .player-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        justify-content: center;
        overflow-y: auto;
        /* Allow scrolling if needed */
        padding-bottom: 60px;
        /* Space for button */
    }

    .album-art-container {
        width: 260px;
        height: 260px;
    }
}

/* Scale down UI on short screens (e.g. 1366x768 usually has limited vertical space) */
/* Scale down UI on short screens (e.g. 1366x768 usually has limited vertical space) */
@media (max-height: 800px) {
    .app-wrapper {
        transform: scale(0.85);
        transform-origin: center top;
        /* The element is visually 15% smaller, so we pull up the bottom by 15% to remove the empty space */
        margin-bottom: -15%;
    }
}

@media (max-height: 700px) {
    .app-wrapper {
        transform: scale(0.75);
        transform-origin: center top;
        /* The element is visually 25% smaller, so we pull up the bottom by 25% */
        margin-bottom: -25%;
    }

    /* On mobile, place it in the flow at the bottom */
    .source-code-btn {
        background: transparent;
        border: none;
        color: var(--secondary-color);
        opacity: 0.6;
    }

    .bottom-area {
        position: relative;
        bottom: auto;
        transform: none;
        left: auto;
        margin-top: 10px;
        margin-bottom: 20px;
    }
}