/* shared/components.css — Admin Guru | v2.0 | 2026-07-16 */

/* ════════════════════════════════════════════════════════════
   BAGIAN 1: STEP GUIDE BANNER
   ════════════════════════════════════════════════════════════ */

.step-guide-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 20%, transparent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.step-guide-final {
  background: color-mix(in srgb, var(--color-btn-success) 8%, transparent);
  border-color: color-mix(in srgb, var(--color-btn-success) 20%, transparent);
  border-left-color: var(--color-btn-success);
}

.step-guide-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.step-guide-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-guide-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
}

.step-guide-final .step-guide-text strong {
  color: var(--color-btn-success);
}

.step-guide-text span {
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .step-guide-banner {
    padding: 12px;
    gap: 10px;
  }

  .step-guide-icon {
    font-size: 18px;
  }

  .step-guide-text strong {
    font-size: 12px;
  }

  .step-guide-text span {
    font-size: 11px;
  }
}

/* ════════════════════════════════════════════════════════════
   BAGIAN 2: PREVIEW EMPTY STATE
   ════════════════════════════════════════════════════════════ */

.preview-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  gap: 16px;
  text-align: center;
  padding: 40px;
  color: var(--ink-faint);
}

.preview-empty-icon {
  font-size: 56px;
  opacity: 0.35;
}

.preview-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-light);
}

.preview-empty-desc {
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
  color: var(--ink-faint);
}

.preview-empty-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  text-align: left;
  width: 100%;
  max-width: 320px;
}

.preview-empty-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-light);
  background: var(--paper-warm);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--ui-border);
}

.preview-empty-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--color-btn-primary-txt);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .preview-empty-state {
    min-height: 300px;
    padding: 24px 16px;
    gap: 12px;
  }

  .preview-empty-icon {
    font-size: 44px;
  }

  .preview-empty-title {
    font-size: 14px;
  }

  .preview-empty-steps {
    max-width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════
   BAGIAN 3: PROMPT MODE
   ════════════════════════════════════════════════════════════ */

.prompt-mode-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0;
}

.prompt-mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.prompt-mode-buttons .btn-copy,
.prompt-mode-buttons .btn-copy-oneshot {
  width: 100%;
  min-height: 42px;
  margin-top: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
  font-family: var(--font-ui);
  transition: all var(--transition-fast);
}

.prompt-mode-buttons .btn-copy {
  background: var(--color-btn-secondary);
  color: var(--color-btn-secondary-txt);
}

.prompt-mode-buttons .btn-copy:hover {
  background: var(--color-btn-secondary-hv);
}

.prompt-mode-buttons .btn-copy-oneshot {
  background: var(--color-btn-success);
  color: var(--color-btn-primary-txt);
}

.prompt-mode-buttons .btn-copy-oneshot:hover {
  background: var(--color-btn-success-hv);
}

.btn-copy.copy-sukses,
.btn-copy-oneshot.copy-sukses {
  background: var(--color-btn-neutral) !important;
  color: var(--color-btn-neutral-txt) !important;
  border-color: transparent !important;
}

@media (max-width: 560px) {
  .prompt-mode-buttons {
    grid-template-columns: 1fr;
  }
}

.prompt-mode-info {
  background: var(--color-bg-section);
  border: 1px solid var(--color-border-panel);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-mode-info-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-primary);
  margin: 0;
}

.prompt-mode-card {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border-panel);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.prompt-card-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text-primary);
  margin: 0 0 4px 0;
}

.prompt-card-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   BAGIAN 4: MODAL
   ════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog,
.modal-content {
  background: var(--color-bg-panel);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-panel);
  flex-shrink: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--ink-faint);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
}

.modal-close:hover {
  background: var(--color-bg-hover);
  color: var(--ink);
}

.modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border-panel);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .modal-dialog,
  .modal-content {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 12px 16px;
  }

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

  .modal-footer {
    padding: 12px 16px;
  }
}

/* ════════════════════════════════════════════════════════════
   BAGIAN 5: FLOATING SIDEBAR (desktop ≥1024px)
   ════════════════════════════════════════════════════════════ */

