/* ============ RESIZE HANDLE ============ */
#resize-handle {
    height: 6px;
    background: #2a2a3a;
    cursor: ns-resize;
    position: relative;
    z-index: 10;
    transition: background 0.2s;
}

#resize-handle:hover {
    background: #4CAF50;
}

.handle-line {
    width: 60px;
    height: 3px;
    background: #888;
    border-radius: 3px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.2s;
}

#resize-handle:hover .handle-line {
    background: white;
}

/* MAP CONTAINER */
#map-container {
    position: relative;
    transition: height 0.05s ease;
}

#map {
    width: 100%;
    height: 100%;
}

/* PREVIEW CONTAINER */
#preview-container {
    display: flex;
    flex-direction: column;
    background: #0a0a0f;
    overflow: hidden;
}

.preview-header {
    padding: 6px 12px;
    background: #1a1a2e;
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

.preview-header h4 {
    color: #4CAF50;
    font-size: 12px;
    margin: 0;
}

#previewContent {
    flex: 1;
    background: #000;
    min-height: 0;
}

#previewContent iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #666;
    font-size: 12px;
}

/* ============ SISANYA SAMA DENGAN SEBELUMNYA ============ */
/* (sertakan semua CSS dari layout sebelumnya di sini) */



/* ============ RESET & GLOBAL ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', system-ui, sans-serif;
    background: #0a0a0f;
    overflow: hidden;
}

/* ============ LAYOUT UTAMA ============ */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ============ SIDEBAR KIRI (SEMUA KONTROL) ============ */
.sidebar {
    width: 340px;
    background: linear-gradient(180deg, #0f0f1a 0%, #0a0a0f 100%);
    border-right: 1px solid rgba(74, 144, 226, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 20;
    color: #e0e0e0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff, #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sub {
    font-size: 11px;
    color: #888;
    margin-bottom: 10px;
}

.map-name {
    background: rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(74, 144, 226, 0.3);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    margin: 8px 0;
    text-align: center;
}

.search-box {
    width: 100%;
    padding: 8px 12px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
}

/* TAG SECTION */
.tag-section {
    padding: 12px;
    border-bottom: 1px solid rgba(74, 144, 226, 0.15);
}

.tag-section h4 {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    max-height: 100px;
    overflow-y: auto;
}

.tag-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 20px;
    font-size: 10px;
    cursor: pointer;
}

.tag-filter.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.tag-filter .count {
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    padding: 1px 5px;
    font-size: 9px;
}

.add-tag {
    display: flex;
    gap: 6px;
}

.add-tag input {
    flex: 1;
    padding: 6px 10px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
}

.add-tag button {
    width: auto;
    padding: 6px 12px;
    background: #083be2;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 11px;
}

/* LOCATIONS LIST */
.locations-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 150px;
}

.location-group h3 {
    font-size: 11px;
    color: #888;
    margin-bottom: 8px;
}

.location-item {
    padding: 8px 10px;
    margin: 6px 0;
    background: #1a1a2e;
    border: 1px solid rgba(74, 144, 226, 0.15);
    border-radius: 8px;
    cursor: pointer;
}

.location-item:hover {
    background: #2a2a3a;
    border-color: #1013e7;
}

.location-item .title {
    font-weight: 500;
    font-size: 12px;
}

.location-item .coord {
    font-size: 9px;
    color: #888;
    font-family: monospace;
}

.location-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.location-tag {
    background: #2009f0;
    color: white;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* SIDEBAR SETTINGS & STATS (BAGIAN BAWAH) */
.sidebar-settings {
    border-top: 1px solid rgba(74, 144, 226, 0.2);
    padding: 12px;
    background: #0f0f1a;
}

.settings-group, .stats-group {
    margin-bottom: 12px;
}

.settings-group h4, .stats-group h4 {
    font-size: 11px;
    color: #ffffff;
    margin-bottom: 6px;
}

.control-group {
    margin-bottom: 8px;
}

.control-group label {
    font-size: 10px;
    color: #aaa;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

button {
    width: 100%;
    padding: 6px;
    margin: 3px 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
}

.btn-primary { background: #4CAF50; color: white; }
.btn-secondary { background: #2a2a3a; color: #e0e0e0; border: 1px solid #3a3a4a; }
.btn-danger { background: #f44336; color: white; }

.stats {
    background: #1a1a2e;
    border-radius: 6px;
    padding: 8px;
    font-size: 11px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
}

.progress-bar-container {
    background: #2a2a3a;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #4CAF50;
    width: 0%;
}

/* ============ KONTEN KANAN (MAP + PREVIEW) ============ */
.right-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* MAP CONTAINER (70% dari tinggi) */
#map-container {
    flex: 7;
    position: relative;
    min-height: 0;
}

#map {
    width: 100%;
    height: 100%;
}

/* PREVIEW SECTION (30% dari tinggi) */
.preview-section {
    flex: 3;
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
    background: #0a0a0f;
    min-height: 0;
}

.preview-header {
    padding: 6px 12px;
    background: #1a1a2e;
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

.preview-header h4 {
    color: #4CAF50;
    font-size: 12px;
    margin: 0;
}

#previewContainer {
    flex: 1;
    background: #000;
    min-height: 0;
}

#previewContainer iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #666;
    font-size: 12px;
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 11px;
    z-index: 9999;
    display: none;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: #1a1a2e;
}
::-webkit-scrollbar-thumb {
    background: #ffffff;
    border-radius: 3px;
}