/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-image: url('../img/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* Kunci background agar tidak gerak */
    min-height: 100vh;
    color: #000;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
}

/* --- Header & Navbar --- */
header {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 15px;
}

.navbar-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 65px;
    width: auto;
    flex-shrink: 0;
}

nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    height: 65px;
    display: flex;
    align-items: center;
    padding: 0 80px;
    /* Navbar Panjang */
    border-radius: 20px;
    /* Radius 20px sesuai permintaan */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 40px;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    /* Warna teks default agak pudar */
    font-size: 1.1rem;
    font-weight: 500;
    white-space: nowrap;
    transition: 0.3s;
    padding: 8px 15px;
    border-radius: 10px;
}

/* --- Indikator Page Aktif (Bercahaya & Berwarna) --- */
nav ul li a.active {
    color: #000;
    /* Teks jadi hitam pekat */
    font-weight: 700;
}

nav ul li a:hover {
    color: #000;
}

/* --- Hero Section --- */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 10px;
}

.hero .subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    margin-bottom: 40px;
}

.cta-instruction {
    margin-bottom: 20px;
}

/* --- Tombol Start Simetris Sempurna --- */
.btn-start {
    background-color: #FFF3D0;
    border: 1px solid #DCDCDC;
    padding: 20px 60px;
    /* Padding atas-bawah & kiri-kanan seimbang */
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;

    display: inline-flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    /* Reset line-height agar teks tidak miring */
}

.btn-start:hover {
    background-color: #ffe8a3;
    transform: scale(1.02);
}

/* --- Link Click Here --- */
.help-text {
    margin-top: 25px;
    /* Jangan taruh underline di sini */
}

.help-text a {
    color: #000;
    text-decoration: underline;
    /* TARUH DI SINI */
    font-weight: 700;
}

/* --- Footer --- */
footer {
    width: 100%;
    text-align: center;
    padding-bottom: 15px;
}

.footer-line {
    width: 90%;
    max-width: 850px;
    height: 1px;
    background-color: #000;
    margin: 10px auto;
}

/* --- Responsive HP --- */
@media (max-width: 600px) {
    body {
        background-attachment: scroll;
    }

    .logo {
        height: 55px;
        /* Logo dikecilkan sedikit agar tidak memakan tempat vertikal */
        flex-shrink: 0;
        /* Mencegah logo dipaksa gepeng oleh browser */
    }

    nav {
        height: 55px;
        /* Tinggi navbar disamakan dengan logo */
        padding: 0 15px;
        /* DIKECILKAN: padding kiri-kanan dikurangi supaya tidak lebar */
        border-radius: 12px;
        gap: 10px;
    }

    nav ul {
        gap: 12px;
        /* Jarak antar teks menu dipersempit */
    }

    nav ul li a {
        font-size: 0.95rem;
        /* Ukuran teks diperkecil sedikit */
        padding: 0 5px;
    }

    .btn-start {
        padding: 15px 45px;
        font-size: 1.1rem;
    }
}

