@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* Main floating player styles - Ultra-compact futuristic design matching screenshot */
.sora-audio-player {
    position: fixed !important;
    z-index: 999999 !important;
    width: 280px;
    height: 52px;
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.12) 0%, 
        rgba(255,255,255,0.08) 50%, 
        rgba(255,255,255,0.04) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    gap: 12px;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: grab;
    user-select: none;
    overflow: hidden;
}

/* Ultra-transparent glassmorphism overlay */
.sora-audio-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.08) 0%, 
        transparent 30%, 
        rgba(255,255,255,0.04) 70%, 
        transparent 100%);
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.8;
}

.sora-audio-player:hover {
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.16) 0%, 
        rgba(255,255,255,0.12) 50%, 
        rgba(255,255,255,0.08) 100%);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
    box-shadow: 
        0 12px 40px rgba(0,0,0,0.16),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.sora-audio-player.dragging {
    cursor: grabbing;
    transform: rotate(0.3deg) scale(1.01);
}

.sora-audio-player.minimized {
    width: 32px !important;
    height: 32px !important;
    padding: 0;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.sora-audio-player.minimized .sora-player-content,
.sora-audio-player.minimized .sora-player-actions {
    display: none !important;
}

.sora-audio-player.minimized .sora-minimized-icon {
    display: flex !important;
}

/* Minimized speaker icon */
.sora-minimized-icon {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.sora-minimized-icon svg {
    width: 14px;
    height: 14px;
    fill: rgba(255,255,255,0.8);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Player content - horizontal layout */
.sora-player-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 2;
    min-width: 0;
    height: 100%;
    padding-top: 4px;
}

/* Player title - positioned at top */
.sora-player-title {
    color: #06b6d4;
    font-size: 11px;
    font-weight: 500;
    text-shadow: 0 0 6px rgba(6, 182, 212, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    letter-spacing: 0.2px;
    flex-shrink: 0;
    margin-bottom: 2px;
}

/* Controls container - positioned below title */
.sora-player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    position: relative;
}

/* Play/Pause button with VU meter */
.sora-play-btn {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.2);
    margin-top: -8px;
}

.sora-play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.1) 0%, 
        transparent 50%, 
        rgba(255,255,255,0.05) 100%);
    border-radius: inherit;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.sora-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 
        0 4px 16px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.3);
    border-color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.12) 100%);
}

.sora-play-btn:hover::before {
    opacity: 1;
}

/* VU Meter Container */
.sora-vu-meter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
    width: 12px;
    height: 8px;
    z-index: 2;
}

/* VU Meter Bars */
.sora-vu-bar {
    width: 1.5px;
    background: rgba(255,255,255,0.9);
    border-radius: 0.5px;
    transition: height 0.1s ease;
    filter: drop-shadow(0 0 2px rgba(6, 182, 212, 0.6));
}

.sora-vu-bar:nth-child(1) { height: 2px; }
.sora-vu-bar:nth-child(2) { height: 3px; }
.sora-vu-bar:nth-child(3) { height: 4px; }
.sora-vu-bar:nth-child(4) { height: 5px; }
.sora-vu-bar:nth-child(5) { height: 4px; }
.sora-vu-bar:nth-child(6) { height: 3px; }
.sora-vu-bar:nth-child(7) { height: 2px; }

/* Animated VU meter when playing */
.sora-audio-player.playing .sora-vu-bar {
    animation: sora-vu-pulse 0.3s ease-in-out infinite alternate;
}

.sora-audio-player.playing .sora-vu-bar:nth-child(1) { animation-delay: 0s; }
.sora-audio-player.playing .sora-vu-bar:nth-child(2) { animation-delay: 0.05s; }
.sora-audio-player.playing .sora-vu-bar:nth-child(3) { animation-delay: 0.1s; }
.sora-audio-player.playing .sora-vu-bar:nth-child(4) { animation-delay: 0.15s; }
.sora-audio-player.playing .sora-vu-bar:nth-child(5) { animation-delay: 0.1s; }
.sora-audio-player.playing .sora-vu-bar:nth-child(6) { animation-delay: 0.05s; }
.sora-audio-player.playing .sora-vu-bar:nth-child(7) { animation-delay: 0s; }

