/* ============================================================
   STYLE.CSS — SlideEdu v1.0
   Layout & UI Aplikasi
   Menggunakan CSS variables dari shared-theme.css
   ============================================================ */

/* ── RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-primary, #f8fafc);
  color: var(--text-primary, #1a202c);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── APP HEADER ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: var(--bg-card, #ffffff);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  flex-shrink: 0;
  z-index: 100;
}

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

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}

.back-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #1a202c);
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary, #1a365d);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary, #1a365d);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--primary, #1a365d);
  border: 1.5px solid var(--primary, #1a365d);
  border-radius: 8px;
  padding: 7px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover, #f1f5f9);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  font-size: 16px;
  transition: background 0.15s;
}

.icon-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #1a202c);
}

/* ── IMPORT BOX ── */
.import-box {
  background: var(--bg-muted, #f8fafc);
  border: 1px dashed var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}

.help-text {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  margin-top: 6px;
}

/* ── LAYOUT LIST ── */
.layout-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.layout-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 10px;
}

.layout-item label {
  font-size: 13px;
  color: var(--text-primary, #1a202c);
  font-weight: 600;
}

.layout-item select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: #fff;
}

/* ── IMAGE UPLOAD (Edit Tab) ── */
.image-upload-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}

.section-subtitle {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  margin-bottom: 10px;
}

.image-upload-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.image-upload-item {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.image-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.image-upload-status {
  font-size: 11px;
  color: #16a34a;
}

.image-upload-input,
.image-caption-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  font-family: inherit;
  font-size: 12px;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-card {
  width: min(640px, 92vw);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.modal-tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
}

.modal-tab.active {
  color: var(--primary, #1a365d);
  border-bottom: 2px solid var(--primary, #1a365d);
}

.modal-body {
  padding: 14px 16px 16px;
}

.modal-panel {
  display: none;
}

.modal-panel.active {
  display: block;
}

.modal-body textarea {
  width: 100%;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
}

/* ── MAIN LAYOUT ── */
.app-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── PANEL KIRI - Mobile First ── */
.panel-left {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #ffffff);
  border-right: none;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  overflow: hidden;
  height: auto;
}

/* Tablet landscape & Desktop (≥769px) - Split layout */
@media (min-width: 769px) {
  .panel-left {
    width: 40%;
    min-width: 280px;
    max-width: 420px;
    border-right: 1px solid var(--border-color, #e2e8f0);
    border-bottom: none;
    height: 100%;
  }
}

@media (min-width: 1024px) {
  .panel-left {
    max-width: 480px;
  }
}

@media (min-width: 1280px) {
  .panel-left {
    width: 35%;
    max-width: 500px;
  }
}

/* ── TAB BAR ── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary, #64748b);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  flex: 1;
  min-width: 52px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.tab-btn i {
  font-size: 16px;
}

.tab-btn:hover {
  color: var(--primary, #1a365d);
  background: var(--bg-hover, #f1f5f9);
}

.tab-btn.active {
  color: var(--primary, #1a365d);
  border-bottom-color: var(--primary, #1a365d);
  font-weight: 700;
}

/* ── TAB PANELS ── */
.tab-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
}

.tab-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #1a202c);
}

.section-desc {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
  margin-top: -8px;
}

/* ── FORM ELEMENTS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1a202c);
}

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary, #1a202c);
  background: var(--bg-primary, #f8fafc);
  transition: border-color 0.15s;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary, #1a365d);
  background: var(--bg-card, #ffffff);
}

input.input-error,
select.input-error,
textarea.input-error {
  border-color: #e53e3e;
  background: #fff5f5;
}

.checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-primary, #f8fafc);
}

.checkbox-group.input-error {
  border-color: #e53e3e;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  accent-color: var(--primary, #1a365d);
}

/* ── PROMPT BUILDER ── */
.prompt-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-primary, #f8fafc);
}

.prompt-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt-badge {
  background: var(--primary, #1a365d);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.prompt-label {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  font-weight: 500;
}

.prompt-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 200px;
  font-size: 12px;
  font-family: monospace;
  resize: vertical;
  background: var(--bg-card, #ffffff);
}

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-primary, #1a202c);
  transition: background 0.15s;
}

.btn-copy:hover {
  background: var(--bg-hover, #f1f5f9);
}

.copy-feedback {
  font-size: 12px;
  color: #38a169;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-feedback.show {
  opacity: 1;
}

.prompt-guide {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
  font-style: italic;
}

.merger-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  font-size: 13px;
  color: #1d4ed8;
}

.merger-link-box a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.merger-link-box a:hover {
  text-decoration: underline;
}

/* ── JSON STATUS ── */
.json-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-primary, #f8fafc);
  border: 1.5px solid var(--border-color, #e2e8f0);
}

.status-valid {
  color: #38a169;
  font-weight: 700;
}

.status-invalid {
  color: #e53e3e;
  font-weight: 700;
}

/* ── EDIT FIELDS ── */
.edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edit-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.edit-separator {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary, #1a365d);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 0 2px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  margin-top: 4px;
  opacity: 0.7;
}

/* ── EDIT SECTION — collapsible grouping ── */
.edit-section {
  margin-bottom: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card, #ffffff);
}

.edit-section-note {
  border-color: #fbd38d;
  background: #fffbeb;
}

.edit-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-muted, #f8fafc);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.edit-section-header:hover {
  background: var(--bg-hover, #f1f5f9);
}

.edit-section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #1a202c);
}

