/* Editorial Studio Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-main: #090d16;
  --bg-card: #0f172a;
  --border-color: #1e293b;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: #f1f5f9;
  overflow-x: hidden;
}

[v-cloak] {
  display: none !important;
}

/* Sleek icon-rail collapsed sidebar matching Editorial Studio palette; expands smoothly on hover/focus */
.studio-sidebar {
  width: 68px !important;
  flex: 0 0 68px !important;
  overflow: hidden;
  position: relative;
  z-index: 30;
  background: linear-gradient(180deg, #0b1220 0%, #090e1a 100%);
  box-shadow: inset -1px 0 0 rgba(30, 41, 59, 0.85), 4px 0 18px rgba(2, 6, 23, 0.35);
  will-change: width, flex-basis;
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1), flex-basis 380ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 360ms ease;
}
.studio-sidebar:hover,
.studio-sidebar:focus-within {
  width: 256px !important;
  flex-basis: 256px !important;
  box-shadow: inset -1px 0 0 rgba(59, 130, 246, 0.25), 14px 0 36px rgba(2, 6, 23, 0.72);
}
.studio-sidebar > * {
  min-width: 256px;
}
.studio-sidebar-label {
  opacity: 0;
  transform: translateX(-8px);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1), transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.studio-sidebar:hover .studio-sidebar-label,
.studio-sidebar:focus-within .studio-sidebar-label {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1) 70ms, transform 320ms cubic-bezier(0.22, 1, 0.36, 1) 45ms;
}
.studio-sidebar-mini-logo {
  transition: opacity 180ms ease, transform 240ms ease;
}
.studio-sidebar:hover .studio-sidebar-mini-logo,
.studio-sidebar:focus-within .studio-sidebar-mini-logo {
  opacity: 0;
  transform: scale(0.85);
}

/* Unified Toggle Switches (replacing plain browser checkboxes) */
.studio-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.studio-switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background-color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 1px 2px rgba(2, 6, 23, 0.45);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  flex-shrink: 0;
  cursor: pointer;
}
.studio-switch-track::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 9999px;
  background-color: #f8fafc;
  box-shadow: 0 1px 3px rgba(2, 6, 23, 0.55);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.studio-switch-track.sm {
  width: 1.85rem;
  height: 1.05rem;
}
.studio-switch-track.sm::after {
  width: 0.72rem;
  height: 0.72rem;
}
.studio-switch-input:checked + .studio-switch-track {
  background-color: #2563eb;
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.35);
}
.studio-switch-input:checked + .studio-switch-track::after {
  transform: translate(1rem, -50%);
}
.studio-switch-input:checked + .studio-switch-track.sm::after {
  transform: translate(0.78rem, -50%);
}
.studio-switch-input.is-danger:checked + .studio-switch-track {
  background-color: #dc2626;
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.35);
}
.studio-switch-input.is-emerald:checked + .studio-switch-track {
  background-color: #059669;
  border-color: rgba(52, 211, 153, 0.7);
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.3);
}
.studio-switch-input:disabled + .studio-switch-track {
  opacity: 0.45;
  cursor: not-allowed;
}
.studio-switch-input:focus-visible + .studio-switch-track {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .studio-sidebar:hover,
  .studio-sidebar:focus-within {
    width: min(256px, 82vw) !important;
    flex-basis: min(256px, 82vw) !important;
  }
  .studio-sidebar > * { min-width: min(256px, 82vw); }
}

.studio-section {
  min-width: 0;
}
.studio-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
  font-size: 0.72rem;
  line-height: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  list-style: none;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}
.studio-section-title:hover {
  border-color: rgba(59, 130, 246, 0.4);
  color: #f8fafc;
}
.studio-section-title::-webkit-details-marker { display: none; }
.studio-section-title::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #94a3b8;
  border-bottom: 1.5px solid #94a3b8;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 140ms ease;
  flex: none;
}
.studio-section:not([open]) .studio-section-title { margin-bottom: 0; }
.studio-section:not([open]) .studio-section-title::after {
  transform: rotate(-45deg) translateY(0);
}
.studio-section svg { flex: none; }

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0b1120;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Canvas checkerboard pattern for transparent backgrounds */
.canvas-checkerboard {
  background-color: #0b1120;
  background-image: 
    linear-gradient(45deg, #131c31 25%, transparent 25%), 
    linear-gradient(-45deg, #131c31 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #131c31 75%), 
    linear-gradient(-45deg, transparent 75%, #131c31 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Map custom container (Defense Express light minimalist palette) */
.maplibregl-map {
  background: #f5f7fa !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.tactical-map-node {
  position: absolute !important;
  top: 0;
  left: 0;
  overflow: visible !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
}

.tactical-map-node:active {
  cursor: grabbing;
}

/* Organic cartographic label integrated cleanly with marker (NO bulky white box) */
.tactical-organic-label {
  position: absolute;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  color: #133c55;
  background: transparent;
  border: none;
  padding: 0;
  width: max-content;
  white-space: nowrap;
  pointer-events: none;
  paint-order: stroke fill;
  -webkit-text-stroke: 3.5px rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

.tactical-organic-label.dir-right {
  left: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%);
}

.tactical-organic-label.dir-left {
  right: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%);
}

.tactical-organic-label.dir-top {
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
}

.tactical-organic-label.dir-bottom {
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
}

.tactical-label-hidden {
  display: none !important;
}

.tactical-svg-badge,
.tactical-pin-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(19, 60, 85, 0.36));
  transition: transform 0.15s ease, filter 0.15s ease;
}

.tactical-map-node.is-selected .tactical-svg-badge,
.tactical-map-node.is-selected .tactical-pin-badge {
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.95)) drop-shadow(0 3px 8px rgba(15, 23, 42, 0.45));
}