@keyframes sora-vu-pulse {
    0% { 
        transform: scaleY(0.3);
        opacity: 0.6;
    }
    100% { 
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Dash for no audio - single line */
.sora-audio-dash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 1.5px;
    background: rgba(255,255,255,0.6);
    border-radius: 1px;
    z-index: 2;
    transition: all 0.2s ease;
}

/* Hide VU meter when not playing, show dash */
.sora-audio-player:not(.playing) .sora-vu-meter {
    display: none;
}

.sora-audio-player.playing .sora-audio-dash {
    display: none;
}

/* Loading spinner */
.sora-loader {
    width: 10px;
    height: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-top: 1px solid #06b6d4;
    border-radius: 50%;
    animation: sora-spin 1s linear infinite;
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

@keyframes sora-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Volume container - FIXED MOBILE POSITIONING */
.sora-volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 120px;
    min-width: 80px;
    position: relative;
    margin-top: -5px;
}

/* Volume slider - enhanced glass style and larger */
.sora-volume-slider {
    appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, 
        #06b6d4 0%, 
        #06b6d4 50%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(255,255,255,0.2) 100%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 
        0 1px 3px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.sora-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, 
        #06b6d4 0%, 
        #0891b2 100%);
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 2px 6px rgba(6, 182, 212, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sora-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 
        0 3px 12px rgba(6, 182, 212, 0.6),
        inset 0 1px 0 rgba(255,255,255,0.4);
}

.sora-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, 
        #06b6d4 0%, 
        #0891b2 100%);
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 2px 6px rgba(6, 182, 212, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Time display - compact */
.sora-time-display {
    font-size: 9px;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
    min-width: 20px;
    text-align: center;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    background: rgba(255,255,255,0.08);
    padding: 2px 4px;
    border-radius: 4px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 0.2px;
    flex-shrink: 0;
    position: relative;
}

/* Actions container */
.sora-player-actions {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 3;
    flex-shrink: 0;
    margin-top: -3px;
}

.sora-action-btn {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 2px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 1px 3px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.sora-action-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
    transform: scale(1.05);
    box-shadow: 
        0 2px 6px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.sora-action-btn svg {
    width: 10px;
    height: 10px;
    stroke: rgba(255,255,255,0.7);
    stroke-width: 1.5;
    fill: none;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.sora-action-btn:hover svg {
    stroke: rgba(255,255,255,0.9);
}

.sora-close-btn:hover svg {
    stroke: #ef4444;
}

/* Progress bar - ultra-thin */
.sora-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}

.sora-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(6, 182, 212, 0.6), 
        rgba(59, 130, 246, 0.6));
    width: 0%;
    transition: width 0.1s ease;
}

/* MOBILE POSITIONING - CRITICAL CHANGE: SCROLL WITH PAGE */
@media (max-width: 768px) {
    .sora-audio-player {
        /* CHANGE FROM FIXED TO ABSOLUTE - ALLOWS SCROLLING WITH PAGE */
        position: absolute !important;
        width: 240px;
        height: 48px;
        padding: 6px 10px;
        gap: 8px;
        /* Remove z-index to prevent covering content */
        z-index: 1000 !important;
    }
    
    /* Mobile: play button down 1px from current position */
    .sora-play-btn {
        width: 20px;
        height: 20px;
        margin-top: -7px; /* Down 1px from -8px */
    }
    
    /* Mobile VU meter scaling */
    .sora-vu-meter {
        width: 10px;
        height: 6px;
    }
    
    .sora-vu-bar {
        width: 1px;
    }
    
    .sora-vu-bar:nth-child(1) { height: 1.5px; }
    .sora-vu-bar:nth-child(2) { height: 2px; }
    .sora-vu-bar:nth-child(3) { height: 3px; }
    .sora-vu-bar:nth-child(4) { height: 4px; }
    .sora-vu-bar:nth-child(5) { height: 3px; }
    .sora-vu-bar:nth-child(6) { height: 2px; }
    .sora-vu-bar:nth-child(7) { height: 1.5px; }
    
    .sora-audio-dash {
        width: 6px;
        height: 1px;
    }
    
    /* Mobile: volume slider - CRITICAL FIX - MOVE LEFT 10PX */
    .sora-volume-container {
        max-width: 70px; /* Reduced width */
        margin-top: -5px;
        margin-left: -10px; /* MOVE LEFT 10PX */
        margin-right: 0; /* Reset right margin */
    }
    
    .sora-player-title {
        font-size: 10px;
    }
    
    /* Mobile: collapse button up 3px from current position */
    .sora-player-actions {
        margin-top: -6px; /* Up 3px from -3px */
    }
}

@media (max-width: 480px) {
    .sora-audio-player {
        /* CHANGE FROM FIXED TO ABSOLUTE - ALLOWS SCROLLING WITH PAGE */
        position: absolute !important;
        width: 200px;
        height: 44px;
        padding: 4px 8px;
        gap: 6px;
        /* Remove z-index to prevent covering content */
        z-index: 1000 !important;
    }
    
    /* Mobile: play button down 1px */
    .sora-play-btn {
        width: 18px;
        height: 18px;
        margin-top: -5px; /* Down 1px from -6px */
    }
    
    /* Smaller VU meter for very small screens */
    .sora-vu-meter {
        width: 8px;
        height: 5px;
    }
    
    .sora-vu-bar {
        width: 0.8px;
    }
    
    .sora-vu-bar:nth-child(1) { height: 1px; }
    .sora-vu-bar:nth-child(2) { height: 1.5px; }
    .sora-vu-bar:nth-child(3) { height: 2.5px; }
    .sora-vu-bar:nth-child(4) { height: 3px; }
    .sora-vu-bar:nth-child(5) { height: 2.5px; }
    .sora-vu-bar:nth-child(6) { height: 1.5px; }
    .sora-vu-bar:nth-child(7) { height: 1px; }
    
    .sora-audio-dash {
        width: 5px;
        height: 0.8px;
    }
    
    /* Mobile: volume slider - CRITICAL FIX - MOVE LEFT 10PX */
    .sora-volume-container {
        max-width: 60px; /* Further reduced width */
        margin-top: -3px;
        margin-left: -10px; /* MOVE LEFT 10PX */
        margin-right: 0; /* Reset right margin */
    }
    
    .sora-player-title {
        font-size: 9px;
    }
    
    .sora-action-btn {
        width: 18px;
        height: 18px;
    }
    
    .sora-action-btn svg {
        width: 8px;
        height: 8px;
    }
    
    .sora-time-display {
        font-size: 8px;
        min-width: 18px;
        padding: 1px 3px;
    }
    
    /* Mobile: collapse button up 3px */
    .sora-player-actions {
        margin-top: -6px; /* Up 3px from -3px */
    }
}

/* Animation effects */
@keyframes sora-fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sora-audio-player {
    animation: sora-fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Pulse effect for playing state */
.sora-audio-player.playing .sora-play-btn {
    animation: sora-pulse 2s infinite;
}

@keyframes sora-pulse {
    0% {
        box-shadow: 
            0 2px 8px rgba(0,0,0,0.1),
            inset 0 1px 0 rgba(255,255,255,0.2);
    }
    50% {
        box-shadow: 
            0 4px 16px rgba(6, 182, 212, 0.3),
            inset 0 1px 0 rgba(255,255,255,0.3);
    }
    100% {
        box-shadow: 
            0 2px 8px rgba(0,0,0,0.1),
            inset 0 1px 0 rgba(255,255,255,0.2);
    }
}

/* Shortcode player styles */
.sora-shortcode-player {
    position: relative;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.04) 0%, 
        rgba(255,255,255,0.01) 50%, 
        rgba(0,0,0,0.02) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 16px !important;
    padding: 8px 16px !important;
    margin: 16px 0 !important;
    height: 32px !important;
}

.sora-shortcode-player:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
    border-color: rgba(255,255,255,0.12) !important;
}

/* Custom scrollbar for admin */
.page-selection-scroll::-webkit-scrollbar {
    width: 3px;
}

.page-selection-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
}

.page-selection-scroll::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.5);
    border-radius: 2px;
}

.page-selection-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.7);
}