/* ==========================================================================
   Mobile-first layer: bottom nav, persistent mini-player, card redesign,
   favorites, and small interaction polish. Loaded after style.css and
   header.php's inline styles, so these rules take priority without
   having to touch (and risk) the existing stylesheet.
   ========================================================================== */

/* ---- Card redesign: bigger tap targets, inline play, favorite heart ---- */

.nasheed-card {
    position: relative;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--border-radius);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nasheed-card:hover,
.nasheed-card:active {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
}

.card-cover {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--dark-bg);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(10,10,10,0) 40%, rgba(10,10,10,0.55) 100%);
    opacity: 1;
}

.card-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    transition: transform 0.15s ease;
}

.card-play-btn:active {
    transform: scale(0.92);
}

.card-play-btn.playing {
    background: var(--text-light, #141414);
}

.fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.55);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    backdrop-filter: blur(2px);
    z-index: 2;
}

.fav-btn.active {
    color: var(--secondary-color);
}

.fav-btn.active i {
    font-weight: 900;
}

/* ---- Skeleton loading placeholders ---- */

.skeleton-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.skeleton-cover,
.skeleton-line {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
}

.skeleton-cover { aspect-ratio: 1/1; }
.skeleton-line { height: 12px; margin: 10px 14px; border-radius: 4px; }
.skeleton-line.short { width: 50%; }

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Quick client-side search/filter input on Browse ---- */

.quick-filter {
    position: relative;
    max-width: 420px;
    margin: 0 auto 1.5rem;
}

.quick-filter input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.4rem;
    border-radius: var(--radius-input, 12px);
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
    font-size: 0.95rem;
}
.quick-filter input::placeholder {
    color: rgba(255,255,255,0.4);
}

.quick-filter i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    display: none;
}

/* ==========================================================================
   Persistent mini-player (bottom bar)
   ========================================================================== */

#miniPlayer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1400;
    background: var(--dark-bg);
    color: var(--text-light);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
    /* Fixed buffer, not a percentage of the player's own height - on
       mobile this sits at bottom:52px (above the bottom nav), and a
       plain 110% translate was only ever measured against the player's
       own ~55px height, so it didn't clear that extra 52px offset and
       stayed visibly peeking over the bottom nav when "closed". */
    transform: translateY(calc(100% + 80px));
    transition: transform 0.25s ease;
}

#miniPlayer.visible {
    transform: translateY(0);
}

.mini-player-progress {
    height: 3px;
    width: 100%;
    background: rgba(255,255,255,0.15);
    cursor: pointer;
}

.mini-player-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--secondary-color);
    transition: width 0.1s linear;
}

.mini-player-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    max-width: 1200px;
    margin: 0 auto;
}

.mini-player-cover {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.mini-player-meta {
    flex: 1;
    min-width: 0;
}

.mini-player-title {
    font-family: var(--font-display, serif);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-sub {
    font-size: 0.72rem;
    color: rgba(246,241,226,0.6);
}

.mini-player-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.mini-player-controls button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.1rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mini-player-controls button:active {
    background: rgba(255,255,255,0.1);
}

.mini-player-controls .mp-play {
    background: var(--secondary-color);
    color: var(--dark-bg);
    font-size: 1rem;
}

.mini-player-time {
    font-size: 0.7rem;
    color: rgba(246,241,226,0.65);
    min-width: 34px;
    text-align: center;
}

/* Hide desktop-only extras on narrow screens */
@media (max-width: 560px) {
    .mini-player-time,
    .mp-close { display: none; }
    .mini-player-controls .mp-fav { display: flex; }
}

/* ==========================================================================
   Mobile bottom navigation bar
   ========================================================================== */

#bottomNav {
    display: none;
}

@media (max-width: 768px) {
    #bottomNav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1300;
        background: var(--dark-bg);
        border-top: 1px solid rgba(255,255,255,0.15);
        padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    }

    #bottomNav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: rgba(246,241,226,0.55);
        text-decoration: none;
        font-size: 0.65rem;
        padding: 4px 0;
    }

    #bottomNav a.active,
    #bottomNav a:active {
        color: var(--secondary-color);
    }

    #bottomNav a i {
        font-size: 1.15rem;
    }

    /* Push mini player up above the bottom nav, and give page content
       enough bottom padding so the fixed bars never cover content. */
    #miniPlayer { bottom: 52px; }
    body { padding-bottom: 52px; }
    body.has-mini-player { padding-bottom: 110px; }

    /* Larger tap targets and single-column-friendly spacing on mobile */
    .grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.85rem !important; }
    .hero h1 { font-size: 1.9rem !important; }
    .hero { padding: 2.5rem 0 !important; }
    .filter-buttons { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .filter-buttons::-webkit-scrollbar { display: none; }
    .filter-btn { flex-shrink: 0; }
}

@media (min-width: 769px) {
    #miniPlayer.visible ~ * ,
    body.has-mini-player { padding-bottom: 66px; }
}

