/* /var/www/wayang.latte.ai.id/assets/css/wayang.css */
/* Tema YouTube Jawa Klasik - Wayang Kulit Interaktif */

:root {
    --bg-main: #0b0a08;
    --bg-surface: #17130e;
    --bg-card: #201a13;
    --bg-card-hover: #2b2219;
    --gold-primary: #d4af37;
    --gold-light: #ffd700;
    --gold-dark: #8c6d1f;
    --text-primary: #f5eedb;
    --text-secondary: #b8a68b;
    --text-muted: #7d6e5c;
    --border-color: #382c1e;
    --border-gold: rgba(212, 175, 55, 0.4);
    --danger: #ef4444;
    --success: #10b981;
    --font-heading: 'Cinzel', serif, Georgia;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   HEADER / NAVBAR (YOUTUBE STYLE)
   ========================================================================== */
.wayang-header {
    height: 60px;
    background: rgba(23, 19, 14, 0.95);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gold-light);
}

.logo-icon {
    font-size: 26px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
}

.header-center {
    font-size: 14px;
    color: var(--gold-primary);
    background: rgba(32, 26, 19, 0.8);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-header:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

.btn-gold {
    background: linear-gradient(135deg, #d4af37, #9b7a1e);
    color: #1a1005;
    font-weight: 600;
    border: none;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #ffd700, #bfa02f);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

/* ==========================================================================
   LAYOUT UTAMA (STAGE SEBELAH KIRI, SIDEBAR SEBELAH KANAN)
   ========================================================================== */
.wayang-main-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    padding: 20px 24px;
    max-width: 1780px;
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .wayang-main-layout {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   STAGE SECTION (SEBELAH KIRI - PEMAIN UTAMA)
   ========================================================================== */
.stage-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stage-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-color);
}

/* Layer 1: Background Layer */
.stage-background-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-size: cover;
    background-position: center;
    transition: background 0.6s ease;
}

.stage-fx-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Layer 2: Kelir Tradisional & Cahaya Blencong */
.stage-kelir-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.blencong-light {
    position: absolute;
    top: -50px;
    left: 50%;
    width: 900px;
    height: 750px;
    margin-left: -450px;
    background: radial-gradient(circle, rgba(255, 235, 175, 0.75) 0%, rgba(245, 170, 45, 0.4) 40%, rgba(120, 50, 10, 0.15) 70%, transparent 85%);
    pointer-events: none;
    transition: transform 0.08s ease-out, opacity 0.08s ease-out;
}

/* Layer 3: Kontainer Wayang SVG Interaktif */
.stage-wayang-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    user-select: none;
}

