/**
 * SuperApp Pekanbaru card — komponen reusable.
 * Dipakai oleh: part/public_superapp.php (beranda, layanan, dll).
 */

/* Wrapper section (mandiri, tidak bergantung pada .section halaman) */
.superapp-section {
    position: relative;
    z-index: 1;
    max-width: 1220px;
    margin: 0 auto;
    padding: 28px 24px;
}

.superapp-section--before-footer {
    padding-top: 48px;
    padding-bottom: 104px;
}

@media (max-width: 640px) {
    .superapp-section--before-footer {
        padding-top: 32px;
        padding-bottom: 72px;
    }
}

.superapp-card {
    background: linear-gradient(145deg, #071946 0%, #08286b 45%, #0b3fa5 100%);
    border-radius: 32px;
    padding: 28px 48px 0 48px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 32px 72px -16px rgba(6, 29, 82, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.superapp-card:before {
    content: "";
    position: absolute;
    top: -120px;
    right: -100px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28) 0%, rgba(11, 63, 165, 0.15) 50%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}

.superapp-card:after {
    content: "";
    position: absolute;
    bottom: -140px;
    left: -80px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 102, 0, 0.18) 0%, rgba(11, 63, 165, 0.1) 50%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
}

.superapp-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 48px;
    position: relative;
    z-index: 2;
}

.superapp-title {
    font-size: clamp(1.5rem, 2.3vw, 1.95rem);
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: -0.015em;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.08s,
                transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.08s;
}

.superapp-section.superapp-in-view .superapp-title {
    opacity: 1;
    transform: translateY(0);
}

.superapp-highlight {
    background: linear-gradient(90deg, #ff8a00 0%, #ffad42 50%, #f56600 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 6s linear infinite;
    display: inline-block;
}

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

.superapp-desc {
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(226, 232, 240, 0.9);
    margin-bottom: 20px;
    max-width: 560px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
                transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.superapp-section.superapp-in-view .superapp-desc {
    opacity: 1;
    transform: translateY(0);
}

.superapp-download-wrap {
    padding-top: 4px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.32s,
                transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.32s;
}

.superapp-section.superapp-in-view .superapp-download-wrap {
    opacity: 1;
    transform: translateY(0);
}

.superapp-download-label {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.superapp-store-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.store-badge-link {
    position: relative;
    display: inline-block;
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    line-height: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.store-badge-link::after {
    content: "";
    position: absolute;
    top: 0;
    left: -140%;
    width: 70%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-22deg);
    pointer-events: none;
    transition: left 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.store-badge-link:hover::after {
    left: 140%;
}

.store-badge-link:hover {
    transform: scale(1.025);
    box-shadow: none;
    border: none;
}

.store-badge-img {
    height: 48px;
    width: auto;
    aspect-ratio: 162 / 48;
    display: block;
}

.superapp-meta-note {
    margin-top: 18px;
    font-size: 0.85rem;
    color: rgba(203, 213, 225, 0.85);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.44s,
                transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.44s;
}

.superapp-section.superapp-in-view .superapp-meta-note {
    opacity: 1;
    transform: translateY(0);
}

.superapp-meta-note i {
    animation: shieldPulse 3.5s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(74, 222, 128, 0)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.5)); }
}

/* Right column: iPhone 17 Visual */
.superapp-visual {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    align-self: end;
    margin-bottom: -155px;
    padding: 10px 0 0;
}

.superapp-mockup-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    max-width: 340px;
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.superapp-mockup-wrapper:hover {
    transform: translateY(-8px);
}

.superapp-aura-glow {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(11, 63, 165, 0.25) 50%, transparent 70%);
    filter: blur(44px);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease 0.1s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.superapp-section.superapp-in-view .superapp-aura-glow {
    opacity: 1;
}

.superapp-mockup-wrapper:hover .superapp-aura-glow {
    transform: translate(-50%, -50%) scale(1.08);
}

.superapp-iphone-frame {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    max-width: 275px;
    filter: drop-shadow(0 20px 44px rgba(0, 0, 0, 0.65));
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 0;
    opacity: 0;
    transform: translateY(65px) scale(0.92);
}

.superapp-section.superapp-in-view .superapp-iphone-frame {
    animation: mockupRiseIn 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

@keyframes mockupRiseIn {
    0% {
        opacity: 0;
        transform: translateY(65px) scale(0.92);
    }
    60% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.superapp-iphone-img {
    width: 100%;
    height: auto;
    aspect-ratio: 557 / 1169;
    display: block;
    border-radius: 40px 40px 0 0;
}

/* 3 Animated Floating Badges around iPhone 17 Mockup (True Frosted Glass Style) */
.floating-app-badge {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 13px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    box-shadow: 0 24px 48px -8px rgba(0, 10, 35, 0.55), 0 8px 18px -4px rgba(0, 0, 0, 0.22), inset 0 1px 1px 0 rgba(255, 255, 255, 0.95);
    color: #071946;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transform: scale(0.6) translateY(20px);
    transition: opacity 0.35s ease;
}

/* Entrance Pop-in and Floating Motion (Mockup first, then cards!) */
.superapp-section.superapp-in-view .floating-badge-sso {
    animation: badgePopIn 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.65s both,
               floatBadgeSSO 5.2s ease-in-out 1.2s infinite alternate;
}

.superapp-section.superapp-in-view .floating-badge-notif {
    animation: badgePopIn 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.85s both,
               floatBadgeNotif 6s ease-in-out 1.4s infinite alternate;
}

.superapp-section.superapp-in-view .floating-badge-bsre {
    animation: badgePopIn 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.05s both,
               floatBadgeBSRE 5.6s ease-in-out 1.6s infinite alternate;
}

@keyframes badgePopIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(24px);
    }
    70% {
        opacity: 1;
        transform: scale(1.05) translateY(-3px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 1. Satu Akun Tunggal (SSO) - Top Left */
.floating-badge-sso {
    top: 7%;
    left: -34px;
}

/* 2. Notifikasi Progres Real-Time - Middle Right */
.floating-badge-notif {
    top: 32%;
    right: -32px;
}

/* 3. Dokumen Resmi BSrE - Bottom Left */
.floating-badge-bsre {
    top: 55%;
    left: -30px;
}

@keyframes floatBadgeSSO {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-7px) rotate(-1.5deg); }
}

@keyframes floatBadgeNotif {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(6px) rotate(1.2deg); }
}

@keyframes floatBadgeBSRE {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-6px) rotate(-1deg); }
}

