/* static/css/style.css — ULTIMATE RESPONSIVE MYINSTANTS CLONE 2025 */
/* Final cleaned, optimized, and fully responsive version */
/* Focuses on the modern instant button style (dark theme, centered play circle with progress animation, blue accents) */
/* Removed conflicting/duplicated styles for consistency */
/* Improved mobile responsiveness with better grid breakpoints and text scaling */
/* All sections preserved but streamlined for better performance and visual coherence */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --bg: #0d0d1a;
    --card: #16162a;
    --text: #ffffff;
    --text-muted: #aaaaaa;
    --border: #2a2a3a;
    --shadow: rgba(0, 0, 0, 0.6);
    --accent-blue: #4FC3F7;
    --accent-light-blue: #81D4FA;
    --glow-green: #00ff88;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background: rgba(17, 17, 30, 0.95);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(90deg, #ff6b35, #f7931e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    display: flex;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.search-bar input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: #1e1e2e;
    color: white;
    font-size: 1rem;
}

.search-bar input:focus {
    outline: none;
    background: #25253a;
}

.search-bar button {
    padding: 0 28px;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.search-bar button:hover {
    background: var(--primary-dark);
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: white;
    background: rgba(255, 107, 53, 0.2);
    transform: translateY(-2px);
}

.nav-links a.active,
.nav-links a.active:hover {
    background: var(--primary);
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

/* Hero Section - Full Banner with Background Image */
.hero {
    position: relative;
    height: 70vh;                    /* Adjust height as needed: 60vh to 90vh */
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 3rem;
    border-radius: 0 0 30px 30px;
}

.hero-banner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;               /* Covers entire area without distortion */
    z-index: 1;
    filter: brightness(0.6);         /* Darkens image so text is readable */
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 2rem;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.1;
    color: #ffffff;                          /* Keep white base */
    text-shadow: 
        0 0 10px rgba(0, 0, 0, 0.8),          /* Soft glow */
        0 4px 20px rgba(0, 0, 0, 0.9),        /* Stronger bottom shadow */
        0 0 20px rgba(255, 107, 53, 0.6),     /* Orange glow to match your theme */
        4px 4px 0 #000,                       /* Black outline (multiple for thickness) */
        -4px -4px 0 #000,
        4px -4px 0 #000,
        -4px 4px 0 #000;
    -webkit-text-stroke: 2px black;          /* Crisp black outline (modern browsers) */
    paint-order: stroke fill;                /* Ensures outline draws behind text */
}

.hero .tagline {
    font-size: 1.8rem;
    font-weight: 500;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    margin-bottom: 2rem;
}

/* Responsive Adjustments for Hero */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 3.8rem;
    }
    .hero .tagline {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .hero {
        height: 60vh;
        min-height: 420px;
    }
    .hero h1 {
        font-size: 3rem;
    }
    .hero .tagline {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.4rem;
    }
    .hero .tagline {
        font-size: 1.2rem;
    }
    .hero-content {
        padding: 1.5rem;
    }
}

/* Categories Bar */
.categories-bar {
    padding: 2.5rem 0;
    background: linear-gradient(to bottom, rgba(13,13,26,0.9), var(--bg));
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.categories-bar h3 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

.cat-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.cat-tag {
    background: #1e1e2e;
    color: #fff;
    padding: 0.8rem 1.6rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 2px solid transparent;
}

.cat-tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.4);
    border-color: #fff;
}

/* Sound Grid - Modern MyInstants Button Style */
.sound-grid {
    display: flex;                  /* ← Change from grid to flex */
    flex-wrap: wrap;                /* Allow wrapping to new rows */
    gap: 1.8rem;                    /* Same as your grid gap */
    padding: 2rem 0;
    justify-content: center;        /* ← This centers partial rows! */
    max-width: 1400px;              /* Optional: keep it centered in page */
    margin: 0 auto;                 /* Centers the whole block */
}

.instant-button {
    flex: 1 1 160px;                /* Grow, shrink, basis 160px */
    max-width: 180px;               /* Matches your old max-width */
    width: 100%;
    background: linear-gradient(145deg, #1a1a2e, #0f0f1e);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 10px 25px rgba(0,0,0,0.6),
        inset 0 2px 8px rgba(255,255,255,0.05);
    transition: all 0.3s ease;
    border: 1px solid #333;
    cursor: pointer;
}

.instant-button:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(30, 144, 255, 0.3);
}

.button-wrapper {
    padding: 20px 15px 15px;
    text-align: center;
    position: relative;
}

.play-circle {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    background: url('/static/images/play-button.svg') center center no-repeat;
    background-size: 70%;
    cursor: pointer;
}

.play-circle svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.circle-bg {
    fill: none;
    stroke: #333;
    stroke-width: 4;
}

