/* =================================================================
   BASE, RESET & VARIABLES
   ================================================================= */
:root {
    --bg-body: #f0f2f5; 
    --bg-app: rgba(255, 255, 255, 0.95); 
    
    --text-main: #2d3748;
    --text-muted: #718096;
    
    /* Primary Colors */
    --color-blue: #1877f2;
    --color-pink: #d8459e;
    --color-yellow: #f5b120;
    --color-green: #28a745;
    --color-orange: #fd7e14;
    --color-purple: #6f42c1;
    --color-cyan: #17a2b8;
    --color-magenta: #e83e8c;

    /* Soft Background Colors */
    --soft-blue: #eef5ff;
    --soft-pink: #fdf0f5;
    --soft-yellow: #fff9ea;
    --soft-green: #eef9f0;
    --soft-orange: #fff2e8;
    --soft-purple: #f3eef9;
    --soft-cyan: #e8f8f9;
    --soft-magenta: #fceaf2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
}

a { text-decoration: none; }

/* =================================================================
   PARTICLES BACKGROUND (DIPERBARUI)
   ================================================================= */
canvas#particles-bg {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -1; 
    background-color: #f4f7fb;
    pointer-events: none; /* Agar klik tembus ke elemen di bawahnya */
}

/* =================================================================
   SIDEBAR & OVERLAY 
   ================================================================= */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 1001;
    opacity: 0; visibility: hidden; backdrop-filter: blur(3px);
    transition: 0.3s ease;
}
.overlay.active { opacity: 1; visibility: visible; }

.sidebar {
    position: fixed; top: 0; left: 0; width: 280px; height: 100%;
    background: #ffffff; z-index: 1002;
    box-shadow: 5px 0 25px rgba(0,0,0,0.15);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex; flex-direction: column;
}
.sidebar.active { transform: translateX(0); }