.tactical-circle-center-dot {
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 5px rgba(19, 60, 85, 0.5);
  transition: box-shadow 0.15s ease;
}

.tactical-map-node.is-selected .tactical-circle-center-dot {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.85), 0 1px 6px rgba(15, 23, 42, 0.55);
}

.tactical-arrow-handle.is-selected-handle,
.tactical-route-handle.is-selected-handle {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.85), 0 1px 6px rgba(15, 23, 42, 0.65);
}

.tactical-layer-drop-above {
  border-top: 2px solid #60a5fa !important;
}

.tactical-layer-drop-below {
  border-bottom: 2px solid #60a5fa !important;
}

.tactical-cross-overlay {
  position: absolute;
  top: 46.4%;
  left: 50%;
  width: 54%;
  height: 52%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
}

.tactical-pin-badge .tactical-cross-overlay {
  top: 46.4%;
  width: 54%;
  height: 52%;
}

.tactical-arrow-handle,
.tactical-route-handle {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 13px;
  height: 13px;
  border-radius: 9999px;
  border: 2.5px solid #ffffff;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.65);
  cursor: move;
  z-index: 25;
}

.tactical-arrow-handle.is-curve,
.tactical-route-handle.is-curve {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #f59e0b !important;
}

.tactical-photo-card {
  position: relative;
  background: transparent;
  user-select: none;
  cursor: grab;
  filter: drop-shadow(0 6px 16px rgba(15, 23, 42, 0.5));
}

.tactical-photo-card:active {
  cursor: grabbing;
}

.tactical-photo-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0f172a;
}

.tactical-photo-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none !important;
  object-fit: cover;
  pointer-events: none;
}

.tactical-photo-caption-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 38%;
  padding: 16px 9px 6px 9px;
  background: linear-gradient(to top, rgba(6, 9, 14, 0.84) 0%, rgba(6, 9, 14, 0.48) 58%, rgba(6, 9, 14, 0) 100%);
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

.tactical-photo-caption {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: #cbd5e1;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.88);
  pointer-events: none;
  word-break: break-word;
}

.tactical-photo-border-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 6;
}

/* Toggle transform handles via CSS class so DOM identity never breaks MapLibre dragging */
.tactical-map-node .studio-transform-ui {
  display: none;
}

.tactical-map-node.is-selected .studio-transform-ui {
  display: block;
}

/* Unified Photo-Editor Transform Frame & Handles for DOM overlays (Watermarks, Photo Callouts) */
.studio-transform-box {
  position: relative;
  display: inline-block;
  transform-origin: center center;
}

.studio-transform-outline {
  position: absolute;
  inset: -4px;
  border: 1.5px solid #3b82f6;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
  pointer-events: none;
  z-index: 40;
}

.studio-transform-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.45);
  z-index: 45;
  pointer-events: auto;
}

.studio-transform-corner.nw { top: -9px; left: -9px; cursor: nwse-resize; }
.studio-transform-corner.ne { top: -9px; right: -9px; cursor: nesw-resize; }
.studio-transform-corner.sw { bottom: -9px; left: -9px; cursor: nesw-resize; }
.studio-transform-corner.se { bottom: -9px; right: -9px; cursor: nwse-resize; }

.studio-transform-stem {
  position: absolute;
  top: -26px;
  left: 50%;
  width: 1.5px;
  height: 22px;
  margin-left: -0.75px;
  background: #3b82f6;
  pointer-events: none;
  z-index: 44;
}

.studio-transform-rot {
  position: absolute;
  top: -36px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 9999px;
  background: #ffffff;
  border: 2px solid #3b82f6;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  cursor: grab;
  z-index: 46;
  pointer-events: auto;
}

.studio-transform-rot:active { cursor: grabbing; }

.studio-angle-pill {
  position: absolute;
  top: -58px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px;
  border-radius: 9999px;
  border: 1px solid rgba(59, 130, 246, 0.5);
  white-space: nowrap;
  pointer-events: none;
  z-index: 47;
}

/* Range circle animation pulse */
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.02); opacity: 0.4; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Badge glow effects */
.glow-blue {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}
.glow-red {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

/* Custom range inputs */
input[type=range] {
  accent-color: #3b82f6;
}

/* Hide browser number spin arrows on compact px inputs */
.no-number-spinner::-webkit-outer-spin-button,
.no-number-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-number-spinner {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Subtle dark scrollbar for independent settings sidebar */
.studio-scroll::-webkit-scrollbar {
  width: 6px;
}
.studio-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.studio-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 9999px;
}
.studio-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

