/* ==========================================================================
   Home First-Visit Popup Advertisement Modal (Adaptive Multi-Popup Carousel)
   ========================================================================== */

.home-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.home-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.home-popup-dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15);
    overflow-x: hidden;
    overflow-y: auto;
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.home-popup-overlay.is-visible .home-popup-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Close Button Floating */
.home-popup-close {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    z-index: 30;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.home-popup-close:hover {
    background: rgba(37, 99, 235, 0.95);
    border-color: rgba(37, 99, 235, 1);
    transform: scale(1.08) rotate(90deg);
}

/* Slide Counter Badge */
.home-popup-counter {
    position: absolute;
    top: 0.875rem;
    right: 3.5rem;
    z-index: 30;
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Badge Label: Di atas judul, rapi dan tidak menimpa poster */
.home-popup-badge-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 0.2rem;
}

.home-popup-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Poster Media: Adaptive to natural image aspect ratio */
.home-popup-media {
    position: relative;
    width: 100%;
    background: #090d16;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    overflow: hidden;
}

/* Ambient Blurred Backdrop behind the poster */
.home-popup-img-blur {
    position: absolute;
    inset: -30px;
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.38);
    opacity: 0.9;
    transform: scale(1.15);
    pointer-events: none;
    z-index: 1;
}

/* Actual image: contain naturally, utuh tanpa terpotong */
.home-popup-img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: opacity 0.3s ease;
}

.home-popup-fallback-media {
    position: relative;
    z-index: 2;
    padding: 2.5rem 1.5rem;
    text-align: center;
    width: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
    color: #ffffff;
}

.home-popup-fallback-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto 0.75rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #60a5fa;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Carousel Navigation Arrows */
.home-popup-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.home-popup-nav-btn:hover {
    background: rgba(37, 99, 235, 0.9);
    border-color: rgba(37, 99, 235, 1);
    transform: translateY(-50%) scale(1.1);
}

.home-popup-nav-btn.prev {
    left: 0.75rem;
}

.home-popup-nav-btn.next {
    right: 0.75rem;
}

/* Body Content */
.home-popup-body {
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #ffffff;
}

.home-popup-title {
    font-size: 1.1875rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin: 0;
}

.home-popup-desc {
    font-size: 0.84375rem;
    line-height: 1.55;
    color: #475569;
    margin: 0;
}

/* Carousel Indicators (Dots) */
.home-popup-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.home-popup-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #cbd5e1;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s ease;
}

.home-popup-dot.active {
    width: 1.5rem;
    background: #2563eb;
    border-radius: 9999px;
}

/* Action CTA */
.home-popup-action {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.home-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8125rem 1.5rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.4);
    text-decoration: none;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}

.home-popup-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 12px 24px -4px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
    color: #ffffff;
}

.home-popup-dismiss {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.2rem;
}

.home-popup-dismiss:hover {
    color: #475569;
}

/* Night Mode Support */
body.night-mode .home-popup-dialog {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.night-mode .home-popup-body {
    background: #0f172a;
}

body.night-mode .home-popup-title {
    color: #f8fafc;
}

body.night-mode .home-popup-desc {
    color: #94a3b8;
}

body.night-mode .home-popup-dot {
    background: #334155;
}

body.night-mode .home-popup-dot.active {
    background: #3b82f6;
}

body.night-mode .home-popup-dismiss {
    color: #64748b;
}

body.night-mode .home-popup-dismiss:hover {
    color: #94a3b8;
}
