﻿/**
 * AUDIO COMPONENTS
 * ================
 * 
 * Audio Panel and Controls
 * Theme-aware audio interface components
 */

.audio-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

    .audio-panel.showing {
        transform: translateY(0);
    }

.audio-panel-content {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.95) 0%, rgba(var(--primary-rgb), 0.85) 100% );
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    color: white;
}

.audio-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    opacity: 0.95;
}

.audio-close-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

    .audio-close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .audio-close-btn:focus {
        outline: 2px solid rgba(255, 255, 255, 0.5);
        outline-offset: 2px;
    }

.audio-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-size: 0.875rem;
    opacity: 0.9;
}

.audio-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.audio-player-section {
    margin: 1rem 0;
}

.audio-player-wrapper {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.audio-player {
    width: 100%;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    outline: none;
}

    .audio-player:focus {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    }

.audio-controls {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
}

.voice-selection {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.audio-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    opacity: 0.9;
    white-space: nowrap;
}

.audio-select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

    .audio-select:focus {
        outline: none;
        border-color: rgba(255, 255, 255, 0.6);
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
        background: white;
    }

    .audio-select:hover {
        background: white;
        border-color: rgba(255, 255, 255, 0.5);
    }

.audio-action-btn {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

    .audio-action-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .audio-action-btn:focus {
        outline: 2px solid rgba(255, 255, 255, 0.5);
        outline-offset: 2px;
    }

    .audio-action-btn:active {
        transform: translateY(0);
    }

/* Theme-specific audio panel variations */
body.theme-nature .audio-panel-content {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.95) 0%, rgba(76, 175, 80, 0.85) 100% );
}

body.theme-sky .audio-panel-content {
    background: linear-gradient(135deg, rgba(21, 101, 192, 0.95) 0%, rgba(33, 150, 243, 0.85) 100% );
}

body.theme-sunset .audio-panel-content {
    background: linear-gradient(135deg, rgba(216, 67, 21, 0.95) 0%, rgba(255, 112, 67, 0.85) 100% );
}

body.theme-mystical .audio-panel-content {
    background: linear-gradient(135deg, rgba(81, 45, 168, 0.95) 0%, rgba(126, 87, 194, 0.85) 100% );
}
