* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #000000; color: #ffffff;
    margin: 0; padding: 0;
    width: 100vw; height: 100vh;
    overflow: hidden;
}

/* LAYAR PEMBUKA */
#splashScreen {
    position: fixed; inset: 0; background: #111; z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
#btnStartApp { background: #ffcc00; color: #000; padding: 15px 30px; font-weight: bold; border-radius: 20px; border: none; cursor: pointer; }

/* RUANG KERJA UTAMA */
.editor-layout { display: none; flex-direction: column; width: 100%; height: 100%; background: #000; }

/* --- HACK: PAKSA LANDSCAPE JIKA HP POTRET --- */
@media screen and (orientation: portrait) {
    .editor-layout {
        transform: rotate(90deg); transform-origin: left top;
        width: 100vh; height: 100vw;
        position: absolute; top: 0; left: 100%;
    }
}

.workspace-top { display: flex; flex: 1; height: 65%; border-bottom: 1px solid #1a1a1a; }

/* KIRI */
.toolbar-left { width: 50px; background: #0f0f0f; display: flex; flex-direction: column; align-items: center; padding-top: 20px; gap: 20px; border-right: 1px solid #1a1a1a; }
.icon-btn { background: none; border: none; color: #aaa; font-size: 18px; cursor: pointer; }

/* TENGAH (PREVIEW) */
.preview-center { flex: 1; background: #050505; position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; }
#videoContainer { width: 100%; height: 100%; position: relative; display: flex; justify-content: center; align-items: center; }
#mediaPlayer { width: 100%; max-height: 100%; object-fit: contain; }
#greenBg { position: absolute; inset: 0; background: #00FF00; z-index: 1; }
.hidden { display: none !important; }

#overlayLayer { position: absolute; z-index: 10; width: 85%; background: rgba(0,0,0,0.6); padding: 15px; border-radius: 8px; text-align: center; }
.layout-bottom { bottom: 15%; }
.overlay-hidden { opacity: 0; }
.overlay-visible { opacity: 1; }
.arab-text { font-size: 32px; color: #fff; direction: rtl; }
.terj-text { font-size: 14px; color: #ccc; }

/* KANAN (MENU KINEMASTER) */
.panel-right { width: 260px; background: #1a1a1a; display: flex; flex-direction: column; border-left: 1px solid #222; }
.panel-header { display: flex; justify-content: space-between; padding: 15px; border-bottom: 1px solid #2a2a2a; }
.panel-content { padding: 15px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }

.tool-grid { display: flex; gap: 10px; }
.tool-item { flex: 1; background: #222; border: 1px solid #333; padding: 10px 0; border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; color: #ccc; position: relative; }

.list-settings { display: flex; flex-direction: column; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #2a2a2a; font-size: 14px; color: #ddd; }
.row-left { display: flex; gap: 10px; align-items: center; }
.row-right { display: flex; gap: 10px; align-items: center; }
.row-right input { width: 40px; background: transparent; border: none; color: #fff; text-align: right; font-size: 14px; outline: none; }

/* TOMBOL TOGGLE */
#btnMarkToggle { padding: 15px; border-radius: 8px; border: none; font-size: 14px; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; transition: 0.2s; }
.btn-mark-idle { background: #333; color: #fff; }
.btn-mark-active { background: #ff4444; color: #fff; box-shadow: 0 0 15px rgba(255, 68, 68, 0.5); }

/* BAWAH (TIMELINE) */
.timeline-bottom { height: 35%; background: #0f0f0f; display: flex; border-top: 1px solid #222; }
.timeline-controls { width: 80px; background: #151515; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; padding: 10px; border-right: 1px solid #222; }
.play-btn { font-size: 24px; color: #fff; width: 100%; }

.track-area { flex: 1; position: relative; overflow-x: auto; padding-top: 25px; }
.ruler { position: absolute; top: 0; left: 0; width: 100%; height: 25px; border-bottom: 1px solid #333; }
.track-container { position: relative; height: 100%; min-width: 100%; padding: 10px 0; }
.track { height: 50px; background: #1a1a1a; position: relative; margin-top: 10px; }

.clip { position: absolute; height: 100%; background: #222; border: 1px solid #444; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #888; overflow: hidden; border-radius: 4px; }
.clip.active-clip { border: 2px solid #ffcc00; background: rgba(255, 204, 0, 0.1); z-index: 2; }

#playhead { position: absolute; top: -25px; bottom: 0; width: 2px; background: #ff4444; left: 50vw; z-index: 10; pointer-events: none; }
#timeBubble { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); background: #ff4444; color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: bold; }
/* --- DESAIN KLIP MULTIMEDIA --- */
.media-clip {
    position: absolute; height: 100%; background: #2b5797;
    border: 1px solid #444; border-radius: 4px; display: flex;
    align-items: center; justify-content: space-between;
    font-size: 10px; color: #fff; overflow: hidden; padding: 0 5px;
    cursor: pointer; z-index: 1;
}
.media-clip:hover { filter: brightness(1.2); }
.media-clip .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; pointer-events: none; }
.media-controls { display: flex; gap: 2px; }
.media-controls button {
    background: #111; color: #fff; border: none; padding: 3px 5px;
    font-size: 9px; cursor: pointer; border-radius: 2px;
}
.media-controls button:hover { background: #ffcc00; color: #000; }
/* Mematikan efek berat saat video berputar */
body.is-playing .arab-text {
    text-shadow: none !important;
}
