/* static/css/github-audio.css - COMPLETE FILE WITH SIMPLIFIED COMPACT VERSION */

/* ORIGINAL STYLES (with fixes for white space issues) */
.github-audio-player {
    margin: 1.5em 0;
    padding: 1.2em;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
    transition: box-shadow 0.3s ease;
    position: relative;
    background-clip: padding-box;
    isolation: isolate;
    overflow: hidden;
}

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

.github-audio-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #333, #586069, #333);
    border-radius: 12px 12px 0 0;
}

.audio-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}

.audio-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.8em;
}

.audio-title {
    margin: 0 0 0.3em 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

.audio-artist {
    margin: 0;
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
}

.github-audio {
    width: 100%;
    height: 40px;
    outline: none;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e4e8;
    background-clip: padding-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.audio-description {
    padding: 0.6em 0.8em;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border-left: 3px solid #0366d6;
}

.audio-description p {
    margin: 0;
    font-size: 0.9em;
    color: #495057;
    line-height: 1.4;
}

.audio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8em;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 0.8em;
}

.audio-meta {
    display: flex;
    gap: 1em;
    font-size: 0.8em;
    color: #6c757d;
    flex-wrap: wrap;
}

.audio-actions {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.action-link {
    font-size: 0.85em;
    color: #0366d6;
    text-decoration: none;
    padding: 0.3em 0.6em;
    border: 1px solid #0366d6;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.action-link:hover {
    background: #0366d6;
    color: white;
    transform: translateY(-1px);
}

.download-action {
    color: #28a745;
    border-color: #28a745;
}

.download-action:hover {
    background: #28a745;
    color: white;
}

.github-action {
    color: #6f42c1;
    border-color: #6f42c1;
}

.github-action:hover {
    background: #6f42c1;
    color: white;
}

.audio-fallback,
.audio-error {
    padding: 1em;
    text-align: center;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.audio-error {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.download-link,
.debug-link {
    display: inline-block;
    margin-top: 0.5em;
    padding: 0.5em 1em;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
}

.download-link:hover,
.debug-link:hover {
    background: #c82333;
    color: white;
}

.audio-loading {
    text-align: center;
    padding: 1em;
    color: #6c757d;
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #0366d6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ================================= */
/* SIMPLIFIED COMPACT VERSION STYLES */
/* ================================= */

.github-audio-player.compact {
    margin: 1em 0;
    padding: 0.8em;
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.github-audio-player.compact:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Remove the gradient bar for compact version */
.github-audio-player.compact::before {
    display: none;
}

/* Compact Header - Single line with title and download button only */
.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6em;
    gap: 0.5em;
    /* NO border lines */
}

.compact-title {
    font-size: 0.95em;
    color: #24292e;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.compact-title strong {
    font-weight: 600;
}

.compact-artist {
    color: #6a737d;
    font-weight: normal;
    font-size: 0.9em;
}

/* Compact Actions - Only download button */
.compact-actions {
    display: flex;
    gap: 0.3em;
    flex-shrink: 0;
}

.compact-btn {
    padding: 0.3em 0.6em;
    font-size: 0.8em;
    border: 1px solid #28a745;
    border-radius: 4px;
    background: #f0fff4;
    color: #28a745;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.compact-btn:hover {
    background: #28a745;
    color: white;
    border-color: #1e7e34;
}

/* Compact Audio Element */
.compact-audio {
    width: 100%;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #d1d5da;
    background: #f6f8fa;
    outline: none;
}

.compact-audio:focus {
    border-color: #0969da;
    box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.1);
}

/* Compact Description */
.compact-description {
    font-size: 0.85em;
    color: #656d76;
    margin-top: 0.5em;
    line-height: 1.3;
}

/* Compact Metadata - NO border lines */
.compact-meta {
    margin-top: 0.4em;
    font-size: 0.75em;
    color: #8c959f;
    display: flex;
    gap: 0.8em;
    /* NO border-top */
}

.compact-meta span::before {
    content: "• ";
    margin-right: 0.2em;
}

.compact-meta span:first-child::before {
    display: none;
}

/* Compact Loading/Error States */
.compact-loading,
.compact-error {
    margin-top: 0.4em;
    font-size: 0.8em;
    text-align: center;
}

.compact-error {
    color: #cf222e;
}

.compact-error a {
    color: #0969da;
    text-decoration: none;
}

.compact-error a:hover {
    text-decoration: underline;
}

/* ================================= */
/* GLOBAL FIXES & IMPROVEMENTS */
/* ================================= */

/* Fix for all players */
.github-audio-player * {
    box-sizing: border-box;
}

/* Fix WebKit audio controls */
.github-audio::-webkit-media-controls-enclosure {
    border-radius: inherit;
    background: transparent;
}

.compact-audio::-webkit-media-controls-enclosure {
    border-radius: 3px;
    background: transparent;
}

/* ================================= */
/* ANIMATIONS */
/* ================================= */

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

/* ================================= */
/* MOBILE RESPONSIVE */
/* ================================= */

@media (max-width: 600px) {
    .github-audio-player {
        padding: 1em;
        margin: 1em 0;
    }
    
    .audio-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1em;
    }
    
    .audio-actions {
        width: 100%;
        justify-content: center;
    }
    
    .action-link {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }
    
    /* Compact mobile styles */
    .compact-header {
        flex-wrap: wrap;
        gap: 0.4em;
    }
    
    .compact-title {
        width: 100%;
        margin-bottom: 0.3em;
    }
    
    .compact-actions {
        width: 100%;
        justify-content: center;
    }
    
    .compact-btn {
        flex: 1;
        max-width: 120px;
    }
}