/* =====================================================
   EDIT PROFILE – STRUCTURAL STYLES
===================================================== */

/* =========================
   CORE LAYOUT
========================= */

.profile-editor {
    max-width: 1200px;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

    .profile-header h2 {
        font-weight: 700;
        margin-bottom: 0;
    }

.profile-header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-back-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2B988F;
    text-decoration: none;
}

    .profile-back-link:hover {
        text-decoration: underline;
    }

/* =========================
   PROFILE COMPLETENESS
========================= */

.profile-completeness {
    min-width: 160px;
}

.profile-completeness-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 4px;
}

.profile-completeness-fill {
    height: 100%;
    background: linear-gradient(90deg, #2B988F, #3bbfb4);
    transition: width 0.6s ease;
}

.profile-completeness small {
    font-size: 0.7rem;
    color: #666;
    font-weight: 600;
}

/* =========================
   SECTIONS
========================= */

.profile-section {
    background: #fff;
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

    .profile-section h4 {
        font-weight: 700;
        margin-bottom: 18px;
    }

/* =========================
   MEDIA SWITCHER
========================= */

.media-switcher {
    display: inline-flex;
    background: #f1f3f6;
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.media-tab {
    border: 0;
    background: transparent;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .media-tab.active {
        background: #ffffff;
        color: #2B988F;
        box-shadow: 0 2px 6px rgba(43,152,143,0.18), 0 0 0 1px rgba(43,152,143,0.15);
    }

.media-pane {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    will-change: opacity, transform;
}

    .media-pane.active {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

/* =========================
   AVATAR
========================= */

.avatar-editor {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-preview {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    position: relative;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #2B988F;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

    .avatar-edit-btn:hover {
        background: #24897f;
    }

.avatar-helper {
    font-size: 0.75rem;
    color: #777;
    text-align: center;
}

/* =========================
   AUTOCOMPLETE
========================= */

.artist-autocomplete-wrap {
    position: relative;
}

.artist-autocomplete {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    margin-top: 6px;
    overflow: hidden;
}

    .artist-autocomplete div {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        cursor: pointer;
    }

        .artist-autocomplete div:hover {
            background: #f3f7f6;
        }

    .artist-autocomplete img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
    }

.artist-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .artist-autocomplete-item.active,
    .artist-autocomplete-item:hover {
        background: #f0f7f6;
    }

/* =========================
   FAVORITE ARTISTS
========================= */

#favoriteMusiciansBadges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 14px;
    row-gap: 28px;
    min-height: 120px;
    align-items: start;
    grid-auto-rows: auto;
}

/* =========================
   ALBUM GRID (MERGED)
========================= */

#favoriteAlbumsList,
#favoriteAuthorsList,
#favoriteBooksList,
#favoritePeopleList,
#favoriteMoviesList {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 14px;
    row-gap: 28px;
    min-height: 120px;
    align-items: start; /* critical */
    grid-auto-rows: auto; /* critical */
}


.album-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    min-width: 0;
    cursor: default;
}

.album-card.is-clickable {
    cursor: pointer;
}
/* Reorder mode wins — every list-specific .reorder-mode rule already
   sets cursor: grab on .album-card; this just keeps that consistent
   when .is-clickable is also present. */
.favorite-artist-list.reorder-mode .album-card.is-clickable,
[id^="favorite"].reorder-mode .album-card.is-clickable {
    cursor: grab;
}

/* =========================
   MORE TILE
========================= */

.album-more-tile .album-cover {
    background: #111;
    position: relative;
    cursor: pointer;
    transform: none !important;
}

.album-more-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-align: center;
    letter-spacing: 1px;
}

.album-mini-grid {
    position: absolute;
    inset: 0;
    display: grid;
    gap: 2px;
    z-index: 1;
}

    .album-mini-grid img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.album-more-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-align: center;
    z-index: 2;
    letter-spacing: 1px;
}



.album-more-tile:hover .album-cover {
    transform: none !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.6);
}

/* Show Less tile — distinct from the +X expand tile */
.album-show-less-cover {
    background: linear-gradient(145deg, #1a3a38, #0f2422) !important;
    border: 2px dashed rgba(43, 152, 143, 0.4) !important;
}

.album-show-less-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #2B988F;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.album-show-less-content .material-icons {
    font-size: 1.6rem;
    color: #2B988F;
    transition: transform 0.15s ease;
}

.album-show-less-tile:hover .album-show-less-content .material-icons {
    transform: translateY(-3px);
}

.album-show-less-tile:hover .album-show-less-cover {
    border-color: rgba(43, 152, 143, 0.75) !important;
    box-shadow: 0 6px 16px rgba(43, 152, 143, 0.2) !important;
}


#favoriteAlbumsList.reorder-mode .album-card,
#favoriteAuthorsList.reorder-mode .album-card,
#favoriteBooksList.reorder-mode .album-card,
#favoritePeopleList.reorder-mode .album-card,
#favoriteMoviesList.reorder-mode .album-card {
    cursor: grab;
}

    #favoriteAlbumsList.reorder-mode .album-card:active,
    #favoriteAuthorsList.reorder-mode .album-card:active,
    #favoriteBooksList.reorder-mode .album-card:active,
    #favoritePeopleList.reorder-mode .album-card:active,
    #favoriteMoviesList.reorder-mode .album-card:active {
        cursor: grabbing;
    }

