/* ==========================================================================
   LAYOUT DRAWER CSS (Panel Pengelola Tata Letak & Preset Tampilan)
   Smart Running Trade - Minimalist Monospace High-Contrast Design
   ========================================================================== */

.layout-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.layout-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.layout-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  max-width: calc(100vw - 50px);
  height: 100vh;
  background: #090d16;
  border-left: 1px solid #1e293b;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  box-sizing: border-box;
}

.layout-drawer.open {
  transform: translateX(0);
}

/* Header */
.layout-drawer-header {
  padding: 14px 18px;
  background: #0d1322;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.layout-hdr-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.layout-hdr-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.layout-hdr-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #f8fafc;
}

.layout-hdr-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 1px;
}

.layout-close-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.layout-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Body */
.layout-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.layout-drawer-body::-webkit-scrollbar {
  width: 5px;
}
.layout-drawer-body::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

/* Card Container */
.layout-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 7px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.layout-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.layout-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #38bdf8;
  text-transform: uppercase;
}

.layout-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.layout-badge.saved {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.layout-badge.info {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.layout-card-desc {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.5;
}

/* Primary Action Button (Big Save) */
.layout-btn-primary {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border: 1px solid #10b981;
  border-radius: 5px;
  color: #ffffff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.layout-btn-primary:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.layout-btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button */
.layout-btn-sec {
  padding: 7px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.layout-btn-sec:hover {
  background: #334155;
  color: #ffffff;
  border-color: #475569;
}

/* Slot Items */
.layout-slots-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layout-slot-item {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 5px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s ease;
}

.layout-slot-item:hover {
  border-color: #38bdf8;
}

.layout-slot-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.layout-slot-title {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.layout-slot-sub {
  font-size: 9.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layout-slot-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.layout-slot-btn {
  padding: 5px 9px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.layout-slot-btn.load {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}
.layout-slot-btn.load:hover {
  background: #38bdf8;
  color: #0b1120;
}

.layout-slot-btn.save {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.layout-slot-btn.save:hover {
  background: #10b981;
  color: #ffffff;
}

.layout-slot-btn.del {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.layout-slot-btn.del:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Preset Cards (Factory presets) */
.layout-factory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.layout-factory-card {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 5px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.layout-factory-card:hover {
  border-color: #38bdf8;
  background: #111a2e;
}

.layout-factory-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.layout-factory-desc {
  font-size: 9px;
  color: #64748b;
  line-height: 1.4;
}

.layout-factory-btn {
  margin-top: auto;
  padding: 4px 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 3px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  transition: all 0.15s ease;
}

.layout-factory-card:hover .layout-factory-btn {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #0b1120;
}

/* Toast feedback */
.layout-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  border: 1px solid #10b981;
  color: #34d399;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 100000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.layout-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.layout-drawer-footer {
  padding: 12px 18px;
  background: #0d1322;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.layout-footer-btn-reset {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 10px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.layout-footer-btn-reset:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #f87171;
}

.layout-footer-btn-close {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.layout-footer-btn-close:hover {
  background: #334155;
}

/* Light Theme Overrides */
body.theme-light .layout-drawer {
  background: #ffffff;
  border-left-color: #cbd5e1;
  color: #0f172a;
}
body.theme-light .layout-drawer-header,
body.theme-light .layout-drawer-footer {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .layout-hdr-title {
  color: #0f172a;
  font-weight: 900;
}
body.theme-light .layout-hdr-sub {
  color: #0f172a;
  font-weight: 700;
}
body.theme-light .layout-close-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  font-weight: 800;
}
body.theme-light .layout-card {
  background: #ffffff;
  border-color: #e2e8f0;
}
body.theme-light .layout-slot-item,
body.theme-light .layout-factory-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light .layout-slot-title,
body.theme-light .layout-factory-title {
  color: #0f172a;
  font-weight: 800;
}
