/* ==========================================================================
   My Vault - Playlist UI Styles
   Prefixed selectors used throughout to override BuddyBoss theme defaults.
   ========================================================================== */

/* --- Reset scope ----------------------------------------------------------- */

#mmf-my-vault,
#mmf-my-vault * {
    box-sizing: border-box;
}

/* --- Layout ---------------------------------------------------------------- */

#mmf-my-vault {
    padding-bottom: 130px;
    width: 100%;
}

/* --- Media Type Tabs (Music / Videos) ------------------------------------- */

#mmf-my-vault .mmf-media-tabs {
    display: flex !important;
    flex-direction: row !important;
    border-bottom: 1px solid #444;
    margin-bottom: 16px;
    padding: 0;
    list-style: none;
}

#mmf-my-vault .mmf-media-tab {
    flex: 1 1 50% !important;
    display: block !important;
    text-align: center;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 500;
    color: #aaa;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
}

#mmf-my-vault .mmf-media-tab.active {
    color: #fff !important;
    border-bottom: 2px solid #7F77DD !important;
}

/* --- Playlist Filter Pills ------------------------------------------------- */

#mmf-my-vault .mmf-playlist-pills {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    list-style: none;
    position: relative;
}

#mmf-my-vault .mmf-playlist-pills::-webkit-scrollbar {
    display: none;
}

/* Fade gradient wrapper — hints that more pills exist off-screen */
#mmf-my-vault .mmf-playlist-pills-wrap {
    position: relative;
    margin-bottom: 16px;
}

#mmf-my-vault .mmf-playlist-pills-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 100%;
    background: linear-gradient( to right, transparent, rgba(0, 0, 0, 0.85) );
    pointer-events: none; /* Gradient doesn't block clicks */
    transition: opacity 0.3s;
}

/* Hide the fade when scrolled all the way to the right */
#mmf-my-vault .mmf-playlist-pills-wrap.mmf-pills-at-end::after {
    opacity: 0;
}

#mmf-my-vault .mmf-playlist-pill {
    display: inline-block !important;
    flex-shrink: 0;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #444 !important;
    background: transparent !important;
    color: #aaa !important;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    line-height: 1.4;
}

#mmf-my-vault .mmf-playlist-pill.active {
    background: rgba(127, 119, 221, 0.15) !important;
    color: #a09af0 !important;
    border-color: #7F77DD !important;
}

/* --- Playlist Pill Wrap (pill + delete button together) ------------------- */

#mmf-my-vault .mmf-playlist-pill-wrap {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    flex-shrink: 0;
    border-radius: 20px;
    border: 1px solid #444;
    overflow: hidden;
    transition: border-color 0.2s;
}

#mmf-my-vault .mmf-playlist-pills-wrap {
    position: relative;
    margin-bottom: 16px;
    overflow: hidden; /* Clips the fade gradient cleanly */
    min-width: 0;     /* Prevents flex children from overflowing */
}

#mmf-my-vault .mmf-playlist-pills {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    overflow-x: scroll !important; /* Force scroll instead of auto */
    overflow-y: visible !important;
    padding-bottom: 8px;
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    list-style: none;
    min-width: 0;
    width: 100%;
}

/* Ensure the BuddyBoss profile content area doesn't clip our scroll */
#item-body,
.item-body-inner,
.bb-profile-grid,
#mmf-my-vault {
    overflow-x: visible !important;
    min-width: 0 !important;
}

#mmf-my-vault .mmf-playlist-pills {
    cursor: grab;
}

#mmf-my-vault .mmf-playlist-pills:active {
    cursor: grabbing;
}

#mmf-my-vault .mmf-playlist-pill-wrap.mmf-pill-hidden {
    display: none !important;
}

#mmf-my-vault .mmf-playlist-pill-wrap:has(.mmf-playlist-pill.active) {
    background: rgba(127, 119, 221, 0.15);
    border-color: #7F77DD;
}

#mmf-my-vault .mmf-playlist-pill-wrap .mmf-playlist-pill {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 5px 10px 5px 14px;
}

/* Hide delete buttons by default — shown only in manage mode */
#mmf-my-vault .mmf-playlist-delete-btn {
    display: none !important;
}

/* Show delete buttons when manage mode is active */
#mmf-my-vault.mmf-manage-mode .mmf-playlist-delete-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    border-left: 1px solid #444 !important;
    color: #666 !important;
    font-size: 14px;
    line-height: 1;
    padding: 5px 8px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    box-shadow: none !important;
    border-radius: 0 !important;
}

#mmf-my-vault.mmf-manage-mode .mmf-playlist-delete-btn:hover {
    color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1) !important;
}

