/**
 * BMT STORE - Global Media Player Styles
 * Modern floating player with animations
 * 
 * @author BMT Team
 * @version 2.0.0
 */

/* ============================================
   Body padding when player is visible
   Prevents footer from being hidden behind player
   ============================================ */
body.bmt-player-active {
    padding-bottom: 80px; /* 72px player + 8px margin */
}

body.bmt-player-guest-bar {
    padding-bottom: 64px; /* 56px guest bar + 8px margin */
}

/* ============================================
   Global Player Container
   ============================================ */
.bmt-global-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: linear-gradient(180deg, rgba(15, 15, 15, 0.98) 0%, rgba(10, 10, 10, 0.99) 100%);
    border-top: 1px solid rgba(255, 235, 59, 0.3);
    z-index: 9999;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.6);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.bmt-global-player.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Player Inner Layout */
.bmt-player-inner {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 16px;
}

/* ============================================
   Cover Image
   ============================================ */
.bmt-player-cover {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    position: relative;
}

.bmt-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bmt-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

/* ============================================
   Track Info
   ============================================ */
.bmt-player-info {
    min-width: 120px;
    max-width: 200px;
    flex-shrink: 0;
}

.bmt-track-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.bmt-track-artist {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Main Controls (Play/Pause)
   ============================================ */
.bmt-player-controls {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
}

.bmt-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
}

.bmt-ctrl-btn:hover {
    background: rgba(255, 235, 59, 0.15);
    color: #ffeb3b;
    transform: scale(1.08);
}

.bmt-ctrl-btn:active {
    transform: scale(0.95);
}

.bmt-ctrl-btn.active {
    color: #ffeb3b;
    background: rgba(255, 235, 59, 0.2);
}

.bmt-ctrl-btn.hidden {
    display: none;
}

/* Play Button Special Styling */
.bmt-play-btn {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    aspect-ratio: 1 / 1 !important;
    flex-shrink: 0 !important;
    border: 2px solid #ffeb3b !important;
    background: rgba(255, 235, 59, 0.1) !important;
    box-sizing: border-box !important;
    padding: 0 !important;
}

.bmt-play-btn:hover {
    background: rgba(255, 235, 59, 0.25);
    box-shadow: 0 0 20px rgba(255, 235, 59, 0.4);
}

.bmt-play-btn.playing {
    background: rgba(255, 235, 59, 0.2);
    animation: pulse-play 2s infinite;
}

@keyframes pulse-play {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 235, 59, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 235, 59, 0.6);
    }
}

/* Loading State */
.bmt-play-btn.loading .icon-play,
.bmt-play-btn.loading .icon-pause {
    opacity: 0.3;
}

.bmt-play-btn .btn-loader {
    display: none;
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-top-color: #ffeb3b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.bmt-play-btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Progress Section
   ============================================ */
.bmt-player-progress-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bmt-time-current,
.bmt-time-total {
    font-size: 11px;
    color: #888;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: center;
}

.bmt-time-current {
    color: #ffeb3b;
}

/* Progress Bar */
.bmt-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s;
}

.bmt-progress-bar:hover {
    height: 8px;
}

.bmt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffeb3b 0%, #ffc107 100%);
    border-radius: 3px;
    position: relative;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.4);
}

/* Progress Handle (appears on hover) */
.bmt-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 14px;
    height: 14px;
    background: #ffeb3b;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.8);
    transition: transform 0.2s;
}

.bmt-progress-bar:hover .bmt-progress-fill::after {
    transform: translateY(-50%) scale(1);
}

/* Hidden range input for seeking */
.bmt-progress-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

/* ============================================
   Right Controls
   ============================================ */
.bmt-player-right-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Volume Wrapper */
.bmt-volume-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.bmt-volume-slider-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease, padding 0.3s ease;
    display: flex;
    align-items: center;
}

.bmt-volume-wrapper:hover .bmt-volume-slider-wrapper,
.bmt-volume-wrapper:focus-within .bmt-volume-slider-wrapper {
    width: 80px;
    padding-left: 8px;
}

.bmt-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.bmt-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffeb3b;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(255, 235, 59, 0.6);
    transition: transform 0.2s;
}

.bmt-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.bmt-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffeb3b;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(255, 235, 59, 0.6);
}

/* Buy Link */
.bmt-buy-link {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%);
    border: 1px solid rgba(255, 235, 59, 0.3);
    border-radius: 4px;
    color: #ffeb3b !important;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    white-space: nowrap;
}

.bmt-buy-link:hover {
    background: rgba(255, 235, 59, 0.25);
    border-color: #ffeb3b;
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.3);
}

/* Close Button */
.bmt-close-btn {
    margin-left: 8px;
}

