/* ============================================
   OZ REEZ STICKY AUDIO PLAYER - CLEAN CSS
   ============================================
   Layout: Left (cover + title) | Center (controls) | Right (price)
   Responsive: Desktop > Tablet > Phone
   ============================================ */

/* ===========================================
   CSS RESET & BASE STYLES
   =========================================== */

.oz-reez-player-container * {
    box-sizing: border-box;
}

.oz-reez-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #000;
    color: #fff;
    z-index: 9999;
    border-top: 1px solid #333;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.5);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ===========================================
   PROGRESS BAR
   =========================================== */

.oz-reez-progress-bar {
    position: relative;
    height: 4px;
    background: #333;
    cursor: pointer;
    width: 100%;
}

.oz-reez-progress {
    height: 100%;
    background: #D8D8D8;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

/* Seek Handle (Ball) - positioned at the end of progress */
.oz-reez-seek-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #D8D8D8;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

/* Show handle on hover or when dragging */
.oz-reez-progress-bar:hover .oz-reez-seek-handle,
.oz-reez-progress-bar.dragging .oz-reez-seek-handle,
.oz-reez-seek-handle.active {
    opacity: 1;
}

/* Larger touch target for mobile */
.oz-reez-seek-handle::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
}

/* Scale up on hover/active - NO pink */
.oz-reez-seek-handle:hover,
.oz-reez-seek-handle:active,
.oz-reez-seek-handle.active {
    transform: translateY(-50%) scale(1.2);
    background: #D8D8D8;
}

/* Mobile: always show handle for better UX */
@media (hover: none) and (pointer: coarse) {
    .oz-reez-seek-handle {
        opacity: 1;
        width: 14px;
        height: 14px;
        right: -7px;
    }
}

.oz-reez-seek-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.oz-reez-seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #3176CE;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.oz-reez-seek-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #3176CE;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.oz-reez-progress-bar:hover .oz-reez-seek-slider::-webkit-slider-thumb,
.oz-reez-progress-bar:hover .oz-reez-seek-slider::-moz-range-thumb {
    opacity: 1;
}

/* ===========================================
   MAIN PLAYER WRAPPER
   3 Equal-Width Containers Layout
   =========================================== */

.oz-reez-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
    min-height: 70px;
}

/* ===========================================
   LEFT SECTION: Cover Art + Track Info
   Container 1 - Equal width with flex: 1
   =========================================== */

.oz-reez-player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0; /* Allow shrinking */
    max-width: 33.33%;
}

.oz-reez-cover-art {
    width: 50px;
    height: 50px;
    border-radius: 2px;
    overflow: hidden;
    background: #222;
    flex-shrink: 0;
}

.oz-reez-cover-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.oz-reez-track-info {
    flex: 1;
    min-width: 0;
}