/* Books and movies use portrait covers (2:3) — same aspect as the book
   and film posters elsewhere in the app. Album/artist/people stay 1:1. */
#favoriteBooksList .album-cover,
#favoriteMoviesList .album-cover {
    aspect-ratio: 2 / 3;
}

.album-cover {
    position: relative; /* FIX: anchor overlay correctly */
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    background: #1e1e1e;
    transition: transform .15s ease, box-shadow .15s ease;
}



/* =========================
   REORDER OVERLAY
========================= */

#favoriteAlbumsList.reorder-mode .album-cover::after,
#favoriteAuthorsList.reorder-mode .album-cover::after,
#favoriteBooksList.reorder-mode .album-cover::after,
#favoritePeopleList.reorder-mode .album-cover::after,
#favoriteMoviesList.reorder-mode .album-cover::after {
    content: "drag_indicator";
    font-family: "Material Icons";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border-radius: 8px;
    opacity: 1; /* 🔥 always visible in reorder mode */
}



    .album-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.album-card:hover .album-cover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,.4);
    z-index: 1;
}

.album-meta {
    margin-top: 18px !important;
    font-size: 12px;
    line-height: 1.3;
    padding: 0 4px;
    width: 100%;
    text-align: center;
    min-height: 32px;
}



.album-title,
.album-artist {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.album-title {
    font-weight: 600;
    color: #222;
}

.album-artist {
    font-size: 12px;
    color: #666;
    opacity: 1;
}


.album-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,.8);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    display: none;
    z-index: 3; /* ABOVE overlay */
}


.album-card:hover .album-remove {
    display: block;
}

/* =========================
   DRAG STATES
========================= */

.reorder-handle {
    margin-right: 8px;
    color: #9aa3ab;
    font-size: 14px;
    cursor: grab;
    opacity: .8;
}

.favorite-artist-row.reorder-mode .reorder-handle,
.reorder-mode .reorder-handle {
    display: inline-block;
}

.drag-ghost {
    opacity: .4;
}

.drag-chosen {
    background: rgba(255,255,255,.06);
}

.drag-dragging {
    background: rgba(43,152,143,.15);
}

/* =========================
   EMPTY STATE
========================= */

.artist-empty-state {
    min-height: 120px;
    border: 2px dashed #e3e8ef;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8a94a6;
    text-align: center;
    gap: 6px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 180ms ease, transform 180ms ease;
}

    .artist-empty-state.is-hidden {
        opacity: 0;
        transform: translateY(-6px);
        pointer-events: none;
    }

.empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(43, 152, 143, 0.12);
    color: #2B988F;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 8px;
}

/* =========================================
   STICKY SAVE FOOTER — MATCH APP STYLE
========================================= */

.profile-save-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #eaeaea;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.06);
    z-index: 1000;
}

.profile-save-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: flex-end;
}

.profile-save-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
}

    .profile-save-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        transform: none !important;
        box-shadow: none;
    }

.reorder-link {
    cursor: pointer;
    color: #2B988F;
}

.reorder-link:hover {
    text-decoration: underline;
}
/* =========================
   ARTIST REORDER MODE
========================= */

#favoriteMusiciansBadges.reorder-mode .album-card {
    cursor: grab;
}

    #favoriteMusiciansBadges.reorder-mode .album-card:active {
        cursor: grabbing;
    }

#favoriteMusiciansBadges.reorder-mode .album-cover::after {
    content: "drag_indicator";
    font-family: "Material Icons";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border-radius: 8px;
}

/* =========================
   SHIMMER PLACEHOLDER
========================= */

.profile-album-shimmer {
    min-width: 130px;
    max-width: 130px;
    height: 130px;
    border-radius: 8px;
    background: linear-gradient( 90deg, #1a1a1f 25%, #2a2a30 37%, #1a1a1f 63% );
    background-size: 400% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

/* =========================
   ARTIST SHIMMER
========================= */

.profile-artist-shimmer {
    min-width: 130px;
    max-width: 130px;
    height: 130px;
    border-radius: 8px;
    background: linear-gradient( 90deg, #1a1a1f 25%, #2a2a30 37%, #1a1a1f 63% );
    background-size: 400% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}

/* =========================
   IDENTITY — CHANGE PASSWORD SUBSECTION
========================= */
.identity-password-heading {
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
}

/* =========================
   MEDIA-PANE LOADER
   A Lottie loader that covers the pane until its picker has mounted
   and rendered (or briefly so the animation is visible even when
   render is instant). Hidden by adding .is-loaded to the .media-pane.
========================= */
.media-pane { position: relative; }
.media-pane-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    background: transparent;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
/* Hide the pane's real content until the loader finishes — only the
   Lottie is visible during load. */
.media-pane > .row,
.media-pane > .dash-empty {
    display: none;
}
.media-pane.is-loaded .media-pane-loader {
    display: none;
}
.media-pane.is-loaded > .row {
    display: flex; /* Bootstrap .row uses flex */
}
.media-pane.is-loaded > .dash-empty {
    display: block;
}
