/* Smooth App Hydration Transition */
body.app-loading {
    overflow: hidden; /* Prevent scroll during initial load */
}

body.app-ready {
    overflow: auto;
    animation: appFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes appFadeIn {
    from { opacity: 0.8; transform: scale(0.99); }
    to { opacity: 1; transform: scale(1); }
}

/* ── Global Scroll & Smoothness (Miximelo-style hidden scrollbars) ── */
.horizontal-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none; /* Firefox */
    transition: all 0.3s ease;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

/* ── Expanded Section State (Spotify "Show All" behavior) ── */
/* When expanded, the flex container wraps items instead of scrolling horizontally */
.horizontal-scroll.expanded {
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: flex-start;
    max-height: none; /* Let it grow */
    padding-bottom: 20px;
}

/* Adjust card width slightly in expanded mode for better grid alignment on large screens */
@media (min-width: 992px) {
    .horizontal-scroll.expanded .card-item,
    .horizontal-scroll.expanded .artist-item {
        flex: 0 0 calc(20% - 16px); /* Fit roughly 5 items per row */
        width: auto; /* Override fixed width */
    }
}

/* ============================================================
   Personalized Content Loader
   ============================================================ */

.deferred-wrapper {
    width: 100%;
    margin: 0 0 1rem;
    padding: 0;
}

.skeleton-personalized {
    width: 100%;
}

.skeleton-rp {
    height: 120px;
    width: 100%;
    margin-bottom: 1rem;
}

.skeleton-cards {
    height: 200px;
    width: 100%;
    margin-bottom: 1rem;
}

/* Hidden only when personalized content is ready */
.deferred-wrapper.hidden {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Personalized content */
.deferred-content {
    display: none;
    width: 100%;
    margin: 0 0 1rem;
    padding: 0;
}


/* ── Price / Deal Badges ─────────────────────────────────── */
.price-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.discount-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    padding: 4px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
}

.deal-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #2f3542;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ── Featured Carousel ───────────────────────────────────── */
/* Replaced aggressive infinite zoom with a premium, slow cinematic pan */
.featured-carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-item.active .featured-carousel-img {
    transform: scale(1.05);
}

.carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-indicators .active {
    background: #fff;
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.carousel-caption {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 20px;
    margin: 0;
    border-radius: 0 0 8px 8px;
}

/* ── Recently Played Grid (Miximelo Style) ────────────────── */
.rp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}

.rp-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background-color: rgba(255, 255, 255, 0.05); /* Miximelo subtle surface */
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.rp-item:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Miximelo hover state */
    transform: translateY(-1px);
}

/* Kept !important here to override inline HTML width/height attributes */
.rp-item img {
    display: block;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    width: 40px !important;
    height: 40px !important;
    margin-right: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.track-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.track-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* 2 lines is more Miximelo-like for this size */
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-bottom: 2px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.explicit-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 2px 4px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
}

.track-duration {
    font-size: 0.75rem;
    color: #b3b3b3;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
    padding-left: 8px;
    font-variant-numeric: tabular-nums; /* Aligns numbers nicely */
}

/* ── Card Items (Artists, Albums, Tracks) ────────────────── */
.card-item {
    flex: 0 0 auto;
    width: 170px;
    background-color: var(--dark);
    border-radius: 5px;
    padding: 5px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.card-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin-bottom: 12px;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-item:hover .card-cover img {
    transform: scale(1.05);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.card-subtitle {
    font-size: 0.8rem;
    color: #b3b3b3;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* ── Artist Items ────────────────────────────────────────── */
.artist-item {
    flex: 0 0 auto;
    width: 170px; /* Matches card-item width for consistency */
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.artist-item:hover {
    transform: translateY(-4px);
}

.artist-avatar {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.3s ease;
}

.artist-item:hover .artist-avatar {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.artist-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.follow-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.follow-btn:hover {
    border-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* ── Register Button ─────────────────────────────────────── */
.register-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(135deg, #ff0066, #ff6600);
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(255, 0, 102, 0.3);
    position: relative;
    overflow: hidden;
    border: none;
}

.register-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.register-btn:hover::before {
    left: 120%;
}

.register-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 102, 0, 0.5);
}

.section-container {
    opacity: 1;
    transform: none;
}

/* ── Store Highlight (Mobile Section) ────────────────────── */
.highlights-sm-only .store-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
}

.highlights-sm-only .store-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.highlights-sm-only .store-item img {
    height: 48px;
    width: 48px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.store-item-info h6 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: #ffffff;
}

.store-item-info .price {
    font-size: 0.8rem;
    color: #b3b3b3;
    margin: 0;
}

/* ── Small Screens Responsive Adjustments ────────────────── */
@media (max-width: 576px) {
    .rp-grid {
        gap: 6px;
        padding: 0;
    }

    .rp-item {
        padding: 6px 8px;
    }

    .rp-item img {
        width: 40px !important;
        height: 40px !important;
        margin-right: 8px;
    }

    .track-title {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-height: 1.3;
    }

    .explicit-badge {
        font-size: 0.45rem;
        padding: 1px 3px;
    }

    .track-duration {
        font-size: 0.7rem;
    }

    .card-item {
        width: 150px;
        padding: 10px;
    }

    .artist-item {
        width: 127px;
    }
}



/* ══════════════════════════════════════════════════════════════
   FEATURED EVENTS — Homepage horizontal card rail
   ══════════════════════════════════════════════════════════════ */

.featured-events {
    margin-bottom: 28px;
}

.events-header-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Pulsing live dot beside the title */
.live-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ed7d31;
    margin-right: 6px;
    position: relative;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(237, 125, 49, 0.6);
    animation: liveDot 1.8s infinite;
}
.live-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid rgba(237, 125, 49, 0.5);
    animation: liveDotRing 1.8s infinite;
}
@keyframes liveDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(237, 125, 49, 0.6); }
    50%      { box-shadow: 0 0 0 6px rgba(237, 125, 49, 0);   }
}
@keyframes liveDotRing {
    0%   { transform: scale(0.7); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0;   }
}

