/* --- PREMIUM DARK THEME --- */
:root {
    --bg-body: #000000;
    --bg-panel: #0a0a0a;
    --border: #333333;
    --border-active: #555555;
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent: #ffffff;
    --radius: 8px;
    --danger: #ef4444;
}

* { box-sizing: border-box; outline: none; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 30px;
    min-height: 100vh;
}

/* --- NAVIGATION --- */
.back-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 30px;
    transition: 0.2s;
}
.back-nav:hover { color: var(--text-main); }

/* --- HEADER --- */
header { margin-bottom: 40px; border-bottom: 1px solid var(--border); padding-bottom: 30px; }
.badge-beta {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    background: #1a1a1a;
    color: #10b981; /* Hijau sistem */
    border: 1px solid #10b981;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}
header h1 { font-size: 2rem; margin: 0 0 10px 0; letter-spacing: -1px; }
header p { color: var(--text-muted); max-width: 600px; line-height: 1.6; font-size: 0.95rem; }

/* --- LAYOUT GRID --- */
.container { max-width: 1200px; margin: 0 auto; }
.layout-grid {
    display: grid;
    grid-template-columns: 450px 1fr; /* Kolom Kiri Fixed, Kanan Flexible */
    gap: 40px;
}

/* --- LEFT PANEL (INPUT) --- */
.input-panel { display: flex; flex-direction: column; gap: 25px; }

.section-group {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #222;
    padding-bottom: 15px;
}
.section-header i { font-size: 1.1rem; }

.input-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    margin-top: 15px;
}
.input-label:first-of-type { margin-top: 0; }

/* Input Fields */
.input-dark, select.input-dark {
    width: 100%;
    background: #000;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: 0.2s;
}
.input-dark:focus { border-color: #666; }

/* Asset Picker Box */
.asset-picker-box {
    background: #000;
    border: 1px dashed var(--border);
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}
.btn-outline-sm {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.btn-outline-sm:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.05); }
.asset-info {
    font-size: 0.75rem;
    color: #10b981;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toggle Buttons */
.toggle-group { display: flex; gap: 8px; }
.tgl-btn {
    flex: 1;
    background: #000;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}
.tgl-btn:hover { border-color: #555; }
.tgl-btn.active { background: #fff; color: #000; border-color: #fff; font-weight: 700; }

/* Generate Button */
.btn-generate {
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    color: #000;
    border: none;
    padding: 18px;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(255,255,255,0.1);
    transition: transform 0.1s, opacity 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btn-generate:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-generate:active { transform: translateY(0); }

/* --- RIGHT PANEL (OUTPUT) --- */
.output-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px); /* Sticky Full Height */
    position: sticky;
    top: 30px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.output-header span { font-size: 0.85rem; font-weight: 800; color: var(--text-muted); letter-spacing: 1px; }

.btn-copy {
    background: transparent;
    border: 1px solid #444;
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.btn-copy:hover { border-color: #fff; background: rgba(255,255,255,0.05); }

/* Output Code Box */
.prompt-container {
    flex: 1;
    background: #080808;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #d4d4d4;
    overflow-y: auto;
    white-space: pre-wrap;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.placeholder-text {
    color: #444;
    text-align: center;
    margin-top: 50px;
    font-style: italic;
}

.tips-box {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    display: flex;
    gap: 12px;
    color: #aaa;
    align-items: start;
    line-height: 1.5;
}
.tips-box i { font-size: 1.1rem; color: #fff; margin-top: 2px; }

/* --- MODAL GALLERY --- */
.modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal.active { display: flex; }

.modal-content {
    width: 600px;
    background: #111;
    border: 1px solid #333;
    padding: 25px;
    border-radius: 12px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #222;
}
.modal-header h4 { margin: 0; color: #fff; font-size: 1.1rem; }

.close-btn {
    background: transparent; border: none;
    color: #888; font-size: 1.2rem; cursor: pointer;
}
.close-btn:hover { color: #fff; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    overflow-y: auto;
    padding-right: 5px;
}

.asset-thumb {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.7;
    border: 2px solid transparent;
    transition: 0.2s;
    background: #000;
}
.asset-thumb:hover { opacity: 1; border-color: #fff; transform: scale(1.02); }

/* --- TOAST --- */
#toastBox {
    position: fixed; bottom: 30px; right: 30px;
    display: flex; flex-direction: column; gap: 10px; z-index: 200;
}
.toast {
    background: #fff; color: #000;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
    .layout-grid { grid-template-columns: 1fr; }
    .output-panel { height: 500px; position: static; }
}