.floating-badge-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.badge-icon-sso {
    background: rgba(2, 132, 199, 0.14);
    border: 1px solid rgba(2, 132, 199, 0.32);
    color: #0284c7;
}

.badge-icon-notif {
    background: rgba(217, 119, 6, 0.14);
    border: 1px solid rgba(217, 119, 6, 0.32);
    color: #d97706;
}

.badge-icon-bsre {
    background: rgba(22, 163, 74, 0.14);
    border: 1px solid rgba(22, 163, 74, 0.32);
    color: #16a34a;
}

.floating-badge-text {
    line-height: 1.2;
}

.floating-badge-text strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    color: #071946;
    line-height: 1.2;
    margin-bottom: 2px;
}

.floating-badge-text span {
    display: block;
    font-size: 0.7rem;
    line-height: 1.2;
    color: #334155;
    font-weight: 600;
}

@media (max-width: 991px) {
    .superapp-card {
        padding: 28px 24px 0;
        border-radius: 24px;
    }
    .superapp-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    .superapp-desc {
        margin-left: auto;
        margin-right: auto;
    }
    .superapp-store-badges {
        justify-content: center;
    }
    .superapp-meta-note {
        justify-content: center;
    }
    .superapp-visual {
        margin-bottom: -110px;
    }
    .superapp-mockup-wrapper {
        max-width: 300px;
    }
    .superapp-iphone-frame {
        max-width: 250px;
    }
    .floating-badge-sso {
        left: -8px;
    }
    .floating-badge-notif {
        right: -8px;
    }
    .floating-badge-bsre {
        left: -8px;
    }
}

@media (max-width: 640px) {
    .superapp-card {
        padding: 24px 16px 0;
    }
    .superapp-title {
        font-size: 1.75rem;
    }
    .floating-app-badge {
        display: none;
    }
    .superapp-store-badges {
        flex-direction: column;
        align-items: center;
    }
    .store-badge-link {
        width: auto;
    }
    .store-badge-img {
        height: 46px;
    }
    .superapp-visual {
        margin-bottom: -100px;
    }
    .superapp-iphone-frame {
        max-width: 225px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .superapp-title,
    .superapp-desc,
    .superapp-download-wrap,
    .superapp-meta-note,
    .superapp-iphone-frame,
    .floating-app-badge,
    .superapp-mockup-wrapper {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
}