.act {
    padding: 5rem 0;
}
.act.dark {
    background: var(--dark-bg, #0A0A0A);
}
.act.light {
    background: var(--light-bg, #141414);
}
@media (max-width: 768px) {
    .act { padding: 3rem 0; }
}

/* ==========================================================================
   Homepage sections: hero, "where else to find me", library controls,
   support CTA band
   ========================================================================== */

.section-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary-color, #E6FF3A);
    margin-bottom: 0.5rem;
}

.accent-text {
    color: var(--secondary-color, #E6FF3A);
}

/* ---- Hero ---- */
.hero-main {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 4rem 0 !important;
}

.hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(10,10,10,0.95) 20%, rgba(10,10,10,0.55) 60%, rgba(74,0,255,0.35) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.05;
    margin-bottom: 1.25rem;
    font-weight: 900;
}

.hero-content p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    max-width: 520px;
}

@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.4rem !important; }
    .hero-main { min-height: 60vh; padding: 3rem 0 !important; }
}

/* ---- Where else to find me ---- */
.find-me-section {
    padding: 5rem 0;
    background: var(--light-bg, #141414);
}

.find-me-section h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
}

.social-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-icon-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 14px 22px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 100px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.social-icon-card i {
    font-size: 1.3rem;
    color: var(--secondary-color, #E6FF3A);
}

.social-icon-card:hover {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.06);
    transform: translateY(-2px);
    text-decoration: none;
}

/* ---- Library controls ---- */
.library-section {
    padding: 5rem 0 4rem;
}

.library-section h2 {
    font-size: 2.4rem;
    margin-bottom: 2rem;
}

.library-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.sort-select {
    padding: 0.6rem 1rem;
    border-radius: var(--radius-input, 12px);
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
    font-family: var(--font-display);
}

.sort-select option {
    background: var(--dark-bg);
    color: var(--text-light);
}

/* ---- Support CTA band ---- */
.support-cta-section {
    background: var(--secondary-color, #E6FF3A);
    padding: 4rem 0;
}

.support-cta-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.support-cta-inner h2 {
    font-size: 2.1rem;
    margin: 0.25rem 0;
}

@media (max-width: 768px) {
    .support-cta-inner { text-align: center; justify-content: center; }
    .library-controls { flex-direction: column; align-items: stretch; }
}


/* ==========================================================================
   Ditto-style structural components: kicker, two-tone mega headings,
   floating icon cluster, stat row, logo wall, donation tier cards
   ========================================================================== */

.kicker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    margin-bottom: 1rem;
}
.kicker .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary-color, #E6FF3A);
    display: inline-block;
    flex-shrink: 0;
}
.kicker .num {
    color: var(--secondary-color, #E6FF3A);
}

.h-mega {
    font-size: 3rem;
    line-height: 1.05;
    font-weight: 900;
    margin-bottom: 1.25rem;
}
.h-mega .lime { color: var(--secondary-color, #E6FF3A); }
.h-mega .purple { color: #A06BFF; }

@media (max-width: 768px) {
    .h-mega { font-size: 2.1rem; }
}

.section-lede {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    max-width: 640px;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ---- Floating icon cluster (used behind "Where else to find me") ---- */
.icon-cluster {
    position: relative;
    height: 320px;
    margin: 2rem 0;
}
.icon-cluster-item {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    animation: iconFloat var(--dur, 7s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}
.icon-cluster-item i {
    font-size: calc(var(--size) * 0.42);
    color: var(--secondary-color, #E6FF3A);
}
@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-14px); }
}
@media (max-width: 768px) {
    .icon-cluster { display: none; }
}

/* ---- Stat row ---- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 3rem 0;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.stat-row .stat .num {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    color: var(--secondary-color, #E6FF3A);
    line-height: 1;
}
.stat-row .stat .lbl {
    font-weight: 700;
    margin: 0.5rem 0 0.35rem;
}
.stat-row .stat .sub {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
}
@media (max-width: 768px) {
    .stat-row { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---- Logo wall ---- */
.logo-wall-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 1.25rem;
    text-align: center;
}
.logo-wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

/* ---- Donation tier cards (Support section) ---- */
.tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}
.tier-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}
.tier-card:hover {
    border-color: rgba(255,255,255,0.18);
    transform: translateY(-4px);
}
.tier-card.featured {
    background: var(--secondary-color, #E6FF3A);
    border-color: var(--secondary-color, #E6FF3A);
}
.tier-card.featured .tier-price,
.tier-card.featured .tier-name { color: #0A0A0A; }
.tier-card.featured .tier-sub { color: rgba(10,10,10,0.7); }
.tier-card .tier-name {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.75rem;
}
.tier-card .tier-price {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}
.tier-card .tier-sub {
    color: rgba(255,255,255,0.55);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    min-height: 40px;
}
@media (max-width: 768px) {
    .tier-grid { grid-template-columns: 1fr; }
}

/* ---- Hero "latest release" floating card (replaces the signup card) ---- */
.hero-release-card {
    background: rgba(20,20,20,0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 1.75rem;
    max-width: 340px;
}
.hero-release-card .eyebrow-small {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
    color: var(--secondary-color, #E6FF3A);
    font-weight: 700;
    margin-bottom: 1rem;
}
.hero-release-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.hero-release-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.hero-release-card p {
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}


/* ==========================================================================
   Toast (used for "added to favorites", "link copied", etc.)
   ========================================================================== */

#toast {
    position: fixed;
    left: 50%;
    bottom: 76px;
    transform: translate(-50%, 20px);
    background: var(--dark-bg);
    color: var(--text-light);
    padding: 0.6rem 1.1rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: 1px solid rgba(255,255,255,0.3);
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 768px) {
    #toast { bottom: 130px; }
}
