/* ==========================================================
   EXPLORE.CSS — Explore Page Card Grid + Modals + Search
   ========================================================== */

/* ---------- Page Layout ---------- */
.pv-explore-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.pv-explore-title {
    text-align: center;
    color: #e0ffe0;
    font-style: italic;
    margin-bottom: 4px;
}

.pv-explore-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 24px;
}

/* ---------- Search Bar ---------- */
.pv-explore-search {
    display: flex;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto 32px;
}

.pv-explore-search-input {
    flex: 1;
    background: #111;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.pv-explore-search-input:focus {
    border-color: #00ff88;
}

.pv-explore-search-input::placeholder {
    color: #666;
}

.pv-explore-search-btn {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    color: #e0ffe0;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.pv-explore-search-btn:hover {
    background: rgba(0, 255, 136, 0.2);
}

/* ---------- Back to Top Button ---------- */
.pv-back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid #00ff88;
    color: #e0ffe0;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.2s ease;
}

.pv-back-to-top.pv-visible {
    opacity: 1;
    pointer-events: auto;
}

.pv-back-to-top:hover {
    background: rgba(0, 255, 136, 0.3);
}

/* ---------- Section Titles + Scroll Animation ---------- */
.pv-explore-section {
    margin-bottom: 40px;
}

/* JS adds this class to sections it will animate — sections stay visible without JS */
.pv-section-animate {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.pv-section-animate.pv-section-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section fades out when scrolled past (upward exit) */
.pv-section-animate.pv-section-exit {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* ---------- Skeleton Cards (lazy loading placeholders) ---------- */
.pv-card-skeleton {
    min-height: 160px;
    background: linear-gradient(90deg, #111 25%, #1a1a1a 50%, #111 75%);
    background-size: 200% 100%;
    animation: pvSkeletonPulse 1.5s ease-in-out infinite;
    border-color: #1a1a1a;
}

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

.pv-explore-section-title {
    font-size: 1.2rem;
    text-transform: uppercase;
    color: #e0ffe0;
    font-style: italic;
    margin-bottom: 4px;
    text-align: center;
}

.pv-explore-section-subtitle {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    text-align: center;
}

/* ---------- Carousel ---------- */
.pv-carousel-wrapper {
    overflow: hidden;
    position: relative;
    padding: 10px 16px 8px;
    background: #0f1115;
    border-radius: 12px;
}

.pv-carousel-header {
    margin-bottom: 4px;
}

.pv-carousel-arrows {
    display: flex;
    gap: 6px;
}

.pv-carousel-arrow {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #333;
    color: #e0ffe0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.pv-carousel-prev {
    left: 4px;
}

.pv-carousel-next {
    right: 4px;
}

.pv-carousel-arrow:hover:not(:disabled) {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.15);
}

.pv-carousel-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.pv-carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-top: 16px;
    margin-top: -16px;
    padding-bottom: 8px;
}

.pv-carousel-track::-webkit-scrollbar {
    display: none;
}

.pv-carousel-track > * {
    flex: 0 0 200px;
    scroll-snap-align: start;
    min-width: 0;
}

/* Uniform card sizing inside carousels */
.pv-carousel-track .pv-card {
    display: flex;
    flex-direction: column;
    height: 180px;
    width: 100%;
    box-sizing: border-box;
}

.pv-carousel-track .pv-explore-card-link {
    flex: 0 0 200px;
    scroll-snap-align: start;
}

.pv-carousel-track .pv-explore-card-link .pv-card {
    height: 180px;
    width: 100%;
}

/* Creator cards match height */
.pv-carousel-track .pv-explore-card-creator {
    height: 180px;
    justify-content: center;
}

/* View More card matches */
.pv-carousel-track .pv-card-view-more {
    height: 180px;
    box-sizing: border-box;
}

/* ---------- View More Card ---------- */
.pv-card-view-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #e0ffe0;
    border-style: dashed;
    min-height: 160px;
}

.pv-card-view-more:hover {
    border-style: dashed;
}

.pv-view-more-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #00ff88;
}

/* ---------- Card Grid (search results + section full page) ---------- */
.pv-explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* ---------- Card Link Wrapper (logged-in) ---------- */
.pv-explore-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ---------- Song Cards ---------- */
.pv-card {
    padding: 12px;
    background: #0f1115;
    border-radius: 8px;
    border: 1px solid #20262b;
    cursor: pointer;
    transition: 0.15s ease;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.75);
}

.pv-card:hover {
    transform: translateY(-4px);
    background: #13151b;
    border-color: #33ff99;
    box-shadow: 0 0 25px rgba(0, 255, 102, 0.25);
}

.pv-thumb {
    width: 100%;
    height: 90px;
    border-radius: 6px;
    margin-bottom: 8px;
    background:
        radial-gradient(circle at 15% 10%, rgba(0, 255, 102, 0.18), transparent 55%),
        #0b0d10;
}

.pv-card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    color: #e0ffe0;
    margin-bottom: 2px;
}

