/* =================================== */
/*   VARIABLES & KEYFRAMES             */
/* =================================== */
:root {
    --bg-color: #050000; /* Hitam pekat SHIOBET */
    --card-bg: rgba(20, 5, 5, 0.6); /* Merah sangat gelap transparan */
    --card-bg-solid: #0f0505;
    --card-border: rgba(204, 0, 0, 0.2); /* Merah transparan */
    --card-border-hover: rgba(255, 0, 0, 0.6);
    --text-primary: #f0f0f0;
    --text-secondary: #c0a0a0;
    --accent-primary: #cc0000; /* Merah Utama SHIOBET */
    --accent-secondary: #800000; /* Maroon Gelap */
    --glow-color: rgba(204, 0, 0, 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%;
    
    background-image: url('/asset/background.webp'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat; 
    background-attachment: fixed; 
    
    /* FILTER KALIBRASI: Mengubah latar belakang menjadi Merah-Hitam Gelap khas SHIOBET */
    filter: blur(6px) grayscale(0.4) brightness(0.2) sepia(0.6) hue-rotate(345deg) saturate(2.5);
    
    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; 
}
.register-button {
    padding: 10px 25px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    /* Gradient Merah Solid sesuai bar navigasi SHIOBET */
    background: linear-gradient(to bottom, #cc0000 0%, #7a0000 100%);
    border: 1px solid #ff4d4d;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.4);
    text-transform: uppercase;
}
.register-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(204, 0, 0, 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; 
}
.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;
    color: #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.8), inset 0 0 20px rgba(204, 0, 0, 0.05);
    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.9), 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; }
#hoki-generator { grid-column: 1 / 2; grid-row: 3 / 4; }
#primbon { grid-column: 2 / 3; grid-row: 3 / 5; }
#weton-calculator { grid-column: 1 / 2; grid-row: 4 / 5; }

/* =================================== */
/*   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(204, 0, 0, 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.7); border: 1px solid var(--card-border);
    border-radius: 4px; 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(204, 0, 0, 0.2);
}
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='%23cc0000' 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(to bottom, #cc0000 0%, #660000 100%);
    border: none; border-radius: 4px; cursor: pointer;
    transition: all 0.3s ease;
}
button:hover:not(:disabled) {
    transform: translateY(-2px); box-shadow: 0 4px 20px rgba(204, 0, 0, 0.5);
}
button:disabled { background: #333; cursor: not-allowed; }

.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; 
    padding-right: 10px; 
}
.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.4); 
    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.5); border-radius: 8px; border: 1px solid var(--card-border);
}
.pasaran-name { font-size: 18px; font-weight: 600; color: var(--accent-primary); }
.togel-result-number { font-size: 28px; font-weight: 700; color: #fff; letter-spacing: 5px; text-shadow: 0 0 10px var(--glow-color); }
.shio-result-area { font-size: 18px; font-weight: 600; color: var(--accent-primary); }
.shio-name { color: #fff; }

.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.5); padding: 10px; border-radius: 8px; border: 1px solid var(--card-border); }
#generate-button { width: 100%; }

/* General Status Messages */
.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;}

#weton-result-area { margin-top: 20px; min-height: 100px; }


/* =================================== */
/*   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; max-width: 350px; 
}
.feature-card:hover { transform: translateY(-5px); border-color: var(--accent-primary); }
.feature-icon { width: 40px; height: 40px; margin-bottom: 15px; }
.feature-icon svg { width: 40px; height: 40px; 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 { grid-template-columns: 1fr; }
    #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; }
    .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-primary); border-radius: 10px; }

#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; z-index: 100;
    opacity: 0; visibility: hidden; transition: 0.3s; box-shadow: 0 4px 15px rgba(204, 0, 0, 0.5);
}
#back-to-top.show { opacity: 1; visibility: visible; }

.popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.4s; backdrop-filter: blur(5px);
}
.popup-overlay.show { opacity: 1; visibility: visible; }
.popup-content.full-image { width: 90%; max-width: 450px; position: relative; box-shadow: 0 0 40px rgba(204, 0, 0, 0.6); }

.close-popup-btn {
    position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
    background: rgba(0, 0, 0, 0.6); color: #fff; border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%; font-size: 20px; cursor: pointer; transition: 0.3s;
}