/* Minimal custom styles - most styling handled by Tailwind utilities */
html {
    font-size: 90%;
}

/* Resource-page hero: stable full-page background to prevent mobile viewport wiggle */
.hero-page-fixed-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    height: 100svh;
    min-height: 100vh;
    width: 100%;
    contain: paint;
}

/* Mobile: prevent horizontal growth from hero negative margins (resource pages only get wiggle) */
@media (max-width: 767px) {
    html {
        overflow-x: hidden;
    }
}

/* Developer doc: readable typography for markdown-rendered content */
.doc-prose {
    color: #334155;
    line-height: 1.7;
    font-size: 1rem;
}
.doc-prose h1 { font-size: 1.75rem; font-weight: 600; margin: 1.5em 0 0.5em; color: #0f172a; }
.doc-prose h1:first-child { margin-top: 0; }
.doc-prose h2 { font-size: 1.35rem; font-weight: 600; margin: 1.35em 0 0.5em; color: #1e293b; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.25em; }
.doc-prose h3 { font-size: 1.15rem; font-weight: 600; margin: 1.25em 0 0.4em; color: #334155; }
.doc-prose p { margin: 0.85em 0; }
.doc-prose ul, .doc-prose ol { margin: 0.85em 0; padding-left: 1.5em; }
.doc-prose li { margin: 0.25em 0; }
.doc-prose a { color: #2563eb; text-decoration: none; }
.doc-prose a:hover { text-decoration: underline; }
.doc-prose code { font-size: 0.9em; background: #f1f5f9; color: #0f172a; padding: 0.15em 0.4em; border-radius: 0.25rem; font-family: ui-monospace, monospace; }
.doc-prose pre { margin: 1em 0; padding: 1rem 1.25rem; background: #f1f5f9; border-radius: 0.5rem; overflow-x: auto; font-size: 0.875rem; line-height: 1.5; }
.doc-prose pre code { background: none; padding: 0; font-size: inherit; }
.doc-prose blockquote { margin: 1em 0; padding-left: 1em; border-left: 4px solid #cbd5e1; color: #475569; }
.doc-prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.95em; }
.doc-prose th, .doc-prose td { border: 1px solid #e2e8f0; padding: 0.5em 0.75em; text-align: left; }
.doc-prose th { background: #f8fafc; font-weight: 600; color: #334155; }
.doc-prose hr { border: none; border-top: 1px solid #e2e8f0; margin: 1.5em 0; }

/* Line clamp for card titles (2 lines) - fallback if Tailwind line-clamp not in build */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Resource card cover style: text over image stays readable */
.resource-card-cover-title {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.5);
}

/* Tag cards: same size as usual song/album cards in carousels (w-52 = 13rem) */
.resource-card-tag {
    width: 100%;
    max-width: 13rem;
    aspect-ratio: 1;
    justify-self: center;
}

/* Carousel: hide scrollbar, arrows scroll the track */
.carousel-track[data-carousel] {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.carousel-track[data-carousel]::-webkit-scrollbar {
    display: none;
}

/* Carousel: prevent horizontal overflow on mobile */
.carousel-wrapper {
    overflow: hidden;
}

/* Touch-friendly carousel buttons on mobile (min 44px) */
@media (max-width: 640px) {
    .carousel-btn {
        width: 2.75rem;
        height: 2.75rem;
        min-width: 2.75rem;
        min-height: 2.75rem;
    }
}

/* Modern Design Enhancements */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Modern button styles - use Tailwind classes directly in HTML instead */
/* These are reference styles - apply Tailwind classes like: 
   class="px-6 py-2.5 bg-indigo-600 text-white rounded-lg font-medium shadow-md hover:bg-indigo-700 hover:shadow-lg transition-all duration-200"
*/

/* Modern card styles - use Tailwind classes directly in HTML instead */
/* Apply classes like: 
   class="bg-white rounded-xl shadow-md hover:shadow-xl transition-shadow duration-300 border border-gray-100"
*/

/* Enhanced Audio Player Styles */
.audio-player-container {
    width: 100%;
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.audio-play-pause {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.audio-play-pause:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.audio-play-pause:active {
    transform: scale(0.98);
}

.audio-play-pause .play-icon,
.audio-play-pause .pause-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.audio-play-pause svg {
    width: 24px;
    height: 24px;
    display: block;
}

.audio-play-pause .play-icon svg {
    margin-left: 3px; /* Optical centering for play triangle */
}

.audio-prev,
.audio-next {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.audio-prev:hover,
.audio-next:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.05);
}

.audio-prev:active,
.audio-next:active {
    transform: scale(0.98);
}

.audio-prev svg,
.audio-next svg {
    width: 22px;
    height: 22px;
    display: block;
}

.audio-progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.audio-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-progress-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
}

.audio-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.audio-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 4px 4px 0 0;
}

.audio-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.audio-progress-bar:hover .audio-progress-handle,
.audio-player-controls:hover .audio-progress-handle {
    opacity: 1;
}

.audio-progress-handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.audio-time {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.audio-current-time {
    color: rgba(255, 255, 255, 0.9);
}

.audio-separator {
    display: none;
}

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

.audio-volume-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    transition: all 0.2s;
}

.audio-volume-toggle:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.audio-volume-toggle .volume-high-icon,
.audio-volume-toggle .volume-low-icon,
.audio-volume-toggle .volume-mute-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.audio-volume-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}

.audio-volume-slider {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.audio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.audio-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.audio-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.audio-volume-slider::-moz-range-track {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    height: 6px;
}

/* Like button: fire emoji style – icon has fire look; hover = orange/yellow button */
.js-like-btn.like-btn-fire,
.js-resource-like-btn.like-btn-fire,
.js-album-pill-like.like-btn-fire,
#pp-like.like-btn-fire {
    --like-fire-bg-hover: linear-gradient(135deg, #f97316 0%, #eab308 50%, #ea580c 100%);
}
.js-like-btn.like-btn-fire:hover,
.js-resource-like-btn.like-btn-fire:hover,
.js-album-pill-like.like-btn-fire:hover,
#pp-like.like-btn-fire:hover {
    background: var(--like-fire-bg-hover) !important;
    border-color: rgba(251, 146, 60, 0.5);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.35);
}
.like-btn-fire .fire-icon {
    display: inline-block;
    line-height: 1;
}
/* Not liked: diminished / outline – low opacity, desaturated, no flicker */
.like-btn-fire .fire-icon.fire-outline {
    opacity: 0.4;
    filter: grayscale(0.6) saturate(0.4);
    animation: none;
}
.like-btn-fire:hover .fire-icon.fire-outline {
    opacity: 0.55;
    filter: grayscale(0.4) saturate(0.5);
}
/* Liked: bright and flickering */
.like-btn-fire .fire-icon.fire-filled {
    opacity: 1;
    filter: none;
    animation: fire-flicker 2.5s ease-in-out infinite;
}
.like-btn-fire:hover .fire-icon.fire-filled {
    animation: fire-flicker 1.2s ease-in-out infinite;
}
@keyframes fire-flicker {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.08); filter: brightness(1.15); }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .audio-player-controls {
        flex-wrap: wrap;
        padding: 16px;
        gap: 12px;
    }

    .audio-play-pause {
        width: 48px;
        height: 48px;
    }

    .audio-play-pause svg {
        width: 20px;
        height: 20px;
    }

    .audio-prev,
    .audio-next {
        width: 38px;
        height: 38px;
    }

    .audio-prev svg,
    .audio-next svg {
        width: 18px;
        height: 18px;
    }

    .audio-progress-container {
        order: 3;
        flex-basis: 100%;
    }

    .audio-volume-container {
        margin-left: auto;
    }

    .audio-volume-slider {
        width: 60px;
    }
}
