/* Custom Audio Player Styles */
.audio-player-container {
    margin: 15px 0;
    padding: 15px;
    background-color: #f0faff;
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.audio-player-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.audio-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.audio-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.audio-icon {
    color: #007bff;
    font-size: 1.3rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.audio-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
    font-size: 0.95rem;
}

.audio-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: #6c757d;
}

.audio-duration, .audio-size {
    display: flex;
    align-items: center;
    gap: 4px;
}

.audio-file-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.audio-file-selector select {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: white;
    font-size: 0.9rem;
    min-width: 200px;
}

.audio-file-name {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #f8f9fa;
    font-size: 0.9rem;
    min-width: 200px;
    color: #495057;
    display: inline-block;
}

.audio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.audio-main-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.audio-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

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

.audio-btn.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
}

.audio-btn.secondary:hover {
    background: linear-gradient(135deg, #545b62 0%, #3d4449 100%);
}

.audio-btn.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.audio-btn.danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
}

.audio-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.audio-progress-container {
    flex: 1;
    min-width: 200px;
}

.audio-progress {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: height 0.2s ease;
}

.audio-progress:hover {
    height: 8px;
}

.audio-progress:active {
    height: 10px;
}

.audio-progress.dragging {
    height: 10px;
    cursor: grabbing;
}

.audio-progress.dragging .audio-progress-bar {
    transition: none;
}

.audio-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    border-radius: 3px;
    transition: width 0.1s ease;
    position: relative;
    pointer-events: none;
}

.audio-progress-bar::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -2px;
    width: 10px;
    height: 10px;
    background: #007bff;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.audio-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 4px;
}

.audio-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.audio-volume-slider {
    flex: 1;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.audio-volume-bar {
    height: 100%;
    background: linear-gradient(90deg, #0abf83 0%, #20c997 100%);
    border-radius: 2px;
    transition: width 0.1s ease;
}

.audio-speed-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-speed-btn {
    padding: 4px 4px;
    border: 1px solid #ced4da;
    background: white;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: normal;
    width: 2.4rem;
}

.audio-speed-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.audio-speed-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.audio-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.9rem;
}

.audio-loading.show {
    display: flex;
}

.audio-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.audio-error {
    display: none;
    align-items: center;
    gap: 8px;
    color: #dc3545;
    font-size: 0.9rem;
    padding: 8px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.audio-error.show {
    display: flex;
}

.audio-playlist-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

.audio-playlist-btn {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-playlist-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.audio-playlist-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Floating Audio Player */
.floating-audio-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    /* background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%); */
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 300px;
    max-width: 90vw;
}

.floating-audio-player.floating-player-visible {
    transform: translateX(-50%) translateY(0);
}

.floating-player-content {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.floating-player-info {
    flex: 1;
    min-width: 0;
}

.floating-player-title {
    display: block;
    color: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-player-time {
    display: block;
    color: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    font-size: 0.8rem;
}

.floating-player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.floating-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.floating-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.floating-btn.primary {
    background: #3498db;
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.floating-btn.primary:hover {
    background: #2980b9;
}

.floating-player-progress {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-width: 80px;
}

.floating-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    border-radius: 2px;
    transition: width 0.1s ease;
    position: relative;
}

.floating-progress-bar::after {
    content: '';
    position: absolute;
    right: -2px;
    top: -2px;
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.floating-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.floating-close-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .audio-player-container {
        padding: 12px;
    }
    
    /* .audio-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    } */
    
    .audio-main-controls {
        justify-content: center;
    }
    
    .audio-volume-container,
    .audio-speed-container {
        justify-content: center;
    }
    
    .audio-file-selector select,
    .audio-file-name {
        min-width: 150px;
    }
    
    .audio-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .floating-audio-player {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: translateY(100px);
        min-width: auto;
        max-width: none;
    }
    
    .floating-audio-player.floating-player-visible {
        transform: translateY(0);
    }
    
    .floating-player-content {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .floating-player-title {
        font-size: 0.85rem;
    }
    
    .floating-player-time {
        font-size: 0.75rem;
    }
    
    .floating-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .floating-btn.primary {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .floating-close-btn {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .audio-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .audio-btn.secondary {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .audio-title {
        font-size: 0.9rem;
    }
    
    .audio-meta {
        font-size: 0.8rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .audio-player-container {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
    }
    
    .audio-title {
        color: #e2e8f0;
    }
    
    .audio-meta {
        color: #a0aec0;
    }
    
    .audio-file-selector select,
    .audio-file-name {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .audio-speed-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .audio-speed-btn:hover {
        background: #4a5568;
        border-color: #007bff;
    }
    
    .audio-playlist-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .audio-playlist-btn:hover {
        background: #4a5568;
        border-color: #007bff;
    }
} 