* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #121212;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: hidden;
}

.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    filter: brightness(0.7);
    pointer-events: none;
    will-change: transform;
}

.cards-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.glass-card {
    max-width: 420px;
    margin-top: .5rem;
    margin-bottom: .5rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    background: rgba(20, 20, 20, 0.45);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    text-align: center;
}

.glass-card:hover {
    box-shadow:
        0 0 20px rgba(0, 245, 255, 0.4),
        0 0 40px rgba(123, 44, 255, 0.4);
    transition:
        opacity 0.8s ease,
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s ease;
}

.player {
    padding: 20px;
}

h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.file-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0 14px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

#fileInput {
    display: none;
}

.custom-file-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 3px 16px rgba(142, 223, 255, 0.08);
}

.custom-file-upload:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

#fileCount {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
}

.now-playing {
    color: #00f5ff;
    text-align: center;
    margin: 15px 0 10px;
    min-height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: "Source Code Pro", monospace;
    font-size: 1.2rem;
    opacity: 0.9;
}

.progress-area {
    margin: 10px 0 5px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 20px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3a86ff, #00d4ff);
    border-radius: 20px;
}

.time {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #ccc;
    margin-top: 6px;
}

.controls-wrap {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.controls-row button {
    border: 1px solid rgba(255, 255, 255, 0.267);
    border-radius: 14px;
    background: #3a85ff07;
    color: white;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 3px 16px rgba(142, 223, 255, 0.116);

    /* main fix */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.controls-row button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.controls-row button svg {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.main-controls button {
    width: 64px;
    height: 40px;
}

.main-controls .play-btn {
    width: 58px;
    height: 58px;
    border-radius: 18px;
}

.play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
}

.play-btn svg {
    width: 28px;
    height: 28px;
    display: block;

    /* 🔥 THIS FIXES CENTERING */
    transform: translateX(1.5px);
}

.main-controls .play-btn svg {
    width: 24px;
    height: 24px;
}

.secondary-controls button {
    width: 86px;
    height: 42px;
}

.secondary-controls button svg {
    width: 22px;
    height: 22px;
}

.secondary-controls button.active-btn {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #081b0f;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.08),
        0 0 18px rgba(0, 230, 118, 0.55);
    transform: translateY(-1px) scale(1.03);
}

.playlist {
    margin-top: 18px;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding-top: 12px;
    max-height: 220px;
}


.song {
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    background: #3a85ff07;
    border: 1px solid rgba(255, 255, 255, 0.267);
    color: white;
    transition: all 0.25s ease;
    font-size: 14px;
    word-break: break-word;
    text-align: center;
}

.song:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.active {
    background: rgba(255, 255, 255, 0.199) !important;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

@media (max-width: 480px) {
    .main-controls button {
        min-width: 52px;
        height: 52px;
    }

    .main-controls .play-btn {
        min-width: 66px;
        height: 52px;
    }

    .secondary-controls button {
        min-width: 110px;
        height: 40px;
    }
}

/* ===== Custom Scrollbar (Chrome, Edge, Safari) ===== */
.playlist::-webkit-scrollbar {
    width: 6px;
}

.playlist::-webkit-scrollbar-track {
    background: transparent;
}

.playlist::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    transition: 0.3s;
}

.playlist::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}

/* ===== Firefox ===== */
.playlist {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* ===== Scroll Fade Effect ===== */
.playlist {
    position: relative;
    overflow-y: auto;
}

/* TOP FADE */
.playlist::before {
    content: "";
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
    z-index: 2;

    background: linear-gradient(to bottom,
            rgba(18, 18, 18, 0.9),
            rgba(18, 18, 18, 0));
}

/* BOTTOM FADE */
.playlist::after {
    content: "";
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
    z-index: 2;

    background: linear-gradient(to top,
            rgba(18, 18, 18, 0.9),
            rgba(18, 18, 18, 0));
}