.oz-reez-track-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.oz-reez-track-title span {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

/* Title Link - Desktop only clickable with underline hover */
.oz-reez-title-link {
    color: #fff;
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Desktop: underline on hover */
@media (hover: hover) and (pointer: fine) {
    .oz-reez-title-link:hover {
        text-decoration: underline;
        text-underline-offset: 2px;
    }
}

/* Mobile/Tablet: clickable with underline on tap */
@media (hover: none) and (pointer: coarse) {
    .oz-reez-title-link {
        /* Allow clicks on mobile/tablet for navigation */
        pointer-events: auto;
        cursor: pointer;
        /* Prevent tap highlight */
        -webkit-tap-highlight-color: transparent;
    }
    .oz-reez-title-link:hover,
    .oz-reez-title-link:focus {
        text-decoration: none;
    }
    /* Underline on tap (active state) for mobile feedback */
    .oz-reez-title-link:active {
        text-decoration: underline;
        text-underline-offset: 2px;
    }
}

/* Prevent color changes on all states */
.oz-reez-title-link,
.oz-reez-title-link:hover,
.oz-reez-title-link:active,
.oz-reez-title-link:focus,
.oz-reez-title-link:visited {
    color: #fff !important;
}

.oz-reez-track-meta {
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================================
   CENTER SECTION: Playback Controls
   Container 2 - Desktop layout: [Repeat] [Prev/Play/Next] [Volume]
   Play/Pause/Prev/Next always perfectly centered
   =========================================== */

.oz-reez-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 33.33%;
    position: relative;
}

/* Main controls wrapper */
.oz-reez-main-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Desktop: Layout [Repeat] [Prev/Play/Next] [Volume] */
@media (min-width: 768px) {
    .oz-reez-player-controls {
        justify-content: space-between;
        gap: 0;
    }
    
    /* Left control (Repeat) - fixed width for symmetry */
    .oz-reez-control-left {
        flex: 0 0 50px;
        display: flex;
        justify-content: flex-start;
    }
    
    /* Main controls container - centered, takes remaining space */
    .oz-reez-main-controls {
        flex: 1;
        justify-content: center;
        gap: 8px;
    }
    
    /* Right control (Volume) - fixed width for symmetry */
    .oz-reez-control-right {
        flex: 0 0 50px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    
    /* Volume control container - positioned for vertical popup above icon */
    .oz-reez-volume-control {
        position: relative;
        display: flex;
        align-items: center;
        min-width: auto;
        gap: 0;
    }
    
    /* Volume slider container - appears ABOVE the mute button */
    .oz-reez-volume-control::before {
        content: '';
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 15px;
        background: transparent;
        pointer-events: none;
    }
    
    /* Volume slider - VERTICAL, positioned directly above the volume icon */
    .oz-reez-volume-slider {
        display: block;
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%) rotate(-90deg);
        transform-origin: center center;
        width: 80px;
        height: 4px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        background: #000000;
        border-radius: 2px;
        cursor: pointer;
        pointer-events: none;
        -webkit-appearance: none;
        appearance: none;
        padding: 8px 0;
        box-sizing: content-box;
        outline: none;
    }
    
    /* Hover bridge - invisible area to maintain hover when moving to slider */
    .oz-reez-volume-control:hover::before {
        pointer-events: auto;
    }
    
    /* Show volume slider on hover */
    .oz-reez-volume-control:hover .oz-reez-volume-slider {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* Slider track styling - dark background matching player */
    .oz-reez-volume-slider::-webkit-slider-runnable-track {
        width: 100%;
        height: 4px;
        background: linear-gradient(to right, #3176ce 0%, #3176ce var(--volume-percent, 70%), #333 var(--volume-percent, 70%), #333 100%);
        border-radius: 2px;
    }
    
    .oz-reez-volume-slider::-moz-range-track {
        width: 100%;
        height: 4px;
        background: #333;
        border-radius: 2px;
    }
    
    .oz-reez-volume-slider::-moz-range-progress {
        background: #3176ce;
        height: 4px;
        border-radius: 2px;
    }
    
    /* Slider thumb styling */
    .oz-reez-volume-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 12px;
        height: 12px;
        background: #fff;
        border-radius: 50%;
        cursor: pointer;
        margin-top: -4px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    }
    
    .oz-reez-volume-slider::-moz-range-thumb {
        width: 12px;
        height: 12px;
        background: #fff;
        border-radius: 50%;
        cursor: pointer;
        border: none;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    }
}

/* Phone/Tablet: Hide repeat and volume, show only main controls */
@media (max-width: 767px) {
    .oz-reez-control-left,
    .oz-reez-control-right {
        display: none !important;
    }
    
    .oz-reez-player-controls {
        justify-content: center;
    }
}

/* ===========================================
   BUTTON STYLES - NO PINK OVERLAYS
   =========================================== */

.oz-reez-btn {
    background: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
    font-size: 16px;
    width: 40px;
    height: 40px;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* Secondary buttons (prev/next) - transparent background always */
.oz-reez-btn-secondary,
.oz-reez-btn-secondary:hover,
.oz-reez-btn-secondary:focus,
.oz-reez-btn-secondary:active,
.oz-reez-btn-secondary:visited {
    background: transparent !important;
    background-color: transparent !important;
    color: #ccc;
    transform: none !important;
}

.oz-reez-btn-secondary:hover {
    color: #fff;
    transform: none !important;
}

.oz-reez-btn-secondary:active {
    transform: none !important;
}

/* Primary button (play/pause) - #3176CE background, NO pink */
.oz-reez-btn-primary {
    background: #3176CE !important;
    background-color: #3176CE !important;
    color: #fff !important;
    width: 50px;
    height: 50px;
    font-size: 18px;
}

.oz-reez-btn-primary:hover,
.oz-reez-btn-primary:focus,
.oz-reez-btn-primary:active,
.oz-reez-btn-primary:visited {
    background: #2A63AE !important;
    background-color: #2A63AE !important;
    color: #fff !important;
    transform: none;
}

.oz-reez-btn-primary:active {
    transform: none;
}

/* Repeat icon "1" indicator - hidden by default */
.oz-repeat-icon .oz-repeat-one {
    display: none;
    opacity: 0;
}

/* Repeat button active state - Spotify-style: show "1", no color change */
.oz-reez-btn[id="oz-reez-repeat"].active {
    background: transparent !important;
}

.oz-reez-btn[id="oz-reez-repeat"].active .oz-repeat-one {
    display: block;
    opacity: 1;
}

/* Remove focus outlines */
.oz-reez-btn:focus,
.oz-reez-btn:active,
#oz-reez-play-pause:focus,
#oz-reez-play-pause:active {
    outline: none !important;
    box-shadow: none !important;
}

/* ===========================================
   VOLUME CONTROL - Base styles (mobile/fallback)
   =========================================== */

.oz-reez-volume-control {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: auto;
    position: relative;
}

/* Hide slider by default on mobile - only show mute button */
.oz-reez-volume-slider {
    display: none;
}

/* Mute button styling */
#oz-reez-mute {
    position: relative;
    z-index: 1;
}

/* Modern SVG Volume Icon - matches repeat icon style */
.oz-volume-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
    transition: color 0.2s ease;
    position: relative;
}

.oz-volume-icon path {
    transition: opacity 0.2s ease;
}

/* Muted state - show X slash through speaker */
.oz-volume-icon.muted .oz-volume-speaker {
    opacity: 0.5;
}

.oz-volume-icon.muted .oz-volume-wave-1,
.oz-volume-icon.muted .oz-volume-wave-2 {
    opacity: 0 !important;
    display: none !important;
}

/* X slash indicator for muted state */
.oz-volume-icon .oz-volume-mute-x {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.oz-volume-icon.muted .oz-volume-mute-x {
    display: block;
    opacity: 1;
}

/* Ensure icon inherits button color */
#oz-reez-mute:hover .oz-volume-icon {
    color: #fff;
}

/* ===========================================
   RIGHT SECTION: Cart/Price Button
   Container 3 - Equal width, right aligned
   =========================================== */

.oz-reez-cart-section {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    max-width: 33.33%;
}

.beat-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3176CE !important;
    background-color: #3176CE !important;
    color: #fff !important;
    padding: 8px 14px;
    border: none;
    border-radius: 2px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.beat-price i {
    margin-right: 6px !important;
    display: inline-block;
    font-size: 0.95rem;
}

/* Cart button - NO pink on any state */
.beat-price:hover,
.beat-price:focus,
.beat-price:active,
.beat-price:visited {
    background: #2A63AE !important;
    background-color: #2A63AE !important;
    color: #fff !important;
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

.beat-price:hover {
    transform: none;
}

/* ===========================================
   LIKE BUTTON (Hidden)
   =========================================== */

.oz-reez-like-btn {
    display: none !important;
}

/* ===========================================
   UTILITY STATES
   =========================================== */

.oz-reez-player-container.loading .oz-reez-btn-primary {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.oz-reez-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.oz-reez-btn:disabled:hover {
    transform: none;
    background: transparent;
}

.oz-reez-player-notice {
    background: #ff6b6b;
    color: #fff;
    padding: 15px 20px;
    text-align: center;
    font-weight: 500;
    border-radius: 8px;
    margin: 20px;
}

/* ===========================================
   TABLET STYLES (768px - 1024px)
   =========================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    .oz-reez-player {
        padding: 12px 15px;
        gap: 15px;
        min-height: 70px;
    }

    .oz-reez-player-info {
        gap: 12px;
        min-width: 0;
        max-width: 40%;
    }

    .oz-reez-cover-art {
        width: 48px;
        height: 48px;
    }

    .oz-reez-track-title span {
        font-size: 14px;
    }

    .oz-reez-track-meta {
        font-size: 11px;
    }

    .oz-reez-main-controls {
        gap: 12px;
    }

    /* Hide repeat and volume on tablet */
    .oz-reez-btn[id="oz-reez-repeat"],
    .oz-reez-volume-control {
        display: none !important;
    }
}

/* ===========================================
   PHONE STYLES (0 - 767px)
   3 Equal Containers with Centered Controls
   =========================================== */

@media (max-width: 767px) {
    .oz-reez-player {
        padding: 10px 12px;
        gap: 8px;
        min-height: 60px;
    }

    /* Container 1: Left - Title/Meta with marquee */
    .oz-reez-player-info {
        flex-direction: column;
        align-items: flex-start;
        flex: 1;
        min-width: 0;
        max-width: 30%;
        overflow: hidden;
    }

    /* Hide cover art on mobile */
    .oz-reez-cover-art {
        display: none !important;
    }

    .oz-reez-track-info {
        width: 100%;
        overflow: hidden;
    }

    .oz-reez-track-title {
        margin-bottom: 2px;
        overflow: hidden;
        width: 100%;
    }

    .oz-reez-track-title span {
        font-size: 12px;
        display: inline-block;
        white-space: nowrap;
    }
    
    /* Marquee animation for overflowing title - 2s delay, then scroll with pauses */
    .oz-reez-track-title span.oz-marquee {
        animation: oz-marquee-pro 12s ease-in-out infinite;
        animation-delay: 2s;
    }

    .oz-reez-track-meta {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
    }
    
    /* Marquee animation for overflowing meta - 3s delay, then scroll with pauses */
    .oz-reez-track-meta.oz-marquee {
        animation: oz-marquee-pro 14s ease-in-out infinite;
        animation-delay: 3s;
    }

    /* Container 2: Center - Controls always centered */
    .oz-reez-player-controls {
        flex: 1;
        max-width: 40%;
        justify-content: center;
    }

    .oz-reez-main-controls {
        gap: 8px;
        justify-content: center;
    }

    /* Hide repeat and volume on mobile */
    .oz-reez-btn[id="oz-reez-repeat"],
    .oz-reez-volume-control {
        display: none !important;
    }

    .oz-reez-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .oz-reez-btn-primary {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* Container 3: Right - Cart button */
    .oz-reez-cart-section {
        flex: 1;
        max-width: 30%;
        justify-content: flex-end;
    }

    .beat-price {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .beat-price i {
        font-size: 0.75rem;
    }
}

/* Marquee keyframes for text overflow animation */
@keyframes oz-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Professional marquee: pause → scroll → pause → scroll back */
@keyframes oz-marquee-pro {
    0% {
        transform: translateX(0);
    }
    /* Hold at start for 20% of animation (pause) */
    20% {
        transform: translateX(0);
    }
    /* Scroll to end over next 30% */
    50% {
        transform: translateX(-50%);
    }
    /* Hold at end for 20% (pause) */
    70% {
        transform: translateX(-50%);
    }
    /* Scroll back to start */
    100% {
        transform: translateX(0);
    }
}

/* ===========================================
   VERY SMALL PHONES (0 - 480px)
   =========================================== */

@media (max-width: 480px) {
    .oz-reez-player {
        padding: 8px 10px;
        gap: 6px;
        min-height: 55px;
    }

    .oz-reez-player-info {
        max-width: 28%;
    }

    .oz-reez-track-title span {
        font-size: 11px;
    }

    .oz-reez-track-meta {
        font-size: 9px;
    }

    .oz-reez-player-controls {
        max-width: 44%;
    }

    .oz-reez-main-controls {
        gap: 6px;
    }

    .oz-reez-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .oz-reez-btn-primary {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .oz-reez-cart-section {
        max-width: 28%;
    }

    .beat-price {
        font-size: 0.65rem;
        padding: 5px 8px;
    }

    .beat-price i {
        font-size: 0.65rem;
        margin-right: 4px !important;
    }
}

/* ===========================================
   LANDSCAPE ORIENTATION
   =========================================== */

@media (max-width: 767px) and (orientation: landscape) {
    .oz-reez-player {
        min-height: 50px;
        padding: 8px 12px;
    }
    
    .oz-reez-btn {
        width: 32px;
        height: 32px;
    }
    
    .oz-reez-btn-primary {
        width: 38px;
        height: 38px;
    }
}

/* ===========================================
   HIGH CONTRAST MODE
   =========================================== */

@media (prefers-contrast: high) {
    .oz-reez-player-container {
        border-top: 2px solid #fff;
    }
    
    .oz-reez-btn {
        border: 1px solid #fff;
    }
    
    .oz-reez-progress {
        background: #fff;
    }
}
