/* css/style.css - Advanced Theming, Radar Hotspots, Accordions, and Admin UI */

:root {
  --primary-hex: #8ed5ff;
  --primary-rgb: 142, 213, 255;
  --primary-glow: rgba(142, 213, 255, 0.35);
  --primary-subtle: rgba(142, 213, 255, 0.12);
}

/* Light mode overrides */
html.light {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-low: #f1f5f9;
  --bg-surface-high: #e2e8f0;
  --bg-surface-highest: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: #cbd5e1;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(15, 23, 42, 0.08);
  --hero-overlay: linear-gradient(to bottom, rgba(248, 250, 252, 0.3) 0%, rgba(248, 250, 252, 0.95) 100%);
}

html.light body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html.light .bg-background {
  background-color: #f8fafc !important;
}

html.light .bg-surface-dim {
  background-color: #f1f5f9 !important;
}

html.light .bg-surface-container-lowest {
  background-color: #ffffff !important;
}

html.light .bg-surface-container-low {
  background-color: #f8fafc !important;
}

html.light .bg-surface-container {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

html.light .bg-surface-container-high {
  background-color: #f1f5f9 !important;
}

html.light .bg-surface-container-highest {
  background-color: #e2e8f0 !important;
}

html.light .text-white,
html.light .text-on-surface,
html.light .text-on-background {
  color: #0f172a !important;
}

html.light .text-on-surface-variant {
  color: #475569 !important;
}

html.light .border-outline-variant,
html.light .border-outline-variant\/20,
html.light .border-outline-variant\/30,
html.light .border-outline-variant\/50 {
  border-color: #e2e8f0 !important;
}

html.light .glass-panel {
  background: rgba(255, 255, 255, 0.88) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

html.light .hero-gradient-overlay {
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0.25) 0%, rgba(248, 250, 252, 0.95) 100%) !important;
}

/* Accent Color Dynamic Bindings */
.text-primary {
  color: var(--primary-hex) !important;
}

.border-primary {
  border-color: var(--primary-hex) !important;
}

.bg-primary {
  background-color: var(--primary-hex) !important;
}

.bg-primary\/10 {
  background-color: var(--primary-subtle) !important;
}

.bg-primary\/20 {
  background-color: var(--primary-glow) !important;
}

.bg-primary-container {
  background-color: var(--primary-hex) !important;
  color: #002233 !important;
}

.hover\:text-primary:hover {
  color: var(--primary-hex) !important;
}

.hover\:border-primary:hover {
  border-color: var(--primary-hex) !important;
}

/* Glass Panels */
.glass-panel {
  background: rgba(23, 31, 51, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-panel:hover {
  border-color: var(--primary-glow);
  box-shadow: 0 10px 30px -10px var(--primary-glow);
}

.hero-gradient-overlay {
  background: linear-gradient(to bottom, rgba(11, 19, 38, 0.2) 0%, rgba(11, 19, 38, 0.85) 100%);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(11, 19, 38, 0.5);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #39485a;
  border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hex);
}

.rim-light {
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

/* Radar Pulse Pins for Desk Hotspots (Matching Photo) */
.radar-pin {
  position: absolute;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 15;
  transform: translate(-50%, -50%);
}

.radar-dot {
  width: 14px;
  height: 14px;
  background-color: #ffffff;
  border: 2.5px solid var(--primary-hex);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--primary-hex), 0 0 24px rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 2;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background-color 0.25s ease;
}

.radar-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--primary-hex);
  animation: radar-pulse 2.2s infinite ease-out;
  opacity: 0.85;
}

.radar-ring:nth-child(2) {
  animation-delay: 0.75s;
}

@keyframes radar-pulse {
  0% {
    transform: scale(0.35);
    opacity: 1;
  }
  100% {
    transform: scale(2.3);
    opacity: 0;
  }
}

/* Interactive Rollover Zones directly over each object */
.interactive-zone {
  position: absolute;
  cursor: pointer;
  pointer-events: auto !important;
  z-index: 25;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.interactive-zone:hover,
.interactive-zone.active {
  background-color: rgba(var(--primary-rgb), 0.08);
  border: 1px dashed var(--primary-glow);
  box-shadow: inset 0 0 20px rgba(var(--primary-rgb), 0.1);
}

.interactive-zone:hover .radar-dot,
.interactive-zone.active .radar-dot {
  transform: scale(1.4);
  background-color: var(--primary-hex);
  border-color: #ffffff;
  box-shadow: 0 0 20px var(--primary-hex), 0 0 35px var(--primary-hex);
}

.interactive-zone:hover .radar-ring,
.interactive-zone.active .radar-ring {
  border-color: #ffffff;
}

/* Rollover Saying Card */
.rollover-saying {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s ease;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.75), 0 0 25px var(--primary-glow);
  border: 1px solid var(--primary-hex) !important;
  z-index: 50;
}

.interactive-zone:hover .rollover-saying,
.interactive-zone.active .rollover-saying {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1) !important;
}

/* Accordion Component Transitions */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease;
  opacity: 0;
}

.accordion-item.active .accordion-content {
  max-height: 600px;
  opacity: 1;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
  color: var(--primary-hex);
}

.accordion-item.active {
  background-color: rgba(45, 52, 73, 0.25);
  border-color: var(--primary-glow);
}

/* Toolbox Filtering Transition */
.toolbox-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbox-card.hidden-card {
  display: none;
  opacity: 0;
  transform: scale(0.92);
}

/* Floating Admin Bar */
#admin-floating-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--primary-glow);
  border-radius: 9999px;
  box-shadow: 0 10px 35px -5px rgba(0, 0, 0, 0.6), 0 0 15px var(--primary-glow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#admin-floating-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px -5px rgba(0, 0, 0, 0.7), 0 0 25px var(--primary-glow);
}

/* Inline Quick Edit Mode Highlighting */
body.inline-edit-mode [data-editable] {
  outline: 2px dashed rgba(var(--primary-rgb), 0.6) !important;
  outline-offset: 4px;
  position: relative;
  cursor: pointer !important;
  transition: outline-color 0.2s ease, background-color 0.2s ease;
}

body.inline-edit-mode [data-editable]:hover {
  outline-color: var(--primary-hex) !important;
  background-color: rgba(var(--primary-rgb), 0.12) !important;
}

body.inline-edit-mode [data-editable]::after {
  content: "edit";
  font-family: 'Material Symbols Outlined';
  position: absolute;
  top: -12px;
  right: -10px;
  background: var(--primary-hex);
  color: #002233;
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 30;
}

/* Modals */
.modal-overlay {
  background: rgba(11, 19, 38, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-dialog {
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modal-pop {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-in {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
