@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: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex !important;
    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: transform 0.15s ease-out, box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1), background 0.3s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: grab;
    user-select: none;
    overflow: hidden;
    will-change: transform;
}

/* Preloader bar - fills background from left to right */
.sora-audio-player::after {
    display: none;
}

.sora-audio-player.loading::after {
    animation: sora-preloader 1.5s ease-in-out infinite;
}

@keyframes sora-preloader {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 0%; }
}

.sora-visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.sora-audio-player.minimized .sora-visualizer {
    display: none;
}

/* Ultra-transparent glassmorphism overlay */
.sora-audio-player::before {
    display: none;
}

.sora-audio-player:hover {
    background: transparent;
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

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

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

.sora-audio-player.minimized .sora-player-content,
.sora-audio-player.minimized .sora-player-actions,
.sora-audio-player.minimized .sora-progress-container {
    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: 10;
    pointer-events: none;
}

.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 */
.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: 28px;
    height: 28px;
    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: visible;
    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;
}

/* Play and Pause Icons */
.sora-play-icon,
.sora-pause-icon {
    position: absolute;
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.95);
    transition: all 0.2s ease;
    z-index: 3;
}

/* Show play icon when not playing */
.sora-audio-player:not(.playing) .sora-play-icon {
    display: block;
}

.sora-audio-player:not(.playing) .sora-pause-icon {
    display: none;
}

/* Show pause icon when playing */
.sora-audio-player.playing .sora-play-icon {
    display: none;
}

.sora-audio-player.playing .sora-pause-icon {
    display: block;
}

/* Hide icons when loading */
.sora-audio-player.loading .sora-play-icon,
.sora-audio-player.loading .sora-pause-icon {
    display: none;
}

/* VU Meter Container - REMOVED */
.sora-vu-meter {
    display: none;
    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;
    }
}

/* Old dash/vu meter styles - REMOVED */
.sora-audio-dash {
    display: none !important;
}

/* 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: none;
}

.sora-action-btn {
    background: transparent;
    border: none;
    padding: 2px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    z-index: 10;
    pointer-events: auto;
}

.sora-action-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

.sora-action-btn svg {
    width: 9px;
    height: 9px;
    stroke: rgba(255,255,255,0.5);
    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.85);
}

.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 */
@media (max-width: 768px) {
    .sora-audio-player {
        position: fixed !important;
        width: 48px;
        height: 48px;
        padding: 0;
        gap: 0;
        z-index: 999999 !important;
        border-radius: 50%;
        justify-content: center;
        align-items: center;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        border: none !important;
    }

    .sora-audio-player::after {
        display: none !important;
    }

    .sora-play-btn {
        width: 48px;
        height: 48px;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 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: 8px;
        height: 10px;
    }

    .sora-audio-dash::before,
    .sora-audio-dash::after {
        width: 2px;
        height: 8px;
    }
    
    /* Mobile: hide volume slider - not functional with touch */
    .sora-volume-container {
        display: none !important;
    }

    .sora-player-title {
        display: none !important;
    }

    .sora-time-display {
        display: none !important;
    }

    .sora-player-content {
        width: 100%;
        justify-content: center;
        align-items: center;
    }

    .sora-player-controls {
        justify-content: center;
        width: 100%;
    }

    .sora-play-btn {
        margin-top: 0 !important;
    }
}

@media (max-width: 480px) {
    .sora-audio-player {
        position: fixed !important;
        width: 44px;
        height: 44px;
        padding: 0;
        gap: 0;
        z-index: 999999 !important;
        border-radius: 50%;
        justify-content: center;
        align-items: center;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        border: none !important;
    }

    .sora-audio-player::after {
        display: none !important;
    }

    .sora-play-btn {
        width: 44px;
        height: 44px;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 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: 7px;
        height: 8px;
    }

    .sora-audio-dash::before,
    .sora-audio-dash::after {
        width: 1.5px;
        height: 7px;
    }
    
    .sora-volume-container {
        display: none !important;
    }

    .sora-player-title {
        display: none !important;
    }

    .sora-time-display {
        display: none !important;
    }

    .sora-player-content {
        width: 100%;
        justify-content: center;
        align-items: center;
    }

    .sora-player-controls {
        justify-content: center;
        width: 100%;
    }
    
    .sora-action-btn svg {
        width: 8px;
        height: 8px;
    }
    
    .sora-time-display {
        font-size: 8px;
        min-width: 18px;
        padding: 1px 3px;
    }
    
    /* Mobile: adjust collapse button container */
    .sora-player-actions {
        width: 12%;
        min-width: 18px;
        gap: 2px;
    }

    .sora-action-btn {
        width: 12px;
        height: 12px;
    }

    .sora-action-btn svg {
        width: 7px;
        height: 7px;
    }
}

/* 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);
}