/* File: assets/css/style.css */

/* .bg-parallax replaced by .hero-section with mobile-safe parallax */

/* Animations */
@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(50px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutLeft {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(-50px); }
}
@keyframes slideInLeft {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(50px); }
}

.page-enter-forward { animation: slideInRight 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.page-exit-forward { animation: slideOutLeft 0.3s ease-in forwards; }
.page-enter-backward { animation: slideInLeft 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.page-exit-backward { animation: slideOutRight 0.3s ease-in forwards; }

#loader { transition: opacity 0.4s ease; }
.nav-link { transition: all 0.3s ease; }
/* ============================================================
   PRINT STYLESHEET — Untuk cetak halaman simulasi/produk
   ============================================================ */
@media print {
    /* Sembunyikan elemen yang tidak relevan saat print */
    nav, footer, #loader, #floating-wa, #toast-container,
    .promo-timer, button:not(.print-visible),
    [aria-label="Navigasi utama"], [role="navigation"] {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    /* Tampilkan konten utama penuh */
    #app-content {
        min-height: auto !important;
        overflow: visible !important;
    }

    /* Pastikan gambar tidak overflow */
    img { max-width: 100% !important; }

    /* Hindari page break di tengah kartu */
    article, .bg-white { page-break-inside: avoid; }

    /* Header print: tambahkan nama dealer */
    body::before {
        content: attr(data-dealer-name);
        display: block;
        font-size: 14pt;
        font-weight: bold;
        border-bottom: 2pt solid #EB0A1E;
        padding-bottom: 8pt;
        margin-bottom: 16pt;
    }

    /* Tabel varian harga — tampilkan penuh */
    table { width: 100% !important; border-collapse: collapse; }
    th, td { border: 1pt solid #ccc; padding: 6pt; }

    /* Halaman simulasi — highlight hasil */
    #res-dp, #res-monthly {
        font-size: 18pt !important;
        font-weight: bold !important;
        color: #000 !important;
    }

    /* URL link tampil saat print */
    a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
    a[href^="javascript"]::after, a[href^="#"]::after { content: ""; }
}

/* ============================================================
   DESIGN SYSTEM — Tokens & Base Styles
   ============================================================ */

/* --- HERO: Fix parallax untuk mobile (iOS Safari tidak support fixed) --- */
.hero-section {
    min-height: 100svh;
    background-attachment: scroll;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 1024px) {
    .hero-section {
        /* Parallax hanya untuk desktop besar */
        background-attachment: fixed;
    }
}

/* --- ACTIVE STATE untuk semua button/interactive di layar sentuh --- */
button:active,
a[href]:active,
[role="button"]:active {
    transform: scale(0.97);
    opacity: 0.92;
}

/* --- PROSE / ARTICLE CONTENT TYPOGRAPHY ---
     Menggantikan Tailwind prose plugin yang tidak aktif di CDN mode */
.article-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
}
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
}
.article-content h1 { font-size: 1.75rem; }
.article-content h2 { font-size: 1.4rem; padding-left: 0.75rem; border-left: 3px solid #EB0A1E; }
.article-content h3 { font-size: 1.2rem; }
.article-content h4 { font-size: 1rem; }
.article-content p  { margin-bottom: 1.25em; }
.article-content strong, .article-content b { font-weight: 700; color: #111827; }
.article-content em, .article-content i { font-style: italic; }
.article-content ul, .article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25em;
}
.article-content ul { list-style-type: disc; }
.article-content ol { list-style-type: decimal; }
.article-content li { margin-bottom: 0.5em; }
.article-content blockquote {
    border-left: 4px solid #EB0A1E;
    padding: 0.75rem 1.25rem;
    background: #FFF5F5;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #4B5563;
    font-style: italic;
    margin: 1.5em 0;
}
.article-content a {
    color: #EB0A1E;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.article-content a:hover { color: #b91c1c; }
.article-content img {
    max-width: 100%;
    border-radius: 0.75rem;
    margin: 1.5em 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.9rem;
}
.article-content th {
    background: #F3F4F6;
    font-weight: 700;
    padding: 0.625rem 1rem;
    text-align: left;
    border: 1px solid #E5E7EB;
}
.article-content td {
    padding: 0.625rem 1rem;
    border: 1px solid #E5E7EB;
}
.article-content tr:nth-child(even) { background: #F9FAFB; }

/* --- SKELETON LOADING --- */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
.skeleton {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    background: #E5E7EB;
    border-radius: 0.5rem;
}
.skeleton-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #F3F4F6;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.skeleton-img  { width: 100%; aspect-ratio: 4/3; background: #E5E7EB; animation: skeleton-pulse 1.5s ease-in-out infinite; }
.skeleton-line { height: 0.875rem; background: #E5E7EB; border-radius: 0.375rem; animation: skeleton-pulse 1.5s ease-in-out infinite; }
.skeleton-line.short  { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.tall   { height: 1.25rem; }

/* --- CARD HOVER BASE --- */
.card-hover {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card-hover:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
    transform: translateY(-4px);
}

/* --- ASPECT RATIO FALLBACK untuk browser lama --- */
.aspect-4-3 {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
}
.aspect-4-3 > * {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- DESIGN SYSTEM: Focus visible (keyboard nav) --- */
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid #EB0A1E;
    outline-offset: 2px;
}

/* --- SCROLLBAR STYLING --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F3F4F6; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* --- FADE IN KEYFRAME (untuk toast dan hero animations) --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ACCESSIBILITY — Reduced Motion (AUDIT FIX)
   Matikan animasi untuk user dengan preferensi reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .page-enter-forward,
    .page-exit-forward,
    .page-enter-backward,
    .page-exit-backward {
        animation: none !important;
    }
}

/* ============================================================
   FOCUS VISIBLE — Keyboard navigation (AUDIT FIX)
   ============================================================ */
:focus-visible {
    outline: 2px solid #EB0A1E;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #EB0A1E;
    outline-offset: 3px;
}
