/* Audio Mini-Player Component */
/* Requires CSS variables: --audio-bar-height, --bg-color, --text-color, --muted-color, --border-color, --accent-color */

:root { 
    --audio-bar-height: 58px; 
}

.audio-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    height: var(--audio-bar-height);
    display: none;
    align-items: center;
    padding: 8px 14px;
    /* Fallback for older browsers */
    background: rgba(10, 10, 10, 0.85);
    /* Modern approach using CSS variables */
    background: color-mix(in srgb, var(--bg-color) 85%, transparent);
    border-top: 1px solid var(--border-color);
    backdrop-filter: saturate(120%) blur(12px);
    -webkit-backdrop-filter: saturate(120%) blur(12px);
    color-scheme: light dark;
    font-family: 'Georgia', 'Times New Roman', serif;
    /* Fallback for older browsers */
    box-shadow: 0 -1px 0 0 rgba(74, 158, 255, 0.1);
    /* Modern approach using CSS variables */
    box-shadow: 0 -1px 0 0 color-mix(in srgb, var(--accent-color) 10%, transparent);
}

/* Fallback for light theme in older browsers */
[data-theme="light"] .audio-player {
    background: rgba(244, 237, 230, 0.85);
    box-shadow: 0 -1px 0 0 rgba(45, 90, 160, 0.1);
}

.audio-row {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-player audio {
    flex: 1;
    min-width: 220px;
    outline: none;
}

.visually-hidden {
    position: absolute !important;
    height: 1px; 
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Reserve space so content isn't covered when audiobar is visible */
.audiobar-active .container { 
    padding-bottom: calc(var(--audio-bar-height) + 12px); 
}

/* Dismiss button */
.audio-close {
    margin-left: auto;
    background: transparent;
    color: var(--muted-color);
    border: 1px solid transparent;
    width: 28px; 
    height: 28px;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'Georgia', 'Times New Roman', serif;
    transition: all 0.3s ease;
}

.audio-close:hover { 
    border-color: var(--border-color); 
    color: var(--text-color);
    /* Fallback for older browsers */
    background: rgba(255, 255, 255, 0.05);
    /* Modern approach using CSS variables */
    background: color-mix(in srgb, var(--text-color) 5%, transparent);
}

/* Fallback for light theme close button hover in older browsers */
[data-theme="light"] .audio-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Reopen pill */
.audio-reopen {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 999;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    /* Fallback for older browsers */
    background: rgba(10, 10, 10, 0.85);
    /* Modern approach using CSS variables */
    background: color-mix(in srgb, var(--bg-color) 85%, transparent);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    backdrop-filter: saturate(120%) blur(12px);
    -webkit-backdrop-filter: saturate(120%) blur(12px);
    display: block;
    font-family: 'Georgia', 'Times New Roman', serif;
    /* Fallback for older browsers */
    box-shadow: 0 0 0 1px rgba(74, 158, 255, 0.1);
    /* Modern approach using CSS variables */
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 10%, transparent);
    transition: all 0.3s ease;
}

/* Fallback for light theme in older browsers */
[data-theme="light"] .audio-reopen {
    background: rgba(244, 237, 230, 0.85);
    box-shadow: 0 0 0 1px rgba(45, 90, 160, 0.1);
}

.audio-reopen:hover {
    transform: translateY(-1px);
    /* Fallback for older browsers */
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.15), 
                0 0 0 1px rgba(74, 158, 255, 0.2);
    /* Modern approach using CSS variables */
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-color) 15%, transparent), 
                0 0 0 1px color-mix(in srgb, var(--accent-color) 20%, transparent);
}

/* Fallback for light theme hover in older browsers */
[data-theme="light"] .audio-reopen:hover {
    box-shadow: 0 2px 8px rgba(45, 90, 160, 0.15), 
                0 0 0 1px rgba(45, 90, 160, 0.2);
}

.audio-reopen button {
    background: transparent;
    color: inherit;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}