.bmt-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ============================================
   Toast Notification
   ============================================ */
.bmt-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.bmt-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   Guest Message (non-authorized users)
   ============================================ */
.bmt-player-guest {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(180deg, rgba(15, 15, 15, 0.95) 0%, rgba(10, 10, 10, 0.98) 100%);
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 9999;
}

.bmt-player-guest-text {
    color: #888;
    font-size: 14px;
}

.bmt-player-guest-link {
    color: #ffeb3b !important;
    text-decoration: none !important;
    font-weight: 600;
    padding: 8px 20px;
    background: rgba(255, 235, 59, 0.1);
    border: 1px solid rgba(255, 235, 59, 0.3);
    border-radius: 6px;
    transition: all 0.2s;
}

.bmt-player-guest-link:hover {
    background: rgba(255, 235, 59, 0.2);
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.3);
}

/* ============================================
   Filter Change Modal
   ============================================ */
.bmt-filter-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.bmt-filter-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.bmt-filter-modal {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.bmt-filter-modal-overlay.show .bmt-filter-modal {
    transform: scale(1);
}

.bmt-filter-modal-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 2px;
    margin-bottom: 12px;
    color: #fff;
}

.bmt-filter-modal-text {
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.bmt-filter-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.bmt-filter-modal-btn {
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bmt-filter-modal-btn.primary {
    background: #ef4444;
    color: #fff;
}

.bmt-filter-modal-btn.primary:hover {
    background: #dc2626;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.bmt-filter-modal-btn.secondary {
    background: #333;
    color: #fff;
    border: 1px solid #555;
}

.bmt-filter-modal-btn.secondary:hover {
    background: #444;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .bmt-global-player {
        height: 64px;
    }
    
    .bmt-player-inner {
        padding: 0 12px;
        gap: 10px;
    }
    
    .bmt-player-cover {
        width: 44px;
        height: 44px;
    }
    
    .bmt-player-info {
        max-width: 100px;
        min-width: 80px;
    }
    
    .bmt-track-title {
        font-size: 13px;
    }
    
    .bmt-track-artist {
        font-size: 11px;
    }
    
    .bmt-play-btn {
        width: 42px;
        height: 42px;
    }
    
    .bmt-ctrl-btn {
        width: 36px;
        height: 36px;
    }
    
    /* Hide some controls on tablet */
    .bmt-volume-wrapper,
    .bmt-repeat-btn {
        display: none;
    }
    
    .bmt-time-current,
    .bmt-time-total {
        font-size: 10px;
        min-width: 30px;
    }
    
    .bmt-buy-link {
        padding: 5px 10px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .bmt-global-player {
        height: 60px;
    }
    
    .bmt-player-inner {
        padding: 0 8px;
        gap: 8px;
    }
    
    .bmt-player-cover {
        width: 40px;
        height: 40px;
        border-radius: 4px;
    }
    
    .bmt-player-info {
        max-width: 80px;
        min-width: 60px;
    }
    
    .bmt-track-title {
        font-size: 12px;
    }
    
    .bmt-track-artist {
        font-size: 10px;
    }
    
    .bmt-play-btn {
        width: 38px;
        height: 38px;
    }
    
    .bmt-play-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* Hide progress times on small screens */
    .bmt-time-current,
    .bmt-time-total {
        display: none;
    }
    
    /* Hide download on mobile */
    .bmt-download-btn {
        display: none;
    }
    
    .bmt-buy-link span {
        display: none;
    }
    
    .bmt-buy-link::before {
        content: 'Buy';
    }
}

/* ============================================
   Add padding to body when player is visible
   ============================================ */
body.bmt-player-active {
    padding-bottom: 72px;
}

@media (max-width: 768px) {
    body.bmt-player-active {
        padding-bottom: 64px;
    }
}

@media (max-width: 480px) {
    body.bmt-player-active {
        padding-bottom: 60px;
    }
}

/* ============================================
   Filter Change Modal Dialog
   ============================================ */
.bmt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.bmt-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bmt-modal {
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid rgba(255, 235, 59, 0.4);
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bmt-modal-overlay.active .bmt-modal {
    transform: translateY(0) scale(1);
}

.bmt-modal-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    color: #ffeb3b;
    letter-spacing: 1px;
    margin-bottom: 16px;
    text-align: center;
}

.bmt-modal-text {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 28px;
}

.bmt-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.bmt-modal-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    padding: 12px 28px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bmt-modal-btn-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

.bmt-modal-btn-cancel:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.bmt-modal-btn-confirm {
    background: #ffeb3b;
    color: #000;
}

.bmt-modal-btn-confirm:hover {
    background: #fff176;
    transform: translateY(-1px);
}

.bmt-modal-btn-confirm:active {
    transform: translateY(0);
}