.floating-sidebar {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--color-bg-panel, #ffffff);
  border: 1px solid var(--color-border-panel, #e2e8f0);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.floating-sidebar.visible {
  opacity: 1;
  pointer-events: auto;
}

.floating-sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.floating-sidebar-btn:hover {
  background: var(--color-bg-hover, rgba(0,0,0,0.04));
  color: var(--color-text-primary, #0f172a);
}

.floating-sidebar-btn:active {
  transform: scale(0.95);
}

.floating-sidebar-btn-primary {
  background: var(--color-accent, #659287);
  color: #ffffff;
}

.floating-sidebar-btn-primary:hover {
  background: var(--color-accent-hover, #51746b);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(101, 146, 135, 0.3);
}

.floating-sidebar-btn-primary:active {
  transform: scale(0.95);
}

.floating-sidebar-tooltip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  font-family: var(--font-ui, 'Inter', system-ui, sans-serif);
  line-height: 1.3;
}

.floating-sidebar-btn:hover .floating-sidebar-tooltip {
  opacity: 1;
}

.floating-sidebar-divider {
  width: 24px;
  height: 1px;
  background: var(--color-border-panel, #e2e8f0);
  margin: 4px 0;
}

/* ════════════════════════════════════════════════════════════
   BAGIAN 6: DRAWER — Dokumen Tersimpan
   ════════════════════════════════════════════════════════════ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 80;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: drawerFadeIn 0.2s ease;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 85vw);
  max-width: 480px;
  background: var(--color-bg-panel, #ffffff);
  z-index: 90;
  box-shadow: -4px 0 24px rgba(0,0,0,0.10);
  display: flex;
  flex-direction: column;
  animation: drawerSlideIn 0.25s ease-out;
  overflow: hidden;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border-panel, #e2e8f0);
  flex-shrink: 0;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary, #0f172a);
  margin: 0;
}

.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-close:hover {
  background: var(--color-bg-hover, rgba(0,0,0,0.04));
  color: var(--color-text-primary, #0f172a);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

@keyframes drawerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ════════════════════════════════════════════════════════════
   BAGIAN 7: FAB — Floating Action Button (mobile)
   ════════════════════════════════════════════════════════════ */

.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent, #659287);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(101, 146, 135, 0.35);
  transition: all 0.2s ease;
}

.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(101, 146, 135, 0.45);
}

.fab:active {
  transform: scale(0.93);
}

/* ════════════════════════════════════════════════════════════
   BAGIAN 8: BOTTOM SHEET (mobile)
   ════════════════════════════════════════════════════════════ */

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 90;
  animation: drawerFadeIn 0.2s ease;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  background: var(--color-bg-panel, #ffffff);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
  animation: bottomSheetSlideUp 0.3s ease-out;
  max-height: 70vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--color-border-panel, #e2e8f0);
  border-radius: 2px;
  margin: 10px auto 6px;
  flex-shrink: 0;
}

.bottom-sheet-actions {
  padding: 8px 16px 16px;
}

.bottom-sheet-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text-primary, #0f172a);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-ui, 'Inter', system-ui, sans-serif);
  cursor: pointer;
  transition: background 0.15s ease;
}

.bottom-sheet-action:hover {
  background: var(--color-bg-hover, rgba(0,0,0,0.04));
}

.bottom-sheet-action span {
  flex: 1;
  text-align: left;
}

.bottom-sheet-divider {
  height: 1px;
  background: var(--color-border-panel, #e2e8f0);
  margin: 6px 16px;
}

@keyframes bottomSheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — Sidebar / FAB / Bottom Sheet
   ════════════════════════════════════════════════════════════ */

@media (min-width: 1024px) {
  .floating-sidebar {
    opacity: 1;
    pointer-events: auto;
  }

  .fab,
  .bottom-sheet,
  .bottom-sheet-overlay {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .floating-sidebar {
    display: none !important;
  }

  .fab {
    display: flex;
  }
}

/* ════════════════════════════════════════════════════════════
   DARK MODE — Sidebar, Drawer, Bottom Sheet
   ════════════════════════════════════════════════════════════ */

[data-theme="dark"] .floating-sidebar {
  background: var(--color-bg-panel, #111827);
  border-color: var(--color-border-panel, #1f2937);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .floating-sidebar-btn:hover {
  background: var(--color-bg-hover, rgba(255,255,255,0.05));
}

[data-theme="dark"] .floating-sidebar-tooltip {
  background: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .drawer {
  background: var(--color-bg-panel, #111827);
}

[data-theme="dark"] .drawer-header {
  border-bottom-color: var(--color-border-panel, #1f2937);
}

[data-theme="dark"] .bottom-sheet {
  background: var(--color-bg-panel, #111827);
}

[data-theme="dark"] .bottom-sheet-action:hover {
  background: var(--color-bg-hover, rgba(255,255,255,0.05));
}

/* ════════════════════════════════════════════════════════════
   LUCIDE ICON — Style Default
   ════════════════════════════════════════════════════════════ */

.icon {
  display: inline-block;
  vertical-align: middle;
}

i[data-lucide] {
  display: inline-block;
  vertical-align: middle;
}

.btn i[data-lucide] {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.section-title i[data-lucide] {
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

.icon-spin {
  animation: iconSpin 1s linear infinite;
}

@keyframes iconSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════
   PRINT — Sembunyikan sidebar, drawer, FAB
   ════════════════════════════════════════════════════════════ */
@media print {
  .floating-sidebar,
  .fab,
  .drawer,
  .drawer-overlay,
  .bottom-sheet,
  .bottom-sheet-overlay {
    display: none !important;
  }
}
