/* =================================== */
/*   VARIABLES & KEYFRAMES             */
/* =================================== */
:root {
    --bg-color: #000000; /* Hitam pekat */
    --card-bg: rgba(10, 5, 40, 0.4);
    --card-bg-solid: #0A0528;
    --card-border: rgba(52, 152, 219, 0.2);
    --card-border-hover: rgba(52, 152, 219, 0.6);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0b0;
    --accent-primary: #3498DB; /* Biru Kristal */
    --accent-secondary: #2980B9; /* Biru Kristal lebih gelap */
    --glow-color: rgba(52, 152, 219, 0.3);
    --error-bg: rgba(255, 100, 100, 0.1);
    --error-border: rgba(255, 100, 100, 0.5);
    --error-text: #ffc0c0;
}
@keyframes nebula-drift {
    0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; }
}
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } 
}

/* =================================== */
/*   BASE & BACKGROUND SETUP           */
/* =================================== */
html, body {
    margin: 0; padding: 0; width: 100%; overflow-x: hidden; scroll-behavior: smooth;
}
body {
    font-family: 'Poppins', sans-serif; color: var(--text-primary);
    background-color: var(--bg-color);
}
#galaxy-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    
    /* --- UBAH BAGIAN INI --- */
    background-image: url('https://tafsirmimpiku.online/asset/background.webp'); /* <-- MASUKKAN URL GAMBAR ANDA DI SINI */
    background-size: cover; /* Membuat gambar menutupi seluruh layar */
    background-position: center; /* Memposisikan gambar di tengah */
    background-repeat: no-repeat; /* Mencegah gambar berulang */
    background-attachment: fixed; /* Membuat gambar tetap saat scroll */
    filter: blur(6px); 
    /* --- AKHIR PERUBAHAN --- */
    
    z-index: -2;
}
#star-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
}

/* =================================== */
/*   NAVIGASI HEADER                   */
/* =================================== */
.header-nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001; /* Pastikan di atas elemen lain */
}
.register-button {
    padding: 10px 25px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}
.register-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(52, 152, 219, 0.6);
}

/* =================================== */
/*   MAIN LAYOUT & HERO HEADER         */
/* =================================== */
.content-wrapper {
    display: flex; flex-direction: column; align-items: center;
    padding: 40px 20px; box-sizing: border-box;
    padding-top: 80px; /* Tambahkan padding atas agar tidak tertutup tombol daftar */
}
.hero-header {
    text-align: center; margin-bottom: 40px; animation: fadeIn 1s ease;
}
.hero-header h1 {
    font-family: 'Playfair Display', serif; font-size: 42px; margin: 0;
    text-shadow: 0 0 15px var(--glow-color), 0 0 5px #fff;
}
.hero-header p {
    font-size: 18px; color: var(--text-secondary); margin-top: 10px;
}

/* =================================== */
/*   DASHBOARD GRID LAYOUT             */
/* =================================== */
.dashboard-grid {
    display: grid;
    width: 100%;
    max-width: 1200px;
    grid-template-columns: 1fr 2fr; 
    gap: 25px;
}
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 25px;
    display: flex; flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 0 20px rgba(159,90,253,0.1);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease forwards;
}
.card:hover {
    transform: translateY(-5px);
    border-color: var(--card-border-hover);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 30px var(--glow-color);
}

/* =================================== */
/*   PENEMPATAN GRID SPESIFIK (FINAL)  */
/* =================================== */
#result-togel { 
    grid-column: 1 / 2; 
    grid-row: 1 / 2; 
}
#shio-checker { 
    grid-column: 1 / 2; 
    grid-row: 2 / 3; 
}
#tafsir-mimpi { 
    grid-column: 2 / 3; 
    grid-row: 1 / 3; /* Memanjang setinggi 2 baris */
}
#hoki-generator { 
    grid-column: 1 / 2; 
    grid-row: 3 / 4; 
}
#primbon { 
    grid-column: 2 / 3; 
    grid-row: 3 / 5; /* PERUBAHAN: Memanjang setinggi 2 baris agar sejajar dengan generator dan weton */
}
#weton-calculator { 
    grid-column: 1 / 2; 
    grid-row: 4 / 5; /* Menempatkannya di baris ke-4, kolom pertama */
}

