
body, html {
    height: 100%;
    margin: 0;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    position: relative;
}

.music-widget {
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border-radius: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 350px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    direction: rtl;
    right: 30%;
}

.music-widget-detail {
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border-radius: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 350px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    direction: rtl;
}

@media (max-width: 768px) {
    .main-container {
        display: block;
        align-items: center;
    }

    .music-widget {
        flex: none;
        width: 100%;
        max-width: 400px;
        margin-top: 0px;
        margin-left: 102px;
    }
}

.album-section {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.player {
    margin-top: 20px;
    display: flex;
    justify-content: center; /* افقی وسط */
    align-items: center; /* عمودی وسط (اگه لازم شد) */
}

    .player audio {
        width: 100%;
        max-width: 280px; /* محدودیت عرض برای اینکه وسط قشنگ بشینه */
        border-radius: 8px;
    }




.album-art {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-left: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

    .album-art img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.song-info {
    flex-grow: 1;
    position: relative;
}

.song-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.download-icon {
    margin-right: 8px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
    position: relative;
}

    .download-icon:hover {
        color: #ff6b6b;
    }

.download-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #2d2d2d;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    padding: 8px 0;
    min-width: 140px;
    z-index: 10;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .download-dropdown.show {
        display: block;
    }

.download-option {
    padding: 8px 12px;
    color: #e0e0e0;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: background 0.2s;
    font-size: 0.85rem;
}

    .download-option:hover {
        background: rgba(255, 107, 107, 0.1);
        color: #ff6b6b;
    }

    .download-option i {
        margin-left: 6px;
        font-size: 0.8rem;
    }

.song-artist {
    font-size: 0.9rem;
    color: #aaa;
    display: block;
    text-align: right;
}

.progress-area {
    margin-bottom: 15px;
}

.progress-bar {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 5px;
    position: relative;
}

.progress {
    height: 100%;
    width: 30%;
    background: linear-gradient(to right, #de4f32, #ff6b6b);
    border-radius: 2px;
    transition: width 0.1s linear;
    position: relative;
}

    .progress::after {
        content: '';
        position: absolute;
        left: -4px;
        top: 50%;
        transform: translateY(-50%);
        width: 12px;
        height: 12px;
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 0 5px rgba(255, 107, 107, 0.8);
        opacity: 0;
        transition: opacity 0.2s;
    }

.progress-bar:hover .progress::after {
    opacity: 1;
}

.timer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #777;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.controls-track {
    display: flex;
    justify-content: center;
    align-items: center;
}


.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .control-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ff6b6b;
    }

.play-pause {
    width: 44px;
    height: 44px;
    background: #de4f32;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

    .play-pause:hover {
        background: #ff4d79;
        transform: scale(1.05);
    }

.volume-control {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.volume-icon {
    margin-left: 8px;
    font-size: 1rem;
    color: #aaa;
}

.volume-slider {
    flex-grow: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-progress {
    height: 100%;
    width: 80%;
    background: linear-gradient(to right, #de4f32, #ff6b6b);
    border-radius: 2px;
}

.playlist-toggle {
    text-align: center;
    margin-top: 15px;
}

.toggle-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: color 0.2s;
    gap: 6px;
}

    .toggle-btn:hover {
        color: #ff6b6b;
    }

    .toggle-btn i {
        margin-left: 5px;
        transition: transform 0.3s;
    }

.playlist {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 10px;
}

    .playlist.show {
        max-height: 200px;
    }

.playlist-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 5px;
    justify-content: space-between;
    color: white;
}

    .playlist-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .playlist-item.active {
        background: rgba(255, 51, 102, 0.2);
        color: #ff6b6b;
    }

.playlist-item-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.playlist-item i {
    margin-left: 8px;
    font-size: 0.7rem;
}

.playlist-download {
    color: #aaa;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
    padding: 4px 6px;
    border-radius: 4px;
}

    .playlist-download:hover {
        color: #ff6b6b;
        background: rgba(255, 107, 107, 0.1);
    }

/* اسکرول بار سفارشی */
.playlist::-webkit-scrollbar {
    width: 4px;
}

.playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.playlist::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.5);
    border-radius: 10px;
}

#downloads {
    display: grid;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    color: white;
}

    #downloads > span {
        display: flex;
        gap: 5px;
        margin-bottom: 6px;
    }

        #downloads > span:hover {
            color: rgba(255, 107, 107);
            transition: all 300ms;
            cursor: pointer;
        }

        #downloads > span > svg {
            width: 20px;
        }

    #downloads a {
        display: flex;
        gap: 5px;
        margin-bottom: 6px;
        color: white;
        text-decoration: none;
    }

        #downloads a:hover {
            color: rgba(255, 107, 107);
        }





.playlist-download > svg {
    width: 20px;
}

.custom-svg-size {
    width: 18px;
}


.music-section {
    position: absolute;
    padding: 20px;
}



.backdrop {
    background-color: #000000cc;
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    backdrop-filter: blur(3px);
}


.download-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* تو موبایل بیاد زیر هم */
}

.download-btn {
    background-color: #de4f32;
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
}

    .download-btn:hover {
        background-color: #b53c25;
    }


@media (max-width: 768px) {
    .download-buttons {
        flex-wrap: nowrap; /* دکمه‌ها دیگه زیر هم نمیرن */
        justify-content: center; /* وسط چین هم باشن */
    }

    .download-btn {
        flex: 1; /* هر کدوم نصف عرض بگیرن */
        text-align: center; /* متن بیاد وسط */
    }
}