.edit-section-arrow {
  font-size: 18px;
  color: var(--text-secondary, #64748b);
  transition: transform 0.2s;
}

.edit-section-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edit-section-body.collapsed {
  display: none;
}

/* Character count & warning */
.edit-char-count {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  margin-top: 2px;
}

.char-count-warning {
  color: #dd6b20 !important;
  font-weight: 600;
}

.input-warning {
  border-color: #fbd38d !important;
  background: #fffbeb !important;
}

.input-warning:focus {
  border-color: #dd6b20 !important;
}

/* ── EDIT SLIDE HEADER ── */
.edit-slide-header {
  background: var(--bg-muted, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.edit-slide-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-slide-num {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary, #1a365d);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.edit-slide-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1a202c);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-layout-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-layout-row .edit-label {
  flex-shrink: 0;
  margin: 0;
}

.edit-layout-select {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  font-family: inherit;
  font-size: 13px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #1a202c);
}

.edit-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #1a202c);
  outline: none;
  resize: vertical;
}

.edit-input:focus {
  border-color: var(--primary, #1a365d);
}

/* Form select styling */
.form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #1a202c);
  cursor: pointer;
  outline: none;
}

.form-group select:focus {
  border-color: var(--primary, #1a365d);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

/* Validasi Cerdas — Warnings */
.slide-validation-warnings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}

.edit-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.edit-warning i {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.edit-warning.error {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border-left: 3px solid #dc2626;
}

.edit-warning.warning {
  background: rgba(230, 81, 0, 0.08);
  color: #bf360c;
  border-left: 3px solid #E65100;
}

.edit-warning.suggestion {
  background: rgba(21, 101, 192, 0.08);
  color: #1565C0;
  border-left: 3px solid #1565C0;
}

/* Toggle Animasi — Grid 2 kolom */
.anim-grid-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}

.edit-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  margin-top: 8px;
  background: var(--bg-card, #ffffff);
  padding-bottom: 4px;
}

.edit-actions-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.edit-actions-row .btn-primary {
  flex: 1;
  min-width: 0;
  justify-content: center;
  font-size: 13px;
  padding: 7px 12px;
}

.edit-actions-row .btn-secondary {
  flex: 1;
  min-width: 0;
  justify-content: center;
  font-size: 13px;
  padding: 6px 10px;
}

.btn-sm-slide {
  font-size: 12px !important;
  padding: 6px 8px !important;
  min-width: 0;
}

.btn-sm-slide i {
  font-size: 14px;
}

/* Tombol Hapus — merah */
.edit-actions-row .btn-secondary[onclick="deleteSlide()"] {
  color: #dc2626;
  border-color: #dc2626;
}

/* ── TEMA OPTIONS ── */
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-option {
  cursor: pointer;
}

.theme-option input[type="radio"] {
  display: none;
}

.theme-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s;
}

.theme-option input:checked + .theme-swatch {
  border-color: var(--primary, #1a365d);
  outline: 2px solid var(--primary, #1a365d);
  outline-offset: 2px;
}

.theme-swatch.standar { 
  background: #1a365d; color: white; 
}
.theme-swatch.biru { 
  background: #1565C0; color: white; 
}
.theme-swatch.hijau { 
  background: #1B5E20; color: white; 
}
.theme-swatch.grey { 
  background: #37474F; color: white; 
}
.theme-swatch.orange { 
  background: #E65100; color: white; 
}
.theme-swatch.ungu { 
  background: #4A148C; color: white; 
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.toggle-label input[type="checkbox"] {
  width: auto;
  padding: 0;
  accent-color: var(--primary, #1a365d);
}

.divider {
  border: none;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

/* ── PANEL KANAN ── */
.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary, #f8fafc);
  overflow: hidden;
  padding: 20px;
  gap: 12px;
}

/* ── SLIDE PREVIEW ── */
.slide-preview-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.slide-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary, #64748b);
  text-align: center;
  padding: 40px;
}

.slide-empty-state i {
  font-size: 48px;
  opacity: 0.4;
}

.slide-empty-state h3 {
  font-size: 18px;
  font-weight: 600;
}

.slide-empty-state p {
  font-size: 14px;
  max-width: 280px;
  line-height: 1.6;
}

.slide-frame {
  width: 100%;
  height: 100%;
  display: none;
  position: relative;
}

/* ── SLIDE CONTROLS ── */
.slide-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #1a202c);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-btn:hover:not(:disabled) {
  background: var(--primary, #1a365d);
  color: white;
  border-color: var(--primary, #1a365d);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.slide-counter {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  min-width: 60px;
  text-align: center;
}

/* ── THUMBNAIL STRIP ── */
.thumbnail-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  flex-shrink: 0;
  scrollbar-width: thin;
}

.thumbnail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  cursor: pointer;
  min-width: 70px;
  max-width: 90px;
  transition: border-color 0.15s;
  flex-shrink: 0;
}

.thumbnail-item:hover {
  border-color: var(--primary, #1a365d);
}

.thumbnail-item.active {
  border-color: var(--primary, #1a365d);
  background: var(--primary, #1a365d);
  color: white;
}

.thumb-num {
  font-size: 11px;
  font-weight: 700;
}

.thumb-title {
  font-size: 10px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80px;
}

/* Drag & Drop — Thumbnail */
.thumbnail-item.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border-style: dashed;
}

.thumbnail-item.drag-over {
  border-color: var(--primary, #1a365d);
  background: rgba(26, 54, 93, 0.1);
  border-style: dashed;
  transform: scale(1.05);
}

/* ── EMPTY STATE ── */
.empty-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  font-style: italic;
  padding: 12px;
}

/* ── DARK MODE ── */
[data-theme="dark"] body {
  background: var(--bg-primary, #0f172a);
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .app-header,
[data-theme="dark"] .panel-left {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
  color: var(--text-primary, #f1f5f9);
}

/* ── RESPONSIVE — Mobile/Tablet ── */

/* Tablet (≤768px) - Stack layout */
@media (max-width: 768px) {
  body {
    overflow: auto;
  }

  .app-main {
    flex-direction: column;
  }

  .panel-left {
    height: auto;
    max-height: 50vh;
  }

  .panel-right {
    padding: 12px;
    min-height: 400px;
  }

  .app-header {
    padding: 0 16px;
    height: 52px;
  }

  .header-left {
    gap: 12px;
  }

  .back-btn span {
    display: none;
  }

  .app-title {
    font-size: 16px;
  }

  .header-right .btn-primary span,
  .header-right .btn-secondary span {
    display: none;
  }
}

/* Mobile besar (≤480px) */
@media (max-width: 480px) {
  .app-header {
    padding: 0 12px;
    height: auto;
    min-height: 52px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .header-left {
    gap: 8px;
    flex: 1;
  }

  .back-btn {
    padding: 6px 8px;
  }

  .app-title {
    font-size: 14px;
    gap: 6px;
  }

  .app-title i {
    font-size: 18px;
  }

  .header-right {
    gap: 6px;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 6px 10px;
    font-size: 12px;
  }

  .btn-primary i,
  .btn-secondary i {
    font-size: 14px;
  }
}

/* Mobile kecil (≤375px) */
@media (max-width: 375px) {
  .app-header {
    padding: 0 8px;
    gap: 6px;
  }

  .header-left {
    gap: 6px;
  }

  .back-btn {
    padding: 4px 6px;
    font-size: 13px;
  }

  .app-title {
    font-size: 13px;
  }

  .header-right {
    gap: 4px;
  }

  .icon-btn {
    width: 28px;
    height: 28px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 5px 8px;
    font-size: 11px;
  }
}

/* ── PRESENTATION OVERLAY ── */
#presentation-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#presentation-slide {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

/* Slide di dalam overlay mengisi layar penuh */
#presentation-slide .slide {
  width: 100vw;
  height: calc(100vh - 56px);
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}

/* ══════════════════════════════════════════
   TRANSISI SLIDE — Presentasi
══════════════════════════════════════════ */

/* Exit — slide keluar ke kiri */
#presentation-slide.slide-exit-left {
  animation: slideExitLeft 0.5s ease forwards;
}

@keyframes slideExitLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-30%); opacity: 0; }
}

/* Exit — slide keluar ke kanan */
#presentation-slide.slide-exit-right {
  animation: slideExitRight 0.5s ease forwards;
}

@keyframes slideExitRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(30%); opacity: 0; }
}

/* Enter — slide masuk dari kanan */
#presentation-slide.slide-enter-right {
  animation: slideEnterRight 0.5s ease forwards;
}

@keyframes slideEnterRight {
  from { transform: translateX(30%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Enter — slide masuk dari kiri */
#presentation-slide.slide-enter-left {
  animation: slideEnterLeft 0.5s ease forwards;
}

@keyframes slideEnterLeft {
  from { transform: translateX(-30%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Zoom In — slide masuk dengan zoom */
#presentation-slide.zoom-in {
  animation: zoomIn 0.6s ease forwards;
}

@keyframes zoomIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Zoom Out — slide keluar dengan zoom */
#presentation-slide.zoom-out {
  animation: zoomOut 0.4s ease forwards;
}

@keyframes zoomOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.3); opacity: 0; }
}

.pres-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.7);
  width: 100%;
  justify-content: center;
  flex-shrink: 0;
}