/* Layer 4: Debog Batang Pisang di Bawah */
.stage-debog-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75px;
    background: linear-gradient(to bottom, #4a7531 0%, #2f4d1e 40%, #17280d 100%);
    border-top: 4px solid #5b8d3d;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.7);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.debog-bark {
    position: absolute;
    inset: 0;
    opacity: 0.25;
    background-image: repeating-linear-gradient(90deg, transparent, transparent 30px, #000 32px);
}

.debog-label {
    position: relative;
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 4px;
    color: rgba(255, 235, 175, 0.4);
    font-weight: bold;
}

/* Lampu Blencong Fisik */
.blencong-lamp-fixture {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.blencong-chain {
    width: 3px;
    height: 35px;
    background: repeating-linear-gradient(to bottom, #d4af37, #d4af37 4px, #423011 5px, #423011 8px);
}

.blencong-bowl {
    width: 48px;
    height: 22px;
    background: linear-gradient(to bottom, #b8860b, #593e04);
    border-radius: 0 0 24px 24px;
    border: 1px solid #ffd700;
    position: relative;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}

.blencong-flame {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 28px;
    background: radial-gradient(ellipse at 50% 80%, #ffffff 0%, #ffea78 30%, #ff8800 65%, transparent 100%);
    border-radius: 50% 50% 20% 20%;
    filter: drop-shadow(0 0 10px #ff9900);
    animation: flamePulse 0.18s infinite alternate ease-in-out;
}

@keyframes flamePulse {
    0% { transform: translateX(-50%) scale(0.92, 0.94); }
    100% { transform: translateX(-50%) scale(1.08, 1.06); }
}

/* ==========================================================================
   STAGE CONTROLS & HUD (ACTION BAR DI BAWAH STAGE)
   ========================================================================== */
.stage-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 12px;
}

.action-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.btn-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

.btn-action.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold-light);
    color: var(--gold-light);
}

/* HUD Petunjuk & Status Kontrol Keyboard */
.controller-hud-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 16px;
}

@media (max-width: 800px) {
    .controller-hud-card {
        grid-template-columns: 1fr;
    }
}

.hud-status-box {
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.hud-title {
    font-size: 11px;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: bold;
    margin-bottom: 8px;
}

.hud-val-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.hud-val-row strong {
    color: var(--text-primary);
}

.hud-keys-guide {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}

.key-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.key-badge kbd {
    background: #000;
    border: 1px solid var(--gold-dark);
    color: var(--gold-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    font-family: monospace;
}

/* ==========================================================================
   SIDEBAR SECTION (SEBELAH KANAN - DUA TAB)
   ========================================================================== */
.sidebar-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: fit-content;
    max-height: 880px;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(18, 14, 10, 0.8);
}

.tab-btn {
    flex: 1;
    padding: 14px 12px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--gold-light);
    border-bottom-color: var(--gold-light);
    background: rgba(212, 175, 55, 0.08);
}

.tab-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* Tab 1: Pilihan Background Stage */
.bg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bg-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.bg-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

.bg-card.active {
    border-color: var(--gold-light);
    box-shadow: 0 0 0 2px var(--gold-light);
}

.bg-thumb {
    height: 75px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.bg-thumb-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--gold-light);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

.bg-card-info {
    padding: 8px 10px;
}

.bg-card-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.bg-card-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Tab 2: Pilihan Tokoh Wayang */
.character-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.character-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.2s;
}

.character-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-gold);
}

.character-avatar {
    width: 60px;
    height: 80px;
    background: #140d07;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.character-info {
    flex: 1;
    min-width: 0;
}

.char-category {
    font-size: 10.5px;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.char-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2px 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.char-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-add-wayang {
    background: var(--bg-main);
    border: 1px solid var(--gold-dark);
    color: var(--gold-light);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.btn-add-wayang:hover {
    background: var(--gold-primary);
    color: #000;
}

/* ==========================================================================
   MODAL LOGIN & REGISTER VIA OTP (PERSIS SEPERTI SOLDER.ID)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: #18120b;
    border: 2px solid var(--gold-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 25px rgba(212, 175, 55, 0.25);
    text-align: center;
    position: relative;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.modal-gunungan-logo {
    font-size: 46px;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.modal-title {
    font-family: var(--font-heading);
    color: var(--gold-light);
    font-size: 22px;
    margin-bottom: 6px;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 13.5px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gold-primary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    background: #251c12;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--gold-light);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.otp-boxes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.otp-box {
    width: 48px;
    height: 56px;
    background: #251c12;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--gold-light);
    outline: none;
}

.otp-box:focus {
    border-color: var(--gold-light);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.25);
}

.btn-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #d4af37, #9b7a1e);
    border: none;
    border-radius: 8px;
    color: #160f05;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #ffd700, #bfa02f);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.btn-secondary:hover {
    color: var(--text-primary);
}

/* Alert Notification */
.alert-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: #6ee7b7;
}

.dev-otp-notice {
    margin-top: 14px;
    padding: 8px 12px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px dashed var(--gold-primary);
    border-radius: 6px;
    font-size: 12px;
    color: var(--gold-light);
    cursor: pointer;
}