.circle-progress {
    fill: none;
    stroke: var(--glow-green);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.3s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.triangle {
    fill: var(--accent-blue);
    transition: fill 0.3s;
}

.button-text {
    text-align: center;
    padding: 8px 12px 4px;
    line-height: 1.3;
}

.title {
    display: block;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--accent-light-blue);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none !important;
}

.duration {
    display: block;
    font-size: 0.9rem;
    color: var(--accent-blue);
    opacity: 0.9;
}

.play-trigger {
    width: 100%;
    padding: 14px;
    background: linear-gradient(to bottom, var(--primary), #f7931e);
    color: white;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0 0 20px 20px;
    transition: 0.3s;
}

.play-trigger:hover {
    background: linear-gradient(to bottom, var(--primary-dark), #e67e00);
}

.play-trigger:active {
    transform: translateY(2px);
}

/* Playing State (add .playing class via JS) */
.instant-button.playing .circle-progress {
    stroke-dashoffset: 0;
    animation: dash 4s linear infinite;
}

@keyframes dash {
    to { stroke-dashoffset: -283; }
}

.instant-button.playing .triangle {
    fill: var(--glow-green);
}

.instant-button.playing .play-circle {
    animation: glow 1.5s infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 15px #00ff8830); }
    to { filter: drop-shadow(0 0 35px var(--glow-green)); }
}

/* Pagination */
.pagination {
    text-align: center;
    padding: 2rem 0;
    background: rgba(20,20,40,0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid #333;
}

.page-btn {
    display: inline-block;
    padding: 12px 18px;
    margin: 0 6px;
    background: #1e1e2e;
    color: var(--accent-light-blue);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
    min-width: 44px;
    text-align: center;
}

.page-btn:hover:not(.disabled) {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255,107,53,0.4);
}

.page-btn.current {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px rgba(255,107,53,0.6);
}

.page-btn.disabled {
    color: #555;
    cursor: not-allowed;
    opacity: 0.5;
}

.dots {
    color: #888;
    padding: 0 10px;
    font-weight: bold;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Static Pages (About, Contact, etc.) */
.static-page {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: var(--card);
    border-radius: 20px;
    line-height: 1.8;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.static-page h1 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.static-page h2 {
    margin: 2rem 0 1rem;
    color: #ff8b55;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .sound-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1.6rem;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    .search-bar {
        order: 2;
        width: 100%;
        max-width: none;
    }
    .nav-links {
        order: 3;
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .sound-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1.4rem;
    }
    .play-circle {
        width: 70px;
        height: 70px;
        background-size: 65%;
    }
}

@media (max-width: 480px) {
    .sound-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1.2rem;
    }
    .instant-button {
        max-width: 160px;
    }
    .play-circle {
        width: 62px;
        height: 62px;
        background-size: 58%;
    }
    .title {
        font-size: 0.9rem;
    }
    .hero h1 {
        font-size: 2.3rem;
    }
    .categories-bar h3 {
        font-size: 1.5rem;
    }
    .cat-tag {
        padding: 0.7rem 1.3rem;
        font-size: 0.95rem;
    }
}

/* ==================== INSTANT / SINGLE SOUND PAGE ==================== */
.instant-page {
    padding-bottom: 4rem;
}

/* Compact Hero Section */
.sound-hero {
    padding: 2.5rem 0 2rem;                  /* Reduced from 4rem+ */
    text-align: center;
    background: var(--card);
    border-radius: 0 0 30px 30px;
    margin-bottom: 3rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.8rem;                             /* Tighter spacing */
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-img {
    width: 180px;                            /* Smaller image */
    height: 180px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
    border: 4px solid var(--primary);
}

.sound-info {
    text-align: center;          /* Add this */
    width: 100%;
}

.sound-info h1 {
    font-size: 2.8rem;                       /* Slightly smaller but bold */
    color: var(--primary);
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    text-align: center;
}

.sound-info .desc {
    font-size: 1.2rem;
    color: var(--accent-light-blue);
    margin: 0.8rem auto;         /* Change to 'auto' for horizontal centering */
    max-width: 700px;
    text-align: center;
    display: inline-block;       /* Important: makes max-width + margin auto work */
}

.duration {
    font-size: 1.3rem;
    color: var(--accent-blue);
    margin-bottom: 0.8rem;
}

.category-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Main Player Section */
.player-section {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
    text-align: center;
}

/* .main-player {
    width: 100%;
    max-width: 700px;
    margin: 2rem auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
} */

/* Dark theme for audio controls (Chrome/Edge/Safari) */
.main-player::-webkit-media-controls-panel {
    background-color: #1e1e2e !important;
    color: white !important;
}

/* Action Buttons - Perfectly aligned & responsive */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.btn-primary,
.btn-download,
.btn-share {
    padding: 14px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 150px;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
}

.btn-download {
    background: transparent;
    color: var(--accent-light-blue);
    border: 2px solid var(--primary);
}

.btn-download:hover {
    background: var(--primary);
    color: white;
}

.btn-share {
    background: transparent;
    color: white;
    border: 2px solid var(--accent-blue);
}

.btn-share:hover {
    background: var(--accent-blue);
    color: #000;
}

/* Embed Box */
.embed-box {
    max-width: 700px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--card);
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.embed-box h3 {
    font-size: 1.9rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.embed-box textarea {
    width: 100%;
    height: 100px;
    padding: 1.2rem;
    background: #1e1e2e;
    color: var(--accent-light-blue);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    resize: none;
}

/* Related Sounds */
.related-sounds h2 {
    text-align: center;
    font-size: 2.4rem;
    color: var(--primary);
    margin: 3rem 0 2rem;
    font-weight: 800;
}

.view-all-wrapper {
    text-align: center;
    margin: 4rem 0;
}

.view-all-btn {
    display: inline-block;
    padding: 16px 40px;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    transition: 0.3s;
}

.view-all-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255,107,53,0.4);
}

.no-sounds {
    text-align: center;
    color: #888;
    font-size: 1.4rem;
    padding: 4rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sound-hero {
        padding: 2rem 0 1.5rem;
    }

    .hero-img {
        width: 150px;
        height: 150px;
    }

    .sound-info h1 {
        font-size: 2.2rem;
    }

    .sound-info .desc {
        text-align: left;        /* If you want left on desktop */
        font-size: 1.1rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-primary,
    .btn-download,
    .btn-share {
        width: 100%;
        max-width: 300px;
    }

    .related-sounds h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-img {
        width: 130px;
        height: 130px;
    }

    .sound-info h1 {
        font-size: 1.9rem;
    }

    .category-badge {
        font-size: 1rem;
        padding: 0.5rem 1.4rem;
    }
}

/* ==================== ENHANCED MAIN AUDIO PLAYER - CRISP & MODERN ==================== */
.main-player {
    width: 100%;
    max-width: 700px;
    margin: 2.5rem auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    background: #1a1a2e !important;           /* Deep dark base */
    height: 58px;                             /* Slightly taller for better touch targets */
    
    /* Sharp rendering & performance */
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

/* Main control panel */
.main-player::-webkit-media-controls-panel {
    background-color: #1a1a2e !important;
    color: white !important;
    border-radius: 24px;
    padding: 0 8px;
}

/* Enclosure - full rounding */
.main-player::-webkit-media-controls-enclosure {
    border-radius: 24px;
    overflow: hidden;
    background: transparent !important;
}

/* Play/Pause Button - Big, Sharp Orange Circle */
.main-player::-webkit-media-controls-play-button {
    background-color: var(--primary) !important;     /* #ff6b35 */
    border-radius: 50% !important;
    width: 42px !important;
    height: 42px !important;
    margin-left: 8px !important;
    
    /* Sharper triangle icon inside */
    filter: brightness(1.1) contrast(1.3) drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Time Displays - Clear Cyan Text */
.main-player::-webkit-media-controls-current-time-display,
.main-player::-webkit-media-controls-time-remaining-display {
    color: var(--accent-light-blue) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    padding: 0 8px;
}

/* Timeline Container */
.main-player::-webkit-media-controls-timeline-container {
    background-color: rgba(40, 40, 60, 0.6) !important;
    border-radius: 12px;
    height: 8px !important;
    margin: 0 12px;
    flex-grow: 1;
}

/* Timeline Track */
.main-player::-webkit-media-controls-timeline {
    background-color: #2d2d44 !important;
    border-radius: 12px;
    height: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Progress Fill - Bright Orange */
.main-player::-webkit-media-controls-timeline::-webkit-meter-bar {
    background: linear-gradient(90deg, var(--primary), #ff8a50) !important;
}

/* Seek Thumb - Glowing Orange Knob */
.main-player::-webkit-media-controls-timeline::-webkit-media-slider-thumb {
    background-color: var(--primary) !important;
    border: 3px solid white !important;
    border-radius: 50% !important;
    width: 16px !important;
    height: 16px !important;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.8) !important;
}

/* Volume Slider */
.main-player::-webkit-media-controls-volume-slider-container {
    margin-right: 12px;
}

.main-player::-webkit-media-controls-volume-slider {
    background-color: #333 !important;
    height: 6px !important;
    border-radius: 8px;
}

.main-player::-webkit-media-controls-volume-slider::-webkit-media-slider-thumb {
    background-color: var(--primary) !important;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.6);
}

/* Mute/Unmute Button */
.main-player::-webkit-media-controls-mute-button {
    color: white !important;
    opacity: 0.9;
}

.main-player::-webkit-media-controls-mute-button:hover {
    opacity: 1;
}

/* Fullscreen Button (if available) */
.main-player::-webkit-media-controls-fullscreen-button {
    color: white !important;
}

/* Hover Glow Effect */
.main-player:hover {
    box-shadow: 0 20px 50px rgba(255, 107, 53, 0.35);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}