body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f4f7f6; margin: 0; padding: 20px; color: #333; }
.container { max-width: 1000px; margin: 0 auto; background: #fff; padding: 20px 30px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-top: 80px;}
h2 { text-align: center; color: #2c3e50; }

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    /* background-color: #e0e0e0; */
    /* color: #333; */
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.tab-btn:hover { background-color: #d5d5d5; }

.tab-btn.active {
    background-color: #3498db;
    color: #fff;
}

.section { display: none; }
.section.active { display: block; }

/* DRAG & DROP ZONE */
.dropzone { 
    border: 3px dashed #bdc3c7; padding: 40px 20px; text-align: center; 
    border-radius: 10px; margin-bottom: 20px; background: #fafafa; 
    cursor: pointer; transition: all 0.3s ease; position: relative;
}
.dropzone:hover, .dropzone.dragover { border-color: #3498db; background: #ebf5fb; }
.dropzone input[type="file"] { display: none; }
.dropzone i { font-size: 40px; color: #95a5a6; margin-bottom: 10px; pointer-events: none; }
.dropzone p { margin: 0; color: #7f8c8d; font-size: 16px; pointer-events: none; }

.view-controls { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 15px; }
.view-btn { padding: 8px 12px; border: 1px solid #bdc3c7; background: #ecf0f1; cursor: pointer; border-radius: 4px; font-size: 16px; transition: 0.2s; }
.view-btn.active { background: #3498db; color: white; border-color: #3498db; }

/* ITEM PDF UMUM */
.pdf-list { list-style-type: none; padding: 0; margin: 0 0 20px 0; display: block; }
.pdf-item, .split-page { 
    background: #fff; border: 2px solid #dcdde1; border-radius: 8px; 
    position: relative; box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
    transition: box-shadow 0.2s, border-color 0.2s; 
}
.pdf-item { cursor: grab; }
.pdf-item:active { cursor: grabbing; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

.pdf-thumb-container { background: #ecf0f1; display: flex; justify-content: center; align-items: center; overflow: hidden; border-radius: 6px 6px 0 0; }
.pdf-thumb-container img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pdf-info { padding: 10px; font-size: 13px; word-break: break-all; text-align: center; }

/* TOMBOL HAPUS & NOMOR URUT */
.remove-btn { position: absolute; background: #e74c3c; color: white; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: 12px; top: -10px; right: -10px; z-index: 10; display: flex; justify-content: center; align-items: center;}
.remove-btn:hover { background: #c0392b; transform: scale(1.1); }
.seq-num { position: absolute; top: 130px; left: 5px; background: #00000055; color: white; border-radius: 50%; width: 24px; height: 24px; font-weight: bold; font-size: 12px; display: flex; justify-content: center; align-items: center; z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.2);backdrop-filter: blur(10px); }

/* GRID VIEW */
.grid-view { display: block; }
.grid-view .pdf-item, .grid-view .split-page { 
    display: inline-block; vertical-align: top; width: calc(20% - 15px); min-width: 120px; 
    margin: 0 10px 15px 0; 
}
.grid-view .pdf-thumb-container { height: 160px; width: 100%; padding: 5px; box-sizing: border-box; border-bottom: 1px solid #eee; }

/* LIST VIEW */
.pdf-list.list-view { display: block; }
.pdf-list.list-view .pdf-item { display: flex; align-items: center; margin-bottom: 10px; width: 100%; }
.pdf-list.list-view .pdf-thumb-container { width: 50px; height: 70px; margin-right: 15px; border-radius: 6px 0 0 6px; }
.pdf-list.list-view .pdf-info { flex: 1; text-align: left; }
.pdf-list.list-view .remove-btn { top: 50%; right: 15px; transform: translateY(-50%); }
.pdf-list.list-view .seq-num { top: 50%; left: -10px; transform: translateY(-50%); }

/* SORTABLE PLACEHOLDER */
.sortable-placeholder { border: 2px dashed #3498db; background: #ebf5fb; border-radius: 8px; visibility: visible !important; display: inline-block; margin: 0 10px 15px 0; }
.list-view .sortable-placeholder { display: block; margin-bottom: 10px; width: auto; }

/* SPLIT STYLES */
.split-page { cursor: pointer; }
.split-page.selected { border-color: #2ecc71; background: #eafaf1; box-shadow: 0 0 10px rgba(46, 204, 113, 0.4); }
.split-page.selected .pdf-info { font-weight: bold; color: #27ae60; }
.split-controls { display: flex; justify-content: space-between; margin-bottom: 15px; align-items: center; }
.btn-small { padding: 6px 12px; border: none; background: #bdc3c7; color: #333; border-radius: 4px; cursor: pointer; }
.btn-small:hover { background: #95a5a6; color: white; }

.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: bold; }
.input-group input[type="text"] { width: 100%; padding: 12px; border: 2px solid #bdc3c7; border-radius: 6px; box-sizing: border-box; }

/* ACTION BUTTONS (Diperbarui) */
.action-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.action-btn { flex: 1; padding: 15px; background: #27ae60; color: white; border: none; border-radius: 6px; font-size: 16px; cursor: pointer; font-weight: bold; transition: 0.3s; min-width: 180px;}
.action-btn:hover { background: #2ecc71; }
.action-btn.blue { background: #2980b9; }
.action-btn.blue:hover { background: #3498db; }
.action-btn:disabled { background: #95a5a6; cursor: not-allowed; }

.btn-clear { padding: 15px; background: #e74c3c; color: white; border: none; border-radius: 6px; font-size: 16px; cursor: pointer; font-weight: bold; transition: 0.3s; white-space: nowrap; }
.btn-clear:hover { background: #c0392b; }

#status { text-align: center; margin-top: 15px; font-weight: bold; padding: 10px; border-radius: 4px; }