/* ==========================================
   FONT FAMILY
   ========================================== */
body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
}

.font-chinese { font-family: 'Noto Serif SC', 'Ma Shan Zheng', serif; }

h1, h2, h3 {
    font-family: 'Noto Serif SC', 'Ma Shan Zheng', serif;
    letter-spacing: 0.01em;
}

.chinese-title {
    font-family: 'Ma Shan Zheng', cursive;
    letter-spacing: 0.05em;
}

.chinese-subtitle {
    font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
    letter-spacing: 0.03em;
}

/* ==========================================
   BACKGROUND PATTERNS
   ========================================== */
body {
    background-color: #fdfbf7;
    background-image: url('assets/pattern/wave.jpg');
    background-size: 280px;
    background-repeat: repeat;
    background-attachment: fixed;
    background-blend-mode: multiply;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(253, 251, 247, 0.92) 0%, rgba(253, 251, 247, 0.88) 100%);
    pointer-events: none;
    z-index: 0;
}

/* Main card dengan geometric pattern halus */
.max-w-4xl.bg-white {
    background-color: rgba(255, 255, 255, 0.97);
    background-image: url('assets/pattern/geometric.jpg');
    background-size: 400px;
    background-position: center;
    background-blend-mode: soft-light;
    position: relative;
    z-index: 1;
}

.max-w-4xl.bg-white::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.94);
    pointer-events: none;
    z-index: 0;
}

/* Content di dalam kartu utama */
.max-w-4xl.bg-white > *:not([id$="-modal"]) {
    position: relative;
    z-index: 1;
}

/* ==========================================
   MODAL OVERLAY - FIX UTAMA
   Modal HARUS di atas segalanya, tidak boleh terkurung
   ========================================== */
#qris-modal,
#waiting-modal,
#loading-modal,
#multi-person-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: rgba(0, 0, 0, 0.7);
}

/* Modal content box */
#qris-modal > div,
#waiting-modal > div,
#loading-modal > div,
#multi-person-modal > div {
    animation: fadeInScale 0.4s ease-out;
    position: relative;
    z-index: 10000;
}

/* Sembunyikan modal yang memiliki class hidden */
#qris-modal.hidden,
#waiting-modal.hidden,
#loading-modal.hidden,
#multi-person-modal.hidden {
    display: none !important;
}

/* Header dengan seigaiha pattern */
.bg-gradient-to-r.from-red-900 {
    background-image: 
        linear-gradient(to right, rgba(127, 29, 29, 0.92), rgba(153, 27, 27, 0.92), rgba(127, 29, 29, 0.92)),
        url('assets/pattern/seigaiha.jpg') !important;
    background-size: cover, 120px !important;
    background-blend-mode: multiply;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes floatUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.9); }
    60% { opacity: 1; transform: translateY(-5px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulseSoft {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-fade-in { animation: fadeIn 0.7s ease-out both; }
.animate-fade-in-scale { animation: fadeInScale 0.6s ease-out both; }
.animate-slide-left { animation: slideInLeft 0.6s ease-out both; }
.animate-float-up { animation: floatUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.animate-pulse-soft { animation: pulseSoft 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* ==========================================
   SCROLL REVEAL
   ========================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* ==========================================
   PACKAGE CARDS
   ========================================== */
.package-card {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}
.package-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(153, 27, 27, 0.25);
}
.package-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.15), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}
.package-card:hover::before { left: 100%; }

/* ==========================================
   SHIO ICONS
   ========================================== */
.shio-icon-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(153, 27, 27, 0.2));
    transition: transform 0.3s ease;
}
.shio-icon-img:hover { transform: scale(1.1) rotate(-3deg); }
.shio-icon-sm { width: 48px; height: 48px; object-fit: contain; display: inline-block; }

/* ==========================================
   SCROLLBAR
   ========================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #fdfbf7; }
::-webkit-scrollbar-thumb { background: #991b1b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #7f1d1d; }

/* ==========================================
   STEP TRANSITIONS
   ========================================== */
#step-input, #step-packages, #step-result {
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

/* ==========================================
   BUTTON EFFECTS
   ========================================== */
button, .cursor-pointer { transition: all 0.2s ease; }
button:active { transform: scale(0.98); }

/* ==========================================
   FIELD NOTE
   ========================================== */
.field-note {
    background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: slideInLeft 0.5s ease-out;
}
.field-note-icon { flex-shrink: 0; font-size: 16px; }

/* ==========================================
   PULSING DOT
   ========================================== */
.pulse-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #991b1b;
    animation: pulseDot 1.5s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ==========================================
   SCROLL PROGRESS BAR
   ========================================== */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, #991b1b, #f59e0b);
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 0 8px rgba(153, 27, 27, 0.5);
}

/* ==========================================
   PREMIUM CARD SHIMMER
   ========================================== */
.card-premium { position: relative; overflow: hidden; }
.card-premium::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.1) 50%, transparent 70%);
    animation: shimmerRotate 6s linear infinite;
    pointer-events: none;
}
@keyframes shimmerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   SCORE HIGHLIGHT
   ========================================== */
.score-highlight {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}