* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Mencegah scroll */
    background-color: #000;
}

/* Sembunyikan elemen video, karena WebGL yang akan menggambarnya di Canvas */
#camera-stream {
    display: none; 
}

/* Canvas menutupi seluruh layar */
#gl-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Panel Kontrol Mengambang di bawah */
#ui-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 20;
}

/* Styling Slider */
.slider-container {
    display: flex;
    flex-direction: column;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

input[type="range"] {
    width: 100%;
    margin-top: 8px;
    accent-color: #4CAF50;
}

/* Styling Tombol Mode CVD */
.button-group {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.mode-btn {
    flex: 1;
    padding: 10px 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

/* Tombol Kontrol Atas */
#top-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-wrap: wrap; /* BARU: Biarkan tombol turun ke baris baru jika layar sempit */
    gap: 10px;
    z-index: 20;
    max-width: calc(100vw - 40px); /* Cegah tombol keluar layar */
}

.icon-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(5px);
    cursor: pointer;
}

/* Split Screen Controls - DIPERBARUI */
#split-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; 
    z-index: 5;
    cursor: ew-resize;
    pointer-events: none; /* DEFAULT: Matikan agar tidak mengganggu klik piksel */
}

#split-slider.active {
    pointer-events: auto; /* AKTIF: Saat tombol ditekan */
}

#split-divider {
    position: absolute;
    top: 0;
    left: 100%; 
    width: 3px;
    height: 100%;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.8);
    z-index: 4;
    pointer-events: none;
    opacity: 0; /* DEFAULT: Garis disembunyikan */
    transition: opacity 0.3s ease;
}

#split-divider.active {
    opacity: 1; /* AKTIF: Munculkan garis */
}

/* Hint Text */
.hint-text {
    color: #aaa;
    font-size: 11px;
    text-align: center;
    margin-top: 5px;
}

/* Modal Edukasi */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1e1e1e;
    color: white;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    border-radius: 12px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.edu-section {
    margin-top: 15px;
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 8px;
}
.edu-section h3 { margin-bottom: 5px; font-size: 16px; }
.edu-section p { font-size: 13px; line-height: 1.5; color: #ccc; }

/* Panel Color Inspector */
#color-inspector {
    position: absolute;
    top: 70px; /* Di bawah tombol kontrol atas */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: opacity 0.3s;
}

#color-inspector.hidden {
    opacity: 0;
    pointer-events: none;
}

#color-box {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid white;
    background-color: transparent;
}

#color-info {
    display: flex;
    flex-direction: column;
    color: white;
}

#color-name {
    font-weight: bold;
    font-size: 14px;
}

#color-rgb {
    font-size: 11px;
    color: #ccc;
}

#close-inspector {
    background: transparent;
    border: none;
    font-size: 14px;
    padding: 5px;
}

/* --- MEDIA QUERIES (Untuk Tablet & Desktop) --- */
@media screen and (min-width: 768px) {
    /* Pindahkan panel ke sudut kanan bawah pada layar besar */
    #ui-panel {
        left: auto;
        right: 30px;
        bottom: 30px;
        transform: none; /* Hilangkan center alignment */
        width: 350px; /* Lebar tetap di PC */
    }

    /* Perbesar sedikit tombol di layar PC */
    .icon-btn {
        padding: 10px 16px;
        font-size: 15px;
    }

    #color-inspector {
        top: 30px; /* Pindahkan lebih ke atas di PC */
    }
}

/* Styling App Mode Toggle */
.app-mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 5px;
}

.radio-btn {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    color: #ccc;
    transition: 0.3s;
}

.radio-btn input[type="radio"] {
    display: none; /* Sembunyikan bulatan radio asli */
}

/* Ubah warna jika radio dipilih */
.radio-btn:has(input:checked) {
    background: #4CAF50;
    color: white;
}

/* Styling Dropdown Select */
.select-container {
    display: flex;
    flex-direction: column;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

#cvd-mode {
    margin-top: 5px;
    padding: 8px;
    border-radius: 5px;
    background: #333;
    color: white;
    border: 1px solid #555;
    outline: none;
    font-size: 14px;
}

/* Live FPS Monitor */
#fps-counter {
    position: absolute;
    top: 5px;
    right: 10px;
    color: #00FF00;
    font-family: monospace;
    font-weight: bold;
    font-size: 14px;
    z-index: 30;
    text-shadow: 1px 1px 2px black;
    pointer-events: none;
}

/* Transisi Halus untuk Immersive Mode */
#top-controls, #ui-panel, #color-inspector {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Class untuk melempar menu ke luar layar */
.immersive-hidden-top {
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
}

.immersive-hidden-bottom {
    transform: translateY(150%) translateX(-50%); /* Menjaga agar tetap di tengah sebelum turun */
    opacity: 0;
    pointer-events: none;
}

/* Tombol Tampilkan Menu (Muncul saat Immersive Mode) */
#btn-show-ui {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(76, 175, 80, 0.9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    z-index: 50;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}

#btn-show-ui.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Tombol Instal PWA dengan warna mencolok */
.install-btn {
    background: #FF9800 !important;
    border-color: #F57C00 !important;
    font-weight: bold;
}

/* --- Styling Modal Multi-Tab Baru --- */
.info-modal-content {
    max-width: 600px;
    padding: 25px;
}

.tab-navigation {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    color: #888;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    color: #4CAF50;
    border-bottom: 3px solid #4CAF50;
}

.tab-divider {
    border: 0;
    height: 1px;
    background: #444;
    margin-bottom: 20px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tipografi dalam Modal */
.tab-content h2 {
    color: #4CAF50;
    margin-bottom: 15px;
    font-size: 20px;
}

.intro-text {
    font-size: 14px;
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 15px;
}

.edu-section ul, .edu-section ol {
    padding-left: 20px;
    margin-top: 10px;
    color: #ccc;
    font-size: 13px;
    line-height: 1.6;
}

.edu-section li {
    margin-bottom: 8px;
}

.highlight-section {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4CAF50;
    padding: 15px;
}

.text-center {
    text-align: center;
}