/* --- Khusus Halaman Content (How to Use) --- */
.content-page {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.how-to-container {
    max-width: 800px;
    text-align: left;
    /* Teks langkah-langkah rata kiri */
}

.how-to-container h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.instructions-list {
    list-style-position: outside;
    margin-left: 20px;
}

.instructions-list li {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Penyesuaian Mobile untuk Content */
@media (max-width: 600px) {
    .how-to-container h2 {
        font-size: 1.8rem;
    }

    .instructions-list li {
        font-size: 0.95rem;
    }
}

/* --- Khusus Halaman About --- */
/* Gunakan container ini agar teks tidak mentok pinggir tapi tetap sejajar */
.about-container {
    max-width: 900px;
    width: 100%;
    text-align: left;
    padding: 0 20px;
    /* Jaga padding tetap sama dengan hero di home */
    margin: 0 auto;
    /* Menjaga konten tetap di tengah */
}

.about-container h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 25px;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Ganti .team-list menjadi class yang kamu pakai di HTML */
.team-list {
    list-style-type: disc;
    margin-left: 20px;
}

.team-list li {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* Style Link Instagram agar bisa dipencet dan terlihat jelas */
.team-list a {
    color: #000;
    text-decoration: underline;
    font-weight: 700;
    transition: 0.3s;
}

.team-list a:hover {
    color: #555;
}

/* Penyesuaian Mobile */
@media (max-width: 600px) {

    .about-text p,
    .team-list li {
        font-size: 0.95rem;
    }

    .about-container {
        padding: 0 15px;
        /* Sesuaikan dengan padding mobile di home */
    }
}

/* --- Style Khusus Choose Frame --- */
.selection-title {
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin-top: 10px !important;
    /* Tambah sedikit biar gak nempel atas browser */
    margin-bottom: 20px !important;
    color: #000;
    text-align: center;
    width: 100%;
}

.frame-grid {
    display: flex;
    justify-content: center;
    /* Mengecilkan jarak antar frame (sebelumnya 30px) */
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.frame-item {
    /* Lebar kotak frame di laptop */
    width: 140px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.frame-item img {
    /* Pastikan gambar memenuhi lebar kotak frame-item */
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.frame-item:hover {
    transform: scale(1.05);
}

/* --- Style Tombol Cancel/Return --- */
.btn-cancel-return {
    background-color: #FFF3D0;
    border: 1px solid #DCDCDC;
    padding: 18px 50px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #000;
}

.btn-cancel-return:hover {
    background-color: #ffe8a3;
    transform: scale(1.02);
}


.selection-footer {
    width: 100%;
    margin-top: 5px;
    /* Jarak dari tombol cancel ke footer */
    padding: 20px 0;
    text-align: center;
}

/* --- Responsif Mobile (Anti Kebesaran) --- */
@media (max-width: 768px) {
    .selection-title {
        font-size: 1.7rem !important;
        margin-bottom: 30px !important;
        margin-top: 20px !important;
    }

    /* Di HP, kita buat frame lebih kecil (mirip look di laptop) */
    .frame-item {
        width: 130px;
        /* Ukuran lebih kecil agar tidak menuhin layar */
    }

    .frame-grid {
        gap: 20px;
        /* Jarak antar frame lebih rapat di HP */
    }

    .btn-cancel-return {
        padding: 15px 40px;
        font-size: 1rem;
        width: auto;
        /* Jangan paksa full width agar mirip laptop */
        min-width: 200px;
    }
}

@media (max-width: 400px) {

    /* Untuk HP kecil, kita pastikan tetap muat 2 kolom */
    .frame-item {
        width: 110px;
    }
}

/* --- Photobooth Page --- */
.camera-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    /* Tidak full layar, kotak di tengah */
    aspect-ratio: 16 / 10;
    /* Proporsi container kamera sesuai screenshot */
    background: #333;
    /* Background gelap di belakang video */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1a1a;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Biar video memenuhi kotak tanpa distorsi */
    transform: scaleX(-1);
    /* Efek mirror kamera */
}

/* --- Tips Modal / Notification --- */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Overlay sedikit lebih terang agar fokus ke box */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(2px);
    /* Memberikan efek blur halus di belakang modal */
}

.tips-box {
    background-color: #FDF1D3;
    width: 85%;
    max-width: 550px;
    padding: 30px 30px 45px 30px;
    /* Padding bawah agak besar buat ruang tombol */
    border-radius: 30px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 2px solid #ffffff;
    

    /* Penting agar kita bisa atur posisi tombol relatif terhadap box ini */
    position: relative;
}

.tips-actions {
    position: absolute;
    /* Kita cabut tombol dari alur teks biasa */
    bottom: -25px;
    /* Geser ke bawah sejauh setengah tinggi tombol */
    left: 50%;
    /* Geser ke tengah */
    transform: translateX(-50%);
    /* Geser balik ke kiri agar benar-benar center */

    display: flex;
    gap: 15px;
    width: 100%;
    /* Pastikan container tombol cukup lebar */
    justify-content: center;
}

.tips-content h3 {
    margin-top: 0;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.tips-content p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #333;
    margin-bottom: 0;
}


/* Base Style untuk kedua tombol */
.btn-ready,
.btn-cancel-tips {
    padding: 15px 30px;
    border-radius: 50px;
    /* Tombol lonjong sesuai desain */
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    /* Mencegah teks tombol turun ke bawah */
    text-transform: uppercase;
    /* Membuat teks jadi kapital */
    letter-spacing: 0.5px;
}

/* Tombol Ready (Putih) */
.btn-ready {
    background-color: #FDF1D3;
    color: #000;
    outline: 1px solid #ffffff;
    /* Garis putih tipis untuk efek kontras */
}

/* Tombol Cancel (Krem Kecokelatan) */
.btn-cancel-tips {
    background-color: #FDF1D3;
    color: #333;
    outline: 1px solid #ffffff;
    /* Garis putih tipis untuk efek kontras */
}

/* --- Efek Hover (Sesuai Permintaan) --- */
.btn-ready:hover,
.btn-cancel-tips:hover {
    background-color: #ffe8a3;
    /* Warna kuning muda saat hover */
    transform: scale(1.05);
    /* Sedikit membesar */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.btn-ready:active,
.btn-cancel-tips:active {
    transform: scale(0.98);
    /* Efek membal saat diklik */
}

/* Responsif Mobile */
@media (max-width: 768px) {
    .tips-box {
        padding: 25px;
        border-radius: 20px;
    }

    .tips-actions {
        flex-direction: column;
        /* Tombol tumpuk di HP agar muat */
        gap: 12px;
    }

    .btn-ready,
    .btn-cancel-tips {
        width: 100%;
        padding: 12px;
    }
}

/* --- Responsif Mobile (Tetap Landscape) --- */
@media (max-width: 768px) {
    /* Container Utama Kamera */
.camera-container {
    position: relative;
    width: 90%;
    max-width: 600px; /* Batas lebar maksimal */
    margin: 20px auto;
    
    /* PAKSA LANDSCAPE 4:3 */
    aspect-ratio: 4 / 3 !important; 
    
    /* PENTING: Agar rounded corner tidak rusak saat video nyala */
    border-radius: 30px; 
    overflow: hidden; 
    
    background: #000;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Elemen Video di Dalamnya */
#video {
    width: 100%;
    height: 100%;
    
    /* PAKSA VIDEO MENGIKUTI KOTAK 4:3 TANPA GEPENG */
    object-fit: cover; 
    
    /* Mirroring */
    transform: scaleX(-1);
}

    /* Penyesuaian Box Tips agar muat di area landscape yang sempit */
    .tips-box {
        width: 85%;
        padding: 20px 20px 35px 20px;
        margin-bottom: 8px; 
        /* Biar box tidak terlalu tinggi kalau layar HP sangat pendek */
        max-height: 80vh; 
        overflow-y: visible; 
    }

    .tips-content h3 {
        font-size: 1.1rem;
        margin-bottom: 5px;
    }

    .tips-content p {
        font-size: 0.85rem;
        line-height: 1.2;
    }

    /* Tombol tetap nempel setengah keluar */
    .tips-actions {
        bottom: -18px;
        flex-direction: row;
        /* Di landscape, tombol kiri-kanan lebih hemat tempat daripada tumpuk */
        gap: 10px;
        width: 95%;
    }

    .btn-ready,
    .btn-cancel-tips {
        flex: 1;
        /* Bagi rata lebar tombol */
        padding: 10px 5px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
}

/* Angka Countdown */
.countdown-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
    z-index: 50;
    display: none; /* Muncul lewat JS */
    pointer-events: none;
    font-family: 'Arial', sans-serif;
}

/* Efek Kilat */
.flash-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 9999;
    animation: flashAnim 0.2s ease-out forwards;
}

@keyframes flashAnim {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Container utama hero, pastikan kontennya center */
.hero {
    position: relative;
    display: flex;
    flex-direction: column; /* Mengatur konten ke bawah (teks lalu kamera) */
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

/* Container Utama Loading */
.modal-overlay-loading {
    display: none; /* Diatur jadi 'flex' lewat JavaScript */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: transparent;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* Konten di dalamnya */
.loading-content-clean {
    text-align: center;
    padding: 20px;
}

/* Teks Loading - Gede dan Bold */
.loading-text {
    margin-top: 30px;
    font-family: 'Poppins', sans-serif;
    color: #333;
    font-weight: 800;
    font-size: 1.5rem; /* Ukuran besar yang proporsional */
    line-height: 1.2;
    max-width: 800px; /* Agar teks tidak terlalu lebar ke samping */
}

/* Spinner Animasi */
.spinner {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(0, 0, 0, 0.1);
    border-top: 8px solid #333;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Gerakan Muter */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    /* Atur teks agar tidak terlalu besar di layar kecil */
    .loading-text {
        font-size: 1.5rem; /* Ukuran lebih pas untuk HP */
        margin-top: 20px;
        padding: 0 15px; /* Tambah ruang di samping agar teks tidak nempel layar */
        max-width: 100%;
    }

    /* Kecilkan spinner sedikit agar proporsional */
    .spinner {
        width: 60px;
        height: 60px;
        border-width: 6px;
    }

    /* Pastikan container hero punya tinggi yang cukup di mobile */
    .hero {
        min-height: 60vh;
    }
}

/* --- OPTIONAL: HP SANGAT KECIL (iPhone SE dll) --- */
@media (max-width: 480px) {
    .loading-text {
        font-size: 1.1rem;
    }
}



/* GAYA TEKS INSTRUKSI (Di atas box) */
.instruction-text {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem; /* Cukup besar tapi tidak menutupi kamera */
    font-weight: 700;
    color: #333;
    margin-bottom: -10px; /* Jarak ke box kamera di bawahnya */
    text-align: center;
    z-index: 5;
    text-transform: none !important; /* Tambahkan ini agar mengikuti teks asli di JS */
}

/* --- RESPONSIF MOBILE --- */
@media (max-width: 768px) {
    .instruction-text {
        font-size: 1.6rem; /* Ukuran pas untuk HP */
        margin-bottom: -5px;
    }
}

/* Container Utama Hasil */
.result-container {
    display: none; 
    flex-direction: column;
    align-items: center;
    /* GANTI INI: flex-start memaksa semua konten mulai dari atas */
    justify-content: flex-start; 
    text-align: center;
    padding: 0px 20px; 
    width: 100%;
    
    /* Tambahkan ini untuk menarik seluruh blok ke atas */
    margin-top: 20px; 
    
    animation: fadeIn 0.8s ease-in-out;
}

/* Judul */
.result-title {
    font-family: 'Poppins', sans-serif;
    color: #333;
    text-align: center;
    width: 100%;

    /* PERUBAHAN DISINI */
    font-size: 2rem;    /* Gedein dikit dari sebelumnya */
    font-weight: 600;     /* Bikin lebih tebal biar tegas */
    margin-top: -50px;    /* Angka negatif buat narik teks lebih ke atas lagi */
    margin-bottom: 15px;  /* Jarak tipis ke foto */
}

/* Wrapper untuk Canvas */
.canvas-wrapper {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    line-height: 0;
    max-width: 140px; 
    background-color: #fff;
    margin: 0 auto;
}

/* Container Tombol */
.result-actions {
    margin-top: 20px; /* Kurangi jarak dari foto ke tombol biar gak kepanjangan */
    display: flex;
    gap: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Judul */

/* Canvas itu sendiri */
#resultCanvas {
    max-width: 100%;
    height: auto;
}

/* Container Tombol */

.btn-action {
    /* ... properti lainnya ... */
    padding: 12px 0;         /* Padding samping diubah jadi 0 supaya width yang kontrol */
    width: 160px;            /* Tentukan lebar tetap yang kamu mau */
    text-align: center;      /* Pastikan teks tetap di tengah */
    
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background-color: #f1e7d0;
    color: #333;
    border: 1px solid #ccc;
    transition: all 0.3s ease;
}
.btn-action:hover {
    background-color: #ffe8a3;
    transform: scale(1.02);
}

@media (max-width: 768px) {

    .result-title {
        font-size: 1.7rem;
    }
}