/* --- Manage Playlists Button -------------------------------------------- */

#mmf-my-vault .mmf-manage-playlists-wrap {
    margin-bottom: 12px;
    text-align: left;
}

#mmf-my-vault .mmf-manage-playlists-btn {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #666 !important;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

#mmf-my-vault .mmf-manage-playlists-btn:hover {
    color: #aaa !important;
}

/* In manage mode, style the Done button slightly differently */
#mmf-my-vault.mmf-manage-mode .mmf-manage-playlists-btn {
    color: #a09af0 !important;
}

/* --- Track List ------------------------------------------------------------ */

#mmf-my-vault .mmf-track-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 16px !important;
}

#mmf-my-vault .mmf-track-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #333 !important;
    background: #1a1a1a !important;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

#mmf-my-vault .mmf-track-item:hover {
    border-color: #555 !important;
    background: #222 !important;
}

#mmf-my-vault .mmf-track-item.mmf-playing {
    border-color: #7F77DD !important;
    background: background: #7F77DD !important;
}

#mmf-my-vault .mmf-track-item.mmf-sortable-ghost {
    opacity: 0.4;
}

/* Drag handle */
#mmf-my-vault .mmf-drag-handle {
    color: #555;
    font-size: 18px;
    cursor: grab;
    flex-shrink: 0;
    padding: 4px 2px;
    touch-action: none;
    line-height: 1;
    user-select: none;
}

#mmf-my-vault .mmf-drag-handle:active {
    cursor: grabbing;
}

/* Audio thumbnail — square */
#mmf-my-vault .mmf-track-thumb {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #2a2a2a;
    display: block;
}

/* Video thumbnail — 16:9 */
#mmf-my-vault .mmf-video-thumb {
    width: 72px !important;
    height: 40px !important;
    min-width: 72px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #2a2a2a;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mmf-my-vault .mmf-video-play-icon {
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Track info */
#mmf-my-vault .mmf-track-info {
    flex: 1 1 auto !important;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

#mmf-my-vault .mmf-track-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

#mmf-my-vault .mmf-track-artist {
    font-size: 12px;
    color: #888 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
    line-height: 1.3;
}

#mmf-my-vault .mmf-track-duration {
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

/* Track menu button */
#mmf-my-vault .mmf-track-menu-btn {
    background: none !important;
    border: none !important;
    color: #555;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
    box-shadow: none !important;
}

#mmf-my-vault .mmf-track-menu-btn:hover {
    color: #aaa;
}

/* --- New Playlist Button --------------------------------------------------- */

#mmf-my-vault .mmf-new-playlist-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed #444 !important;
    background: transparent !important;
    color: #888 !important;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: border-color 0.2s, color 0.2s;
    box-shadow: none !important;
}

#mmf-my-vault .mmf-new-playlist-btn:hover {
    border-color: #7F77DD !important;
    color: #a09af0 !important;
}

/* --- Empty State ----------------------------------------------------------- */

#mmf-my-vault .mmf-vault-empty {
    text-align: center;
    padding: 48px 24px;
    color: #666;
}

#mmf-my-vault .mmf-vault-empty p {
    margin-bottom: 8px;
    font-size: 14px;
}

#mmf-my-vault .mmf-vault-empty a {
    color: #7F77DD;
    text-decoration: none;
}

/* ==========================================================================
   Sticky Player
   Note: if BuddyBoss traps position:fixed, we use the JS portal fix.
   ========================================================================== */

#mmf-sticky-player {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #111 !important;
    border-top: 1px solid #333;
    padding: 10px 16px 16px;
    z-index: 999999 !important;
    display: none;
}

#mmf-sticky-player.mmf-player-visible {
    display: block !important;
}

#mmf-sticky-player .mmf-player-track-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

#mmf-sticky-player .mmf-player-thumb {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #2a2a2a;
    display: block;
}

#mmf-sticky-player .mmf-player-meta {
    flex: 1 1 auto;
    min-width: 0;
}

#mmf-sticky-player .mmf-player-title {
    font-size: 13px;
    font-weight: 500;
    color: #fff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mmf-sticky-player .mmf-player-artist {
    font-size: 11px;
    color: #888 !important;
}

#mmf-sticky-player .mmf-player-controls {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 8px;
}

#mmf-sticky-player .mmf-ctrl-btn {
    background: none !important;
    border: none !important;
    color: #aaa !important;
    cursor: pointer;
    padding: 4px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    transition: color 0.2s;
}

#mmf-sticky-player .mmf-ctrl-btn:hover {
    color: #fff !important;
}

#mmf-sticky-player .mmf-ctrl-btn.mmf-play-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: #7F77DD !important;
    color: #fff !important;
}