.pres-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.pres-btn:hover {
  background: rgba(255,255,255,0.25);
}

.pres-btn i {
  font-size: 18px;
}

.pres-exit {
  margin-left: 16px;
  background: rgba(220, 38, 38, 0.6);
  border-color: rgba(220, 38, 38, 0.8);
}

.pres-exit:hover {
  background: rgba(220, 38, 38, 0.85);
}

.pres-counter {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}

.pres-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.pres-progress-bar {
  height: 100%;
  background: var(--primary, #1a365d);
  transition: width 0.3s ease;
}

/* Sembunyikan semua UI saat presentation-mode (fallback jika overlay belum tampil) */
body.presentation-mode .app-header,
body.presentation-mode .app-main {
  visibility: hidden;
}

/* ── PDF PREVIEW OVERLAY ── */
#pdf-preview-overlay {
  position: fixed;
  inset: 0;
  background: #e2e8f0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
}

.pdf-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg-card, #ffffff);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  flex-shrink: 0;
  gap: 12px;
}

.pdf-preview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #1a202c);
}

.pdf-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Wrapper baris preview: 2 slide atas-bawah, simulasi A4 portrait */
.pdf-preview-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 680px;
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

/* Setiap slide di dalam preview row */
.slide-print-page {
  background: #fff;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  width: 100%;
}

/* Print styles — hanya tampilkan print-container */
@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  /* Sembunyikan semua UI kecuali print-container */
  body > *:not(#print-container) {
    display: none !important;
  }

  #print-container {
    display: block !important;
  }

  /*
   * Wrapper halaman: 2 slide per lembar A4 portrait
   * Slide atas dan bawah (flex column)
   * A4 portrait usable height ~277mm - 16mm margin = ~261mm
   * Setiap slide ~130mm tinggi, aspect-ratio 16:9
   */
  .print-page {
    width: 100%;
    height: 277mm;
    display: flex;
    flex-direction: column;
    gap: 5mm;
    page-break-after: always;
    break-after: page;
    box-sizing: border-box;
  }

  /* Slide di dalam print: lebar penuh, tinggi setengah halaman */
  .print-page .slide-print-page {
    width: 100%;
    flex: 1;
    overflow: hidden;
    box-shadow: none;
    border-radius: 0;
    border: none;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Slide mengisi penuh wrapper-nya */
  .print-page .slide-print-page .slide {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    font-size: 11px;
  }

  /* Paksa warna background tercetak */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

#print-container {
  display: none;
}