/* Horizontal rail */
.events-horizontal-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 4px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(237,125,49,0.35) transparent;
}
.events-horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}
.events-horizontal-scroll::-webkit-scrollbar-track { background: transparent; }
.events-horizontal-scroll::-webkit-scrollbar-thumb {
    background: rgba(237, 125, 49, 0.3);
    border-radius: 3px;
}
.events-horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(237, 125, 49, 0.55);
}

/* ── Individual event card (portrait, fixed width for the rail) ── */
.event-card-home {
    flex: 0 0 260px;
    width: 260px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(160deg, #0f0c29 0%, #1a1635 100%);
    border: 1px solid rgba(237, 125, 49, 0.16);
    border-radius: 14px;
    overflow: hidden;
    transition: transform .25s cubic-bezier(.2,.9,.3,1),
                border-color .25s ease,
                box-shadow .25s ease;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}
.event-card-home:hover {
    transform: translateY(-4px);
    border-color: rgba(254, 193, 7, 0.55);
    box-shadow: 0 16px 40px rgba(237, 125, 49, 0.22);
}
.event-card-home.is-hot {
    border-color: rgba(254, 193, 7, 0.4);
}

/* ── Media (poster) ── */
.evh-media {
    position: relative;
    width: 100%;
    height: 150px;
    background-size: cover;
    background-position: center;
    background-color: #241c3f;
    overflow: hidden;
}
.evh-media-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10,8,28,0.15) 0%, rgba(10,8,28,0) 40%, rgba(10,8,28,0.75) 100%);
}

/* Date ribbon */
.evh-date {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ed7d31, #fec107);
    color: #0a081c;
    border-radius: 9px;
    padding: 5px 9px 4px;
    text-align: center;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(237, 125, 49, 0.4);
    min-width: 42px;
}
.evh-day { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.5px; }
.evh-mon { display: block; font-size: 9px; font-weight: 800; letter-spacing: 1.3px; margin-top: 2px; }

/* When pill (TODAY / TOMORROW / IN X DAYS) */
.evh-when {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 9px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.evh-when.is-hot {
    background: linear-gradient(135deg, #ed7d31, #fec107);
    color: #0a081c;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(254, 193, 7, 0.4);
}
.evh-when.is-hot i { font-size: 11px; }

/* ── Info panel ── */
.evh-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.evh-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    letter-spacing: -0.2px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 36px;                /* keeps cards aligned */
}

.evh-artist {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #ed7d31;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.evh-artist i { font-size: 11px; flex-shrink: 0; }
.evh-artist i.verified { color: #fec107; }

.evh-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #b8b8cc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.evh-meta i { color: #ed7d31; font-size: 12px; flex-shrink: 0; }

/* Foot: date + price + buy button */
.evh-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.evh-date-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: #8888a0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.evh-date-time i { font-size: 11px; flex-shrink: 0; }

.evh-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.evh-price {
    font-size: 11.5px;
    font-weight: 800;
    color: #fec107;
    white-space: nowrap;
}
.evh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ed7d31, #fec107);
    color: #0a081c;
    font-size: 14px;
    transition: transform .22s ease, box-shadow .22s ease;
    box-shadow: 0 4px 12px rgba(237, 125, 49, 0.32);
}
.event-card-home:hover .evh-btn {
    transform: translateX(2px) scale(1.08);
    box-shadow: 0 6px 18px rgba(254, 193, 7, 0.55);
}

/* ── Responsive: smaller cards on narrow screens ── */
@media (max-width: 768px) {
    .event-card-home { flex: 0 0 220px; width: 220px; }
    .evh-media { height: 130px; }
    .evh-title { font-size: 13px; min-height: 34px; }
    .evh-price { font-size: 11px; }
}

@media (max-width: 480px) {
    .event-card-home { flex: 0 0 200px; width: 200px; }
    .evh-media { height: 120px; }
    .evh-title { font-size: 12.5px; }
    .evh-when { font-size: 8px; padding: 3px 7px; }
    .evh-date { padding: 4px 7px 3px; min-width: 36px; }
    .evh-day { font-size: 15px; }
    .evh-mon { font-size: 8px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .live-dot,
    .live-dot::after { animation: none !important; }
    .event-card-home,
    .evh-btn { transition: none !important; }
}