#mmf-sticky-player .mmf-ctrl-btn.mmf-play-btn:hover {
    background: #9590e8 !important;
}

#mmf-sticky-player .mmf-progress-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
}

#mmf-sticky-player .mmf-progress-time {
    font-size: 10px;
    color: #666 !important;
    flex-shrink: 0;
    min-width: 32px;
}

#mmf-sticky-player .mmf-progress-time:last-child {
    text-align: right;
}

#mmf-sticky-player .mmf-progress-bar {
    flex: 1 1 auto;
    height: 3px;
    background: #333;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

#mmf-sticky-player .mmf-progress-fill {
    height: 3px;
    background: #7F77DD;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

/* Hidden audio element */
#mmf-audio-engine {
    display: none !important;
}
/* ==========================================================================
   Track Menu (⋯ dropdown)
   ========================================================================== */

#mmf-my-vault .mmf-track-menu {
    position: absolute;
    right: 8px;
    top: 36px;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 4px 0;
    min-width: 180px;
    z-index: 100;
    list-style: none !important;
    margin: 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

#mmf-my-vault .mmf-track-menu-item {
    padding: 9px 14px;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

#mmf-my-vault .mmf-track-menu-item:hover {
    background: #333;
    color: #fff;
}

#mmf-my-vault .mmf-track-menu-item.mmf-menu-current {
    color: #a09af0;
    cursor: default;
}

#mmf-my-vault .mmf-track-menu-item.mmf-menu-disabled {
    color: #555;
    cursor: default;
    font-style: italic;
}

#mmf-my-vault .mmf-track-menu-item.mmf-menu-remove {
    color: #ff6b6b;
    border-top: 1px solid #333;
    margin-top: 4px;
    padding-top: 9px;
}

#mmf-my-vault .mmf-track-menu-item.mmf-menu-remove:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

/* Make track item position:relative so menu positions correctly */
#mmf-my-vault .mmf-track-item {
    position: relative;
}

/* ==========================================================================
   Video Modal Player
   ========================================================================== */

/* Prevent body scroll when modal is open */
body.mmf-modal-open {
    overflow: hidden !important;
}

#mmf-video-modal {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mmf-video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

#mmf-video-modal-content {
    position: relative;
    z-index: 1;
    width: 90vw;
    max-width: 960px;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}

#mmf-video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

#mmf-video-modal-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#mmf-video-modal-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mmf-video-modal-artist {
    font-size: 12px;
    color: #888;
}

#mmf-video-modal-close {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #aaa !important;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    transition: color 0.2s;
}

#mmf-video-modal-close:hover {
    color: #fff !important;
}

#mmf-video-engine {
    display: block !important;
    width: 100%;
    max-height: 75vh;
    background: #000;
    /* Native browser controls include a fullscreen button automatically */
}

/* Loading state — hides all tracks on initial page load until mmfFilterTracks()
   runs and reveals only the correct ones. Prevents video tracks from flashing
   in the Music tab before the filter has a chance to run. */
#mmf-my-vault.mmf-loading .mmf-track-item {
    display: none !important;
}

/* ==========================================================================
   MMF Vault — Search / Filter Box
   ========================================================================== */

.mmf-search-wrap {
    margin: 12px 0 8px;
}

.mmf-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    transition: border-color 0.2s;
}

.mmf-search-inner:focus-within {
    border-color: rgba(127, 119, 221, 0.6);
}

.mmf-search-icon {
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    flex-shrink: 0;
}

.mmf-search-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 14px;
    padding: 0 !important;
    min-width: 0;
}

.mmf-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.mmf-search-clear {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.mmf-search-clear:hover {
    color: #fff;
}/* ==========================================================================
   MMF Vault — Search / Filter Box
   ========================================================================== */

.mmf-search-wrap {
    margin: 12px 0 8px;
}

.mmf-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    transition: border-color 0.2s;
}

.mmf-search-inner:focus-within {
    border-color: rgba(127, 119, 221, 0.6);
}

.mmf-search-icon {
    color: rgba(255, 255, 255, 0.35) !important;
    font-size: 13px;
    flex-shrink: 0;
}

/* High-specificity rules to beat BuddyBoss and browser input defaults */
#mmf-my-vault .mmf-search-input,
#mmf-my-vault .mmf-search-input:focus,
#mmf-my-vault .mmf-search-input:active {
    flex: 1;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-size: 14px;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0;
    width: 100%;
}

#mmf-my-vault .mmf-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    opacity: 1;
}

.mmf-search-clear {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px !important;
    flex-shrink: 0;
    transition: color 0.2s;
}

.mmf-search-clear:hover {
    color: #ffffff;
}
