/**
 * Archive Album Styles
 * Styles for archive-melodica_album.php template
 *
 * @package Melodica
 */

/* Album Archive Grid */
.albums-grid-album {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    /* overflow-x: auto !important; */
    /* overflow-y: hidden !important; */
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding-bottom: 10px;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    align-items: center;
    align-content: center;
    justify-items: center;
    align-self: center;
    justify-self: center;
    padding-bottom: 100px !important;
}

.albums-grid-album.loading {
    position: relative;
}

.albums-grid-album.loading::after {
    content: ' ';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .25);
    border-radius: 16px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Album Card */
.album-card-album {
    background: var(--color-primary-violet);
    border: 0px solid var(--color-gray-700);
    border-radius: 18px;
    padding: 12px;
    width: calc(25% - .94rem);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
    width: 236px !important;
    position: relative;
    overflow: visible;
}

.album-card-album:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    z-index: 100;
}

/* Album Cover */
.album-cover-album {
    position: relative;
    display: block;
    border-radius: 14px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1;
}

.album-cover-album img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.album-card-album:hover .album-cover-album img {
    transform: scale(1.05);
}

/* Album Overlay */
.album-overlay-album {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.album-card-album:hover .album-overlay-album {
    opacity: 1;
}

/* Play Button */
.play-btn-album {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-btn-album:hover {
    background: white;
    transform: scale(1.1);
}

.play-btn-album svg {
    width: 24px;
    height: 24px;
    fill: #333;
}

/* Album Info */
.album-info-album {
    padding: 10px 0;
}

.album-title-album {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.album-artist-album {
    font-size: 0.9rem;
    color: #cccccc;
    margin: 0;
}

/* Album Actions */
.album-actions-album {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.album-like-btn-album,
.album-download-btn-album,
.album-more-btn-album {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.album-like-btn-album:hover,
.album-download-btn-album:hover,
.album-more-btn-album:hover {
    background: rgba(255, 255, 255, 0.1);
}

.album-like-btn-album svg,
.album-download-btn-album svg,
.album-more-btn-album svg {
    width: 18px;
    height: 18px;
}

/* دکمه‌های Actions بدون -album */
.album-like-btn,
.album-download-btn,
.album-more-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.album-like-btn:hover,
.album-download-btn:hover,
.album-more-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.album-like-btn svg,
.album-download-btn svg,
.album-more-btn svg {
    width: 18px;
    height: 18px;
}

/* Liked state */
.album-like-btn.liked {
    background: var(--overlay-purple-245-20);
    color: var(--color-purple);
}

.album-like-btn.liked:hover {
    background: var(--overlay-purple-30);
}

/* Disabled state */
.album-like-btn:disabled,
.album-like-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Processing state */
.album-like-btn.processing {
    opacity: 0.7;
    pointer-events: none;
}

/* Duration Overlay */
.duration-overlay-album {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .album-card-album {
        width: calc(33.333% - .84rem);
    }
}

@media (max-width: 768px) {
    .albums-grid-album {
        grid-template-columns: repeat(2, 1fr);
        /* overflow-x: auto; */
        flex-wrap: wrap;
        padding-bottom: 8px;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        display: flex
        ;
                justify-content: center;
    }

    .album-card-album {
        width: 185px !important;
        min-width: 190px;
        flex-shrink: 0;
        background: var(--color-primary-deep) !important;
        box-shadow: 0 0px 5px rgb(35 35 35 / 81%);
    }

    .pagination-wrapper .page-numbers {
        gap: 0.25rem;
    }

    .pagination-wrapper .page-numbers a,
    .pagination-wrapper .page-numbers span {
        min-width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .album-card-album {
        width: 160px !important;
        min-width: 160px;
    }

    .album-title-album {
        font-size: 1rem;
    }

    .album-artist-album {
        font-size: 0.8rem;
    }

    .pagination-wrapper .page-numbers {
        gap: 0.25rem;
    }

    .pagination-wrapper .page-numbers a,
    .pagination-wrapper .page-numbers span {
        min-width: 32px;
        height: 32px;
        font-size: 0.85rem;
        padding: 0 8px;
    }
}

/* ========================================
   Pagination
   ======================================== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.pagination-wrapper .page-numbers {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-wrapper .page-numbers li {
    margin: 0;
}

.pagination-wrapper .page-numbers a,
.pagination-wrapper .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--color-primary-violet);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid var(--color-gray-600);
}

.pagination-wrapper .page-numbers a:hover {
    background: var(--color-purple);
    color: white;
    transform: translateY(-2px);
    border-color: var(--color-purple);
    box-shadow: 0 4px 12px var(--shadow-purple-30);
}

.pagination-wrapper .page-numbers .current {
    background: var(--color-purple);
    color: white;
    font-weight: 600;
    border-color: var(--color-purple);
    box-shadow: 0 4px 12px var(--shadow-purple-30);
}

.pagination-wrapper .page-numbers .prev,
.pagination-wrapper .page-numbers .next {
    padding: 0 16px;
}

/* Archive Page Sidebar Styles */
.search-filters-sidebar-album {
    padding: 0px !important;
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-content: flex-start;
    align-items: flex-start;
}

.archive-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

/* Search Input */
.search-input-wrapper-album {
    display: flex;
    align-items: center;
    background-color: var(--color-primary-violet);
    border-radius: 12px;
    width: 290px;
    padding: 5px;
    position: relative;
}

.search-btn-album {
    background-color: var(--color-purple) !important;
    border: none;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: absolute;
    left: 5px;
    color: var(--color-purple) !important;
}

.search-btn-album:hover {
    background-color: var(--color-purple) !important;
    opacity: 0.9;
}

.search-btn-album svg {
    color: var(--color-purple) !important;
}

.search-btn-album svg rect {
    fill: var(--color-purple) !important;
}

.search-btn-album svg path {
    fill: var(--color-dark-bg) !important;
}

.search-input-album {
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 10px 15px;
    font-size: 16px;
    width: 100%;
}

.search-input-album::placeholder {
    color: #888888;
}

.search-input-album:focus {
    outline: none;
}

/* Search Results Dropdown */
.search-results-album {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary-deep);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(152, 0, 245, 0.2);
}

.search-result-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    margin-left: 12px;
}

.search-result-info h4 {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.search-result-info p {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 0;
}

.search-loading,
.search-error,
.no-search-results {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Archive Page Title */
.archive-page-title {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

/* Filter Section */
.filter-section-album {
    width: 100%;
}

.filter-title-album {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

/* Custom Dropdown */
.custom-dropdown-album {
    position: relative;
    width: 100%;
}

.dropdown-toggle-album {
    width: 100%;
    background: var(--color-primary-violet);
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropdown-toggle-album:hover {
    /* background: rgba(152, 0, 245, 0.3); */
}

.selected-text-album {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
}

.dropdown-toggle-album svg {
    transition: transform 0.3s ease;
}

.custom-dropdown-album.open .dropdown-toggle-album svg {
    transform: rotate(180deg);
}

.dropdown-menu-album {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    /* background: var(--color-primary-deep); */
    border-radius: 12px;
    padding: 0px;
    list-style: none;
    /* margin: 0; */
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.custom-dropdown-album.open .dropdown-menu-album {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item-album {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    background: var(--color-primary-violet);
}

.dropdown-item-album:hover {
    /* background: rgba(152, 0, 245, 0.2); */
    color: var(--text-primary);
}

.dropdown-item-album.active {
    background: var(--color-primary-violet);
    color: var(--text-primary);
    font-weight: 600;
}

/* Radio Button Style inside Dropdown */
.radio-custom-album {
    width: 20px;
    height: 20px;
    border: 2px solid #D2D2D2;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    background: transparent;
    flex-shrink: 0;
    display: flex;
    align-content: center;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
}

.radio-custom-album.checked {
    border-color: var(--color-purple) !important;
}

.radio-custom-album.checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--color-purple) !important;
    border-radius: 50%;
}

.radio-custom-album.checked svg {
    display: none;
}

.radio-custom-album.checked svg circle {
    fill: var(--color-purple) !important;
}
}

/* ========================================
   Archive Album Dropdown Menu (سه نقطه)
   ======================================== */
.album-actions .dropdown-container {
    position: relative;
    z-index: 10;
}

.dropdown-container:hover {
    z-index: 9999;
}

.archive-album-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #030C24;
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--overlay-purple-30);
}

.dropdown-container:hover .archive-album-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.archive-album-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.archive-album-dropdown-item:hover {
    background: rgba(152, 0, 245, 0.2);
    color: #FFFFFF;
    text-decoration: none;
}

.archive-album-dropdown-item svg {
    flex-shrink: 0;
}