.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 25px; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.sidebar-logo { max-width: 150px; height: auto; }
.btn-icon-close {
    background: var(--soft-pink); color: var(--color-pink);
    border: none; width: 35px; height: 35px; border-radius: 10px;
    font-size: 18px; cursor: pointer; display: flex;
    justify-content: center; align-items: center; transition: 0.3s;
}
.btn-icon-close:hover { background: var(--color-pink); color: #fff; transform: rotate(90deg); }

.sidebar-menu { display: flex; flex-direction: column; padding: 20px 0; overflow-y: auto; }
.sidebar-link {
    padding: 15px 25px; font-size: 14px; font-weight: 600;
    color: var(--text-main); display: flex; align-items: center; gap: 15px;
    border-left: 4px solid transparent; transition: 0.3s;
}
.sidebar-link i { font-size: 18px; color: var(--text-muted); width: 22px; text-align: center; transition: 0.3s; }
.sidebar-link:hover, .sidebar-link.active {
    background: var(--soft-blue); color: var(--color-blue);
    border-left-color: var(--color-blue);
}
.sidebar-link:hover i, .sidebar-link.active i { color: var(--color-blue); }

/* =================================================================
   APP WRAPPER
   ================================================================= */
.app-wrapper {
    width: 100%; max-width: 1200px; margin: 20px auto; 
    background-color: var(--bg-app); min-height: 95vh;
    position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border-radius: 24px; overflow: hidden; backdrop-filter: blur(10px); 
}

/* =================================================================
   HEADER WARNA-WARNI & LOGO BESAR (NEW!)
   ================================================================= */
.app-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 25px 30px; 
    
    /* Latar Belakang Gradasi Animasi */
    background: linear-gradient(-45deg, #1877f2, #6f42c1, #d8459e, #1877f2);
    background-size: 300% 300%;
    animation: gradientHeader 8s ease infinite;
    
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

@keyframes gradientHeader {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.logo { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 15px; }

/* Logo Diperbesar Khusus Desktop */
.header-logo { 
    width: 100%; 
    max-width: 350px; /* Diperbesar dari 250px */
    height: auto; 
    max-height: 120px; 
    object-fit: contain; 
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15)); /* Agar logo tajam di atas warna */
}

/* Tombol Transparan Menyatu dengan Warna */
.app-header .btn-icon {
    width: 45px; height: 45px; 
    background: rgba(255, 255, 255, 0.2); 
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 18px; color: #ffffff; 
    backdrop-filter: blur(5px);
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    transition: 0.3s; flex-shrink: 0; 
}
.app-header .btn-icon:hover { 
    transform: translateY(-2px); 
    background: rgba(255, 255, 255, 0.4); 
    color: #fff; 
}

/* =================================================================
   WELCOME BANNER (MARQUEE SMOOTH)
   ================================================================= */
.welcome-alert {
    background: var(--soft-blue); margin: 20px 25px;
    padding: 15px 20px; border-radius: 12px;
    display: flex; align-items: center; gap: 12px; overflow: hidden;
}
.wave { font-size: 18px; flex-shrink: 0; }
.marquee-wrapper { width: 100%; overflow: hidden; white-space: nowrap; position: relative; }
.marquee-content {
    display: inline-block; font-size: 12px; font-weight: 600;
    color: var(--color-blue); text-transform: uppercase;
    will-change: transform;
    animation: scroll-left 25s linear infinite;
}
@keyframes scroll-left {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* =================================================================
   HERO BANNER
   ================================================================= */
.hero-section { margin: 0 25px 25px; border-radius: 20px; overflow: hidden; box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.hero-image { width: 100%; height: auto; display: block; }

/* =================================================================
   MAIN CARDS
   ================================================================= */
.main-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0 25px 25px; }
.main-card {
    border-radius: 20px; padding: 25px 20px; display: flex; align-items: center; gap: 15px;
    color: #fff; cursor: pointer; box-shadow: 0 10px 20px rgba(0,0,0,0.1); transition: 0.3s;
}
.main-card:hover { transform: translateY(-5px); box-shadow: 0 15px 25px rgba(0,0,0,0.15); }
.card-blue { background: linear-gradient(135deg, #439dfa, #1877f2); }
.card-pink { background: linear-gradient(135deg, #e45b9b, #c32fa1); }
.card-icon { width: 55px; height: 55px; background: rgba(255,255,255,0.2); border-radius: 14px; display: flex; justify-content: center; align-items: center; font-size: 26px; }
.card-text h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.card-text p { font-size: 11px; opacity: 0.9; }

/* =================================================================
   PERALATAN TOGEL (TOOLS)
   ================================================================= */
.tools-section {
    background: #fff; margin: 0 25px 25px; border-radius: 24px;
    padding: 25px; box-shadow: 0 5px 20px rgba(0,0,0,0.04);
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.title-left { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }

/* Judul Tool 1 Baris */
.title-left h2 { font-size: 15px; font-weight: 700; color: #2b3b5a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.link-see-all { font-size: 13px; font-weight: 600; color: var(--color-blue); transition: 0.3s; white-space: nowrap; flex-shrink: 0; margin-left: 10px; }
.link-see-all:hover { color: #105bbd; }

.tools-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 20px 15px; }
.tool-item { display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; }
.tool-icon {
    width: 60px; height: 60px; border-radius: 16px; display: flex;
    justify-content: center; align-items: center; font-size: 24px; margin-bottom: 10px; transition: 0.3s;
}
.tool-text-wrap { display: flex; flex-direction: column; line-height: 1.3; }
.tool-title { font-size: 12px; font-weight: 700; color: var(--text-main); }
.tool-subtitle { font-size: 11px; color: var(--text-muted); }

/* =================================================================
   IFRAME DATA RESULT SECTION
   ================================================================= */
.iframe-section {
    background: #fff; margin: 0 25px 25px; border-radius: 24px;
    padding: 25px; box-shadow: 0 5px 20px rgba(0,0,0,0.04);
}
.result-title {
    font-size: 15px; font-weight: 700; color: #2b3b5a;
    /* Memastikan 1 baris */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    width: 100%; display: block;
}
.iframe-container {
    width: 100%; height: 500px; border-radius: 16px; overflow: hidden;
    background: var(--bg-body); border: 2px solid var(--soft-blue);
    position: relative;
}
.iframe-container iframe {
    width: 100%; height: 100%; border: none; display: block;
}

/* =================================================================
   INFO SECTION
   ================================================================= */
.info-section {
    background: #fff; margin: 0 25px 25px; border-radius: 24px; padding: 25px;
    display: flex; align-items: center; gap: 20px; box-shadow: 0 5px 20px rgba(0,0,0,0.04);
}
.info-icon img { width: 60px; }
.info-text { flex: 1; }
.info-text h3 { font-size: 14px; margin-bottom: 6px; }
.info-text p { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; line-height: 1.5; }
.info-text .bold-text { font-weight: 700; color: var(--text-main); }
.badge-gratis { background: var(--soft-blue); padding: 12px 15px; border-radius: 14px; display: flex; align-items: center; gap: 8px; }
.badge-gratis i { color: var(--color-yellow); font-size: 24px; }
.badge-gratis div { font-size: 11px; color: var(--color-blue); line-height: 1.2; }

/* =================================================================
   ACTION BUTTONS
   ================================================================= */
.action-buttons-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 15px; margin: 0 25px 25px;
}
.btn-action {
    padding: 16px; border: none; border-radius: 16px; font-size: 13px; font-weight: 700;
    color: #2b3b5a; display: flex; justify-content: center; align-items: center; gap: 10px;
    cursor: pointer; transition: 0.3s;
}
.btn-action:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.08); }

/* =================================================================
   FOOTER
   ================================================================= */
.site-footer { text-align: center; padding: 20px; margin-top: 10px; border-top: 1px solid rgba(0,0,0,0.05); }
.site-footer p { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* =================================================================
   BOTTOM NAVIGATION
   ================================================================= */
.bottom-spacer { height: 90px; }
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 1200px; background: #fff;
    display: flex; justify-content: space-around; padding: 15px 0;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.06); z-index: 1000;
    border-top-left-radius: 24px; border-top-right-radius: 24px;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); transition: 0.3s; }
.nav-item i { font-size: 22px; transition: 0.3s; }
.nav-item span { font-size: 11px; font-weight: 500; }
.nav-item:hover i { transform: translateY(-3px); color: var(--color-blue); }
.nav-item.active { color: var(--color-blue); }
.nav-item.active span { font-weight: 700; }

/* =================================================================
   PWA PROMPT UI
   ================================================================= */
#pwa-install-prompt {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-150%);
    background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,0.2); border-radius: 16px;
    padding: 15px 20px; z-index: 9999; display: flex; align-items: center; justify-content: space-between;
    gap: 15px; width: 90%; max-width: 400px; opacity: 0; visibility: hidden;
    transition: 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
#pwa-install-prompt.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
#pwa-install-prompt.hidden { display: none !important; }
.pwa-content { display: flex; align-items: center; gap: 15px; }
.pwa-content img { width: 45px; height: 45px; border-radius: 12px; }
.pwa-content h4 { font-size: 14px; margin: 0; color: #2d3748; }
.pwa-content p { font-size: 11px; margin: 0; color: #718096; }
.pwa-actions { display: flex; gap: 8px; }
.pwa-btn { padding: 8px 14px; border: none; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.3s; }
.pwa-btn-close { background: #f0f2f5; color: #718096; }
.pwa-btn-install { background: var(--color-blue); color: #fff; box-shadow: 0 4px 10px rgba(24, 119, 242, 0.3); }

/* =================================================================
   MODAL FORM LOGIN ADMIN
   ================================================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
    z-index: 9999; display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.login-modal {
    background: #fff; width: 90%; max-width: 420px; border-radius: 24px;
    padding: 35px 30px; position: relative;
    transform: translateY(30px) scale(0.95);
    transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}
.modal-overlay.active .login-modal { transform: translateY(0) scale(1); }

.btn-icon-close-modal {
    position: absolute; top: 20px; right: 20px; width: 35px; height: 35px;
    border-radius: 10px; border: none; background: var(--soft-pink);
    color: var(--color-pink); font-size: 16px; cursor: pointer; transition: 0.3s;
    display: flex; justify-content: center; align-items: center;
}
.btn-icon-close-modal:hover { background: var(--color-pink); color: #fff; transform: rotate(90deg); }

.login-modal-header { text-align: center; margin-bottom: 25px; }
.login-modal-header img { width: auto; height: 50px; margin-bottom: 15px; }
.login-modal-header h3 { font-size: 20px; color: #2b3b5a; font-weight: 700; margin-bottom: 5px; }
.login-modal-header p { font-size: 12px; color: var(--text-muted); }

.input-group { position: relative; margin-bottom: 15px; }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; transition: 0.3s; }
.input-group input {
    width: 100%; padding: 14px 15px 14px 45px; border-radius: 14px;
    border: 2px solid #e2e8f0; font-size: 14px; color: var(--text-main);
    outline: none; transition: 0.3s; font-family: 'Poppins', sans-serif;
    background: #f8fafc;
}
.input-group input:focus { border-color: var(--color-blue); background: #fff; box-shadow: 0 0 0 4px var(--soft-blue); }
.input-group input:focus + .input-icon { color: var(--color-blue); }

.toggle-pwd-btn {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); font-size: 16px;
    cursor: pointer; padding: 5px; transition: 0.3s;
}
.toggle-pwd-btn:hover { color: var(--color-blue); }

.form-options {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; margin-top: 10px; font-size: 12px; font-weight: 500;
}
.remember-me { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-muted); }
.remember-me input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--color-blue); }
.forgot-pwd-link { color: var(--color-blue); transition: 0.3s; font-weight: 600; }
.forgot-pwd-link:hover { text-decoration: underline; color: #105bbd; }

.btn-submit-login {
    width: 100%; padding: 15px; border: none; border-radius: 14px;
    background: linear-gradient(135deg, var(--color-blue), #105bbd);
    color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
    display: flex; justify-content: center; align-items: center; gap: 10px;
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.3); transition: 0.3s;
}
.btn-submit-login:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(24, 119, 242, 0.4); }

/* ANIMASI TOOLS */
@keyframes shake { 0%, 100% {transform: translateX(0);} 25% {transform: translateX(-5px);} 75% {transform: translateX(5px);} }
@keyframes spin { 100% {transform: rotate(360deg);} }
@keyframes pulse { 0% {transform: scale(1);} 50% {transform: scale(1.15);} 100% {transform: scale(1);} }
@keyframes wobble { 0% {transform: translateX(0%);} 15% {transform: translateX(-15%) rotate(-5deg);} 30% {transform: translateX(10%) rotate(3deg);} 45% {transform: translateX(-10%) rotate(-3deg);} 60% {transform: translateX(5%) rotate(2deg);} 75% {transform: translateX(-2%) rotate(-1deg);} 100% {transform: translateX(0%);} }
@keyframes swing { 20% {transform: rotate(15deg);} 40% {transform: rotate(-10deg);} 60% {transform: rotate(5deg);} 80% {transform: rotate(-5deg);} 100% {transform: rotate(0deg);} }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-15px);} 60% {transform: translateY(-7px);} }
@keyframes jello { 0%, 100% {transform: none;} 22% {transform: skewX(-12.5deg) skewY(-12.5deg);} 33% {transform: skewX(6.25deg) skewY(6.25deg);} 44% {transform: skewX(-3.125deg) skewY(-3.125deg);} 55% {transform: skewX(1.5deg) skewY(1.5deg);} }
@keyframes heartbeat { 0% {transform: scale(1);} 14% {transform: scale(1.2);} 28% {transform: scale(1);} 42% {transform: scale(1.2);} 70% {transform: scale(1);} }

.anim-shake:hover .tool-icon { animation: shake 0.4s ease-in-out; }
.anim-spin:hover .tool-icon { animation: spin 0.8s linear; }
.anim-pulse:hover .tool-icon { animation: pulse 0.8s; }
.anim-wobble:hover .tool-icon { animation: wobble 0.8s; }
.anim-swing:hover .tool-icon { animation: swing 0.8s; }
.anim-bounce:hover .tool-icon { animation: bounce 0.8s; }
.anim-jello:hover .tool-icon { animation: jello 0.8s; }
.anim-heartbeat:hover .tool-icon { animation: heartbeat 0.8s; }

/* UTILITY COLORS */
.text-blue { color: var(--color-blue); } .text-pink { color: var(--color-pink); }
.text-yellow { color: var(--color-yellow); } .text-green { color: var(--color-green); }
.text-orange { color: var(--color-orange); } .text-purple { color: var(--color-purple); }
.text-cyan { color: var(--color-cyan); } .text-magenta { color: var(--color-magenta); }
.bg-soft-blue { background-color: var(--soft-blue); } .bg-soft-pink { background-color: var(--soft-pink); }
.bg-soft-yellow { background-color: var(--soft-yellow); } .bg-soft-green { background-color: var(--soft-green); }
.bg-soft-orange { background-color: var(--soft-orange); } .bg-soft-purple { background-color: var(--soft-purple); }
.bg-soft-cyan { background-color: var(--soft-cyan); } .bg-soft-magenta { background-color: var(--soft-magenta); }

/* =================================================================
   MEDIA QUERIES (MOBILE RESPONSIVE + SCALING)
   ================================================================= */
@media (max-width: 768px) {
    .app-wrapper { margin: 0; border-radius: 0; max-width: 100%; }
    
    /* Logo diturunkan ukurannya di tablet/HP menengah agar tak kepenuhan */
    .header-logo { max-width: 200px; max-height: 80px; }
    
    .tools-grid { grid-template-columns: repeat(4, 1fr); }
    .action-buttons-grid { grid-template-columns: repeat(2, 1fr); }
    .info-section { flex-direction: column; text-align: center; }
    .badge-gratis { width: 100%; justify-content: center; margin-top: 10px; }
    .iframe-container { height: 400px; }
}

@media (max-width: 480px) {
    /* Logo disesuaikan sempurna untuk HP kecil */
    .header-logo { max-width: 160px; max-height: 60px; }
    
    .app-header { padding: 20px 20px; }
    
    @keyframes scroll-left { 0% { transform: translateX(100vw); } 100% { transform: translateX(-120%); } }

    .title-left h2 { font-size: 14px; }
    .result-title { font-size: 11px; letter-spacing: -0.3px; padding-right: 5px; }
    .link-see-all { font-size: 12px; }

    .tools-grid { grid-template-columns: repeat(4, 1fr); gap: 15px 5px; }
    .tool-icon { width: 45px; height: 45px; font-size: 18px; margin-bottom: 6px; }
    .tool-title { font-size: 10px; letter-spacing: -0.2px; }
    .tool-subtitle { font-size: 9px; }

    .main-cards-grid { grid-template-columns: 1fr; }
    
    .iframe-section { padding: 20px 15px; }
    .iframe-container { height: 380px; }

    .login-modal { padding: 25px 20px; }
    .login-modal-header h3 { font-size: 18px; }
    .login-modal-header img { height: 40px; }
}