:root {
    --bg: #020617;
    --sidebar: #0f172a;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.2);
    --border: #1e293b;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --terminal-bg: #000000;
    --panel-dark: #030712;
}

* { 
    box-sizing: border-box; 
    transition: all 0.2s ease; 
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* --- SIDEBAR AREA --- */
.sidebar {
    width: 420px; /* Lebar default baru yang lebih luas */
    min-width: 320px; /* Batas paling kecil saat digeser */
    max-width: 600px; /* Batas paling lebar saat digeser */
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;

    /* FITUR RESIZE MANUAL */
    resize: horizontal; 
    overflow: auto; /* Syarat agar resize berfungsi */
}

#customPrompt {
    width: 100%;
    min-height: 250px; /* Membuat kotak prompt lebih tinggi */
    background: #020617;
    border: 1px solid var(--border);
    color: #818cf8;
    padding: 15px;
    border-radius: 10px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
    outline: none;
    resize: vertical; /* Biar bisa ditarik ke bawah juga */
}

#customPrompt:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.sidebar-main {
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto; /* Biar bagian menu bisa di-scroll kalau layar pendek */
    flex: 1; /* Mengambil sisa ruang agar footer terdorong ke bawah */
}

.sidebar-footer {
    padding-top: 20px;
    margin-top: 20px;

}