/* =================================== */
/*   CARD STYLING (HEADER & CONTENT)   */
/* =================================== */
.card-header {
    display: flex; align-items: center; gap: 15px;
    padding-bottom: 15px; margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
}
.card-icon {
    flex-shrink: 0; width: 40px; height: 40px;
    background-color: rgba(159, 90, 253, 0.1);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.card-icon svg { width: 24px; height: 24px; color: var(--accent-primary); }
.card-header h2 {
    font-size: 20px; font-weight: 600; margin: 0;
    color: var(--text-primary);
}
.card-content { display: flex; flex-direction: column; flex-grow: 1; }

/* =================================== */
/*   FORM ELEMENTS STYLING             */
/* =================================== */
input, select {
    width: 100%; padding: 12px 16px; font-size: 15px;
    background-color: rgba(0, 0, 0, 0.3); border: 1px solid var(--card-border);
    border-radius: 8px; color: var(--text-primary); transition: all 0.3s ease;
    box-sizing: border-box;
}
input::placeholder { color: var(--text-secondary); opacity: 0.7; }
input:focus, select:focus {
    outline: none; border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(159, 90, 253, 0.3);
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239f5afd' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center; background-repeat: no-repeat; background-size: 1.2em; padding-right: 3rem;
}
select option { background: var(--card-bg-solid); color: var(--text-primary); }
button {
    padding: 12px 20px; font-size: 15px; font-weight: 600; color: #fff;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    border: none; border-radius: 8px; cursor: pointer;
    transition: all 0.3s ease;
}
button:hover:not(:disabled) {
    transform: translateY(-2px); box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
}
button:disabled { background: #555; cursor: not-allowed; transform: none; box-shadow: none; }

/* Form Layouts */
.search-form, .primbon-single-form, .togel-search-form, .shio-form {
    display: flex; gap: 10px;
}
.search-form input, .primbon-single-form input, .togel-search-form input, .shio-form input { flex-grow: 1; }

/* =================================== */
/*   MODULE SPECIFIC STYLES            */
/* =================================== */
/* Tafsir Mimpi Results (DENGAN SCROLL) */
.results-area {
    margin-top: 20px;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 550px; /* Batas tinggi maksimal untuk memicu scroll */
    padding-right: 10px; /* Memberi ruang agar konten tidak menempel pada scrollbar */
}
.results-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 15px; 
}
.result-category h2 { font-size: 18px; margin: 15px 0 10px; }
.result-item {
    background: rgba(0,0,0,0.2); 
    padding: 10px 15px; 
    border-radius: 8px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    font-size: 14px;
}
.result-item .kode { font-weight: bold; font-size: 16px; color: var(--accent-primary); }

/* Primbon */
.primbon-tab-nav { display: flex; border-bottom: 1px solid var(--card-border); margin-bottom: 15px; }
.primbon-tab-btn {
    flex-grow: 1; padding: 10px; font-size: 14px; background: transparent;
    color: var(--text-secondary); border: none; border-bottom: 3px solid transparent;
    cursor: pointer; transition: all 0.3s;
}
.primbon-tab-btn.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.primbon-tab-panel { display: none; animation: fadeIn 0.5s; }
.primbon-tab-panel.active { display: block; }
#jodoh-form .jodoh-form-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
.primbon-result-area { margin-top: 15px; font-size: 14px; max-height: 450px; overflow-y: auto; padding-right: 10px; }
.primbon-result-area h4 { font-size: 16px; margin: 10px 0 5px; color: var(--accent-primary); }

/* Togel, Shio, Hoki */
.togel-single-result-area, .shio-result-area {
    margin-top: 15px; min-height: 60px; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.2); border-radius: 8px;
}
.pasaran-name { font-size: 18px; }
.togel-result-number { font-size: 28px; font-weight: 700; color: var(--accent-primary); letter-spacing: 5px; }
.shio-result-area { font-size: 18px; font-weight: 600; }
.shio-name { color: var(--accent-primary); }