.pv-card-subtitle {
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pv-card-meta {
    font-size: 0.72rem;
    color: #666;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pv-card-meta-sep {
    color: #444;
}

/* ---------- Creator Cards ---------- */
.pv-explore-card-creator {
    text-align: center;
    padding: 16px 12px;
}

.pv-creator-avatar {
    width: 60px;
    height: 60px;
    border-radius: 999px;
    margin: 0 auto 8px;
    border: 2px solid rgba(0, 255, 102, 0.3);
    object-fit: cover;
    display: block;
}

/* ---------- Empty State ---------- */
.pv-explore-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1rem;
}

/* ---------- Back Link ---------- */
.pv-explore-back {
    display: inline-block;
    margin-top: 16px;
    color: #00ff88;
    text-decoration: none;
    font-size: 0.85rem;
}

.pv-explore-back:hover {
    text-decoration: underline;
}

/* ---------- Pagination ---------- */
.pv-explore-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.pv-explore-page-info {
    color: #666;
    font-size: 0.85rem;
}

/* ==========================================================
   TRACK MODAL — Song Content (guest view)
   ========================================================== */
.pv-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pv-modal-backdrop.pv-modal-visible {
    display: flex;
}

.pv-modal {
    width: 90%;
    max-width: 1100px;
    max-height: 95vh;
    background: rgba(10, 14, 18, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 102, 0.4);
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.25);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    animation: pvModalFadeIn 0.18s ease-out;
    color: #e0e0e0;
}

@keyframes pvModalFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

.pv-modal-close {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
    border-radius: 999px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: 0.15s;
}

.pv-modal-close:hover {
    border-color: #00ff88;
    color: #00ff88;
}

.pv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.pv-modal-title {
    color: #00ff88;
    margin: 0 0 2px;
}

.pv-modal-creator {
    color: #888;
}

.pv-modal-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 90%;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
}

.pv-modal-panel-title {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 4px;
}

.pv-modal-box {
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 102, 0.25);
    background: rgba(4, 6, 9, 0.95);
    padding: 8px;
    font-size: 0.78rem;
    overflow: auto;
    max-height: 330px;
}

.pv-modal-lyrics,
.pv-modal-prompt {
    white-space: pre-wrap;
    font-family: inherit;
}

.pv-modal-footer {
    color: #888;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 6px;
}

.pv-modal-button {
    border: 1px solid #00ff88;
    background: rgba(0, 255, 136, 0.1);
    color: #e0e0e0;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.15s;
    text-decoration: none;
}

.pv-modal-button:hover {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 12px rgba(0, 255, 102, 0.35);
}

/* ==========================================================
   CREATOR MODAL (guest view)
   ========================================================== */
.pv-creator-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pv-creator-modal-backdrop.pv-modal-visible {
    display: flex;
}

.pv-creator-modal {
    width: 90%;
    max-width: 750px;
    max-height: 90vh;
    background: rgba(10, 14, 18, 0.9);
    border: 1px solid rgba(0, 255, 102, 0.4);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 102, 0.25);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: pvModalFadeIn 0.18s ease-out;
    overflow: hidden;
    text-align: center;
}

.pv-creator-avatar-big {
    width: 96px;
    height: 96px;
    border-radius: 1000px;
    margin: 0 auto;
    border: 2px solid rgba(0, 255, 102, 0.5);
    object-fit: cover;
}

.pv-creator-handle {
    color: #00ff88;
    margin-top: 6px;
}

.pv-creator-bio {
    color: #888;
    max-width: 85%;
    margin: 0.2rem auto 0.6rem;
}

.pv-creator-stats {
    color: #888;
    font-size: 0.85rem;
}

.pv-top-tracks-title {
    font-size: 0.9rem;
    color: #e0ffe0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pv-top-track {
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.pv-top-track:hover {
    background: rgba(0, 255, 102, 0.08);
}

.pv-top-track-title {
    color: #e0e0e0;
    font-size: 0.85rem;
}

.pv-top-track-meta {
    color: #666;
    font-size: 0.72rem;
}

.pv-creator-close {
    position: absolute;
    top: 12px;
    right: 16px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #888;
    transition: color 0.15s;
}

.pv-creator-close:hover {
    color: #00ff88;
}

/* ==========================================================
   Mobile Adjustments
   ========================================================== */
@media (max-width: 720px) {
    .pv-explore-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .pv-carousel-track > * {
        flex: 0 0 160px;
    }

    .pv-carousel-track .pv-card,
    .pv-carousel-track .pv-explore-card-link .pv-card,
    .pv-carousel-track .pv-card-view-more {
        height: 160px;
    }

    .pv-carousel-track .pv-explore-card-link {
        flex: 0 0 160px;
    }

    .pv-explore-search {
        flex-direction: column;
    }

    .pv-modal-backdrop,
    .pv-creator-modal-backdrop {
        align-items: flex-end;
    }

    .pv-modal,
    .pv-creator-modal {
        width: 100%;
        max-width: none;
        border-radius: 12px 12px 0 0;
        max-height: 90vh;
        padding-bottom: 20px;
        animation: pvModalSlideUp 0.22s ease-out;
    }

    .pv-modal-box {
        max-height: 200px;
    }
}

@keyframes pvModalSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