/* Hilangkan scrollbar di sidebar-main agar lebih bersih */
.sidebar-main::-webkit-scrollbar {
    width: 0px;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo span {
    font-size: 10px; 
    background: #1e1b4b; 
    padding: 2px 6px; 
    border-radius: 5px; 
    color: #818cf8; 
    border: 1px solid #3730a3;
}

.config-group label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-input {
    width: 100%;
    background: #020617;
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
}

.sidebar-input:focus { border-color: var(--accent); }


/* --- SYSTEM STATUS STYLE --- */
.system-status {
    padding: 10px 5px;
    border-top: 1px solid var(--border);
}

.status-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.status-dot {
    height: 7px;
    width: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulseStatus 2s infinite;
}

.ai-version {
    font-size: 9px;
    color: #475569;
    padding-left: 15px;
}

@keyframes pulseStatus {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-box {
    background: #020617;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-box div {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent);
}

.stat-box span {
    font-size: 9px;
    color: var(--text-dim);
}

/* Buttons */
.btn-run, .btn-clear {
    width: 100%;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-run {
    background: var(--accent);
    color: white;
    box-shadow: 0 10px 20px var(--accent-glow);
}

.btn-run:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-run:disabled { background: #334155; box-shadow: none; cursor: not-allowed; }

.btn-clear {
    width: 100%;
    background: #450a0a; 
    color: #f87171;     
    border: 1px solid #7f1d1d;
    padding: 12px;     
    border-radius: 10px;
    font-weight: 700;
    font-size: 11px;   
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: -10px;  
}

.btn-clear:hover {
    background: #7f1d1d;
    color: white;
}
/* Status Footer */
.status-footer {
    margin-top: auto;
    font-size: 11px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    height: 8px;
    width: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%; /* Paksa Full Width */
    background: #020617;
}

.top-bar {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to right, rgba(15, 23, 42, 0.8), rgba(2, 6, 23, 0.5));
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}
.title-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%; /* Biar container judul pakai semua ruang */
}
.title-content {
    flex: 1; /* INI KUNCINYA: Memaksa area input judul memanjang mentok ke kanan */
    display: flex;
    flex-direction: column;
}

.input-title-pro {
    width: 100%; /* Agar kolom input mengisi area yang sudah dipanjangkan */
    background: transparent;
    border: none;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    outline: none;
    padding: 5px 0;
}

/* Biar teks yang panjang tidak terpotong (scrollable horizontal saat ngetik) */
.input-title-pro:focus {
    border-bottom: 1px solid var(--accent);
}
.title-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid var(--accent);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.title-icon i { animation: pulseIcon 2s infinite; }

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.title-content label {
    font-size: 9px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.input-title-pro {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    outline: none;
    width: 100%;
}

/* Workspace Panels */
.workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%; /* Pastikan Full Lebar Layar */
    gap: 1px;
    background: var(--border);
}

.panel {
    flex: 1; 
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.dark-panel { background: var(--panel-dark); }

.panel-header {
    padding: 15px 30px 5px 30px; /* Samakan jarak kiri-kanannya dengan teks */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
}

.accent-text { color: var(--accent); }

textarea {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 15px; /* Sedikit diperbesar agar nyaman */
    line-height: 1.8;
    resize: none;
    outline: none;
    padding: 30px 35px; /* Jarak: Atas-Bawah 30px, Kiri-Kanan 35px */
    box-sizing: border-box; /* Pastikan padding tidak merusak lebar */
}

#outputSpintax {
    padding: 30px 35px;
    line-height: 2; /* Jarak baris lebih renggang untuk spintax */
    letter-spacing: 0.5px;
    color: #a5b4fc;
}
#outputSpintax::selection {
    background: var(--accent);
    color: white;
}

/* Button Group */
.btn-group { display: flex; gap: 8px; }

.copy-btn {
    background: #1e293b;
    border: 1px solid var(--border);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}

.copy-btn.preview { background: #3730a3; border-color: #4338ca; }
.copy-btn:hover { filter: brightness(1.2); transform: translateY(-1px); }

/* --- TERMINAL / CONSOLE REVAMP --- */
.console-wrapper {
    background: #020617;
    border-top: 1px solid #1e293b;
    border-bottom: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
}

.console-header {
    background: #0f172a;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

.console-dots {
    display: flex;
    gap: 6px;
}

.console-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-amber { background: #f59e0b; }
.dot-green { background: #10b981; }

.console-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.console-status {
    font-size: 9px;
    font-weight: 800;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    animation: pulseStatus 2s infinite;
}

.terminal {
    height: 160px; /* Ukuran pas biar gak makan tempat */
    background: #000000;
    padding: 15px 25px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #cbd5e1;
    overflow-y: auto;
    line-height: 1.6;
}

/* --- CUSTOM SCROLLBAR GLOBAL --- */
/* Mengatur lebar scrollbar */
::-webkit-scrollbar {
    width: 8px;  /* Baris vertikal */
    height: 8px; /* Baris horizontal */
}

/* Mengatur background lintasan scrollbar */
::-webkit-scrollbar-track {
    background: #020617; /* Warna sama dengan background panel */
}

/* Mengatur warna batang scroll (thumb) */
::-webkit-scrollbar-thumb {
    background: #1e293b; /* Warna abu-abu gelap */
    border-radius: 10px;
    border: 2px solid #020617; /* Memberi efek jarak (padding) */
}

/* Mengatur warna saat scrollbar di-hover */
::-webkit-scrollbar-thumb:hover {
    background: #6366f1; /* Berubah jadi warna accent indigo saat disentuh */
}

/* KHUSUS UNTUK TEXTAREA (Area Ketik) */
textarea::-webkit-scrollbar {
    width: 6px; /* Lebih ramping lagi untuk area teks */
}

textarea::-webkit-scrollbar-thumb {
    background: #334155; 
}

/* Dukungan untuk Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #1e293b #020617;
}

/* Log Item Styling */
.log-item {
    margin-bottom: 4px;
    border-left: 2px solid transparent;
    padding-left: 10px;
}

.log-time { color: #475569; font-weight: 400; }
.log-prefix { color: #818cf8; font-weight: 700; }

/* Animasi Entry Log Baru */
@keyframes fadeInLog {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

.log-item { animation: fadeInLog 0.3s ease-out forwards; }

/* Animasi Spinner */
.spinner {
    animation: rotate 1s linear infinite;
    display: inline-block;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Overlay Loading untuk Panel Output */
.panel-loading {
    position: relative;
}

.panel-loading::after {
    content: "AI IS ANALYZING CONTENT...";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(2, 6, 23, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 2px;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.tool-switcher {
    display: flex;
    gap: 5px;
    background: #020617;
    padding: 5px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
}

.tab-btn.active {
    background: var(--accent);
    color: white;
}
/* --- SEO FOOTER & BRAND PORTAL STYLE --- */
.seo-footer {
    width: 100%;
    padding: 30px 40px; /* Diperkecil paddingnya */
    background: #010409;
    border-top: 1px solid #1e293b;
    margin-top: auto;
}
.footer-main-grid {
    display: grid;
    grid-template-columns: 1fr 0.5fr 2fr; /* 3 Kolom: Info, Link Info, Brand Tags */
    gap: 40px;
    max-width: 1300px;
    margin: 0 auto;
}

.footer-col h4 {
    color: #818cf8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
}
.footer-brand {
    font-weight: 800;
    color: #818cf8;
    margin-bottom: 10px;
}

.footer-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Keamanan Badge Mini */
.security-badges {
    display: flex;
    gap: 25px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge i {
    color: #10b981; /* Hijau biar kesan aman */
    font-size: 16px;
}

.badge span {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
}

/* Link Styling */
.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 12px;
    transition: 0.2s;
}

.footer-links a:hover {
    color: #818cf8;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column; /* Sidebar jadi di atas, konten di bawah */
        overflow-y: auto;       /* Izinkan scroll seluruh halaman */
    }

    /* SIDEBAR JADI FULL WIDTH DI ATAS */
    .sidebar {
        width: 100%;
        height: auto;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        position: relative;
    }

    .sidebar-main {
        overflow-y: visible;
    }

    /* MAIN CONTENT */
    .main-content {
        height: auto;
        overflow: visible;
    }

    .top-bar {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .title-container {
        width: 100%;
    }

    .input-title-pro {
        font-size: 1rem;
    }

    /* WORKSPACE JADI MENUMPUK (INPUT DI ATAS, OUTPUT DI BAWAH) */
    .workspace {
        grid-template-columns: 1fr; /* Berubah dari 2 kolom jadi 1 kolom */
        height: auto;
    }

    .panel {
        height: 400px; /* Beri tinggi tetap agar nyaman diketik */
        border-bottom: 1px solid var(--border);
    }

    textarea {
        padding: 15px;
        font-size: 13px;
    }

    /* TERMINAL/CONSOLE */
    .terminal {
        height: 200px;
    }

    /* TOMBOL RUN & CLEAR */
    .btn-run, .btn-clear {
        padding: 12px;
        font-size: 14px;
    }

    /* PANEL HEADER (Tombol Copy & Preview) */
    .panel-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .btn-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr; /* Tombol Copy & Preview sejajar berdua */
    }

    /* FOOTER */
    .footer-main-grid {
        grid-template-columns: 1fr !important; /* Footer jadi 1 kolom di HP */
        gap: 30px;
    }
}

.brand-portal {
    width: 100%;
    max-width: 1400px; /* Samakan dengan grid atas */
    margin: 40px auto 0 auto;
    text-align: center;
}

.brand-title {
    font-size: 10px;
    color: #334155;
    margin-bottom: 25px;
    letter-spacing: 3px;
}

.brand-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* Jarak antar kotak */
}

.brand-item {
    background: #1e293b;
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: 0.2s;
}

.brand-item:hover {
    background: #334155;
    color: #818cf8;
    border-color: #818cf8;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #0f172a;
    font-size: 10px;
    color: #334155;
}

/* Responsif untuk HP */
@media (max-width: 992px) {
    .footer-main-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}