.hoki-numbers { display: flex; justify-content: space-around; margin-bottom: 15px; }
.hoki-number { font-family: "Courier New", monospace; font-size: 24px; color: var(--accent-primary); background: rgba(0,0,0,0.2); padding: 10px; border-radius: 8px; }
#generate-button { width: 100%; }

/* General Status Messages inside cards */
.status { padding: 20px; text-align: center; color: var(--text-secondary); font-style: italic; }
.error { color: var(--error-text); background-color: var(--error-bg); border: 1px solid var(--error-border); border-radius: 8px;}

/* Sedikit penyesuaian untuk area hasil agar tidak terlalu mepet */
#weton-result-area {
    margin-top: 20px;
    min-height: 100px; /* Memberi tinggi minimal agar kartu seimbang */
}


/* =================================== */
/*   MAIN FOOTER SECTION               */
/* =================================== */
.main-footer {
    width: 100%;
    max-width: 1200px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--card-border);
    text-align: center;
    animation: fadeIn 1.5s ease;
}
.subsection-title {
    font-size: 28px;
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    margin-bottom: 40px;
}
.how-it-works {
    max-width: 800px;
    margin: 0 auto 60px auto;
}
.how-it-works-list {
    list-style: none;
    padding: 0;
    counter-reset: step-counter;
}
.how-it-works-list li {
    position: relative;
    text-align: left;
    padding-left: 60px;
    margin-bottom: 30px;
}
.how-it-works-list li::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 40px; height: 40px;
    background: var(--accent-primary);
    color: #fff; font-weight: bold; font-size: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px var(--glow-color);
}
.step-content h4 {
    margin: 0 0 8px 0; font-size: 18px; color: var(--text-primary);
}
.step-content p {
    margin: 0; color: var(--text-secondary); line-height: 1.6;
}

.features-section {
    margin-bottom: 60px;
}
.features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 25px;
    text-align: left;
    transition: transform 0.3s ease, border-color 0.3s ease;
    flex: 1 1 280px; /* Ukuran kartu dibuat fleksibel */
    max-width: 350px; /* Menambahkan lebar maksimum agar tidak terlalu besar */
}
.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--card-border-hover);
}
.feature-icon {
    width: 40px; height: 40px;
    margin-bottom: 15px;
}
.feature-icon svg {
    width: 100%; height: 100%; color: var(--accent-primary);
}
.feature-card h3 {
    font-size: 20px;
    margin: 0 0 10px 0;
    color: var(--text-primary);
}
.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.final-cta {
    font-size: 16px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 30px;
}
.footer-credit {
    color: var(--text-secondary); opacity: 0.7;
}

/* =================================== */
/*   RESPONSIVE DESIGN (MOBILE)        */
/* =================================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        /* Kembali menjadi satu kolom di tablet dan mobile */
        grid-template-columns: 1fr;
    }
    /* Reset semua penempatan grid agar menumpuk secara alami */
    #result-togel,
    #shio-checker,
    #tafsir-mimpi,
    #hoki-generator,
    #primbon,
    #weton-calculator {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .hero-header h1 { font-size: 32px; }
    .hero-header p { font-size: 16px; }

    .search-form, .primbon-single-form, .togel-search-form, .shio-form {
        flex-direction: column;
        align-items: stretch;
    }
    /* PENYESUAIAN RESPONSIVE UNTUK TOMBOL DAFTAR */
    .header-nav {
        top: 15px;
        right: 15px;
    }
    .register-button {
        padding: 8px 20px;
        font-size: 14px;
    }
}

/* Custom Scrollbar Styling */
.primbon-result-area::-webkit-scrollbar,
.results-area::-webkit-scrollbar {
  width: 8px;
}
.primbon-result-area::-webkit-scrollbar-track,
.results-area::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
}
.primbon-result-area::-webkit-scrollbar-thumb,
.results-area::-webkit-scrollbar-thumb {
  background: var(--accent-secondary); 
  border-radius: 10px;
}
.primbon-result-area::-webkit-scrollbar-thumb:hover,
.results-area::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary); 
}
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 24px;
    line-height: 50px;
    text-decoration: none;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.5);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: var(--accent-secondary);
    transform: translateY(-5px);
}