/* HAT INNOVATIONS - Corporate Glassmorphism Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --brand-primary: #f59e0b;
  --brand-secondary: #fbbf24;
  --brand-accent: #d97706;
  --brand-primary-rgb: 245, 158, 11;
  --brand-glow: rgba(var(--brand-primary-rgb), 0.35);
  --hat-gold: var(--brand-primary);
  --hat-gold-glow: var(--brand-glow);
  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.05);
}

body {
  font-family: 'Anek Malayalam', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #05070B;
  background-image: 
    radial-gradient(1200px circle at 50% -20%, rgba(var(--brand-primary-rgb), 0.12), transparent 45%),
    radial-gradient(800px circle at 100% 60%, rgba(16, 185, 129, 0.04), transparent 40%),
    radial-gradient(600px circle at 0% 90%, rgba(var(--brand-primary-rgb), 0.03), transparent 35%);
  background-attachment: fixed;
  color: #f1f5f9;
}

code, pre {
  font-family: 'JetBrains Mono', monospace;
}

input, button, textarea, select {
  font-family: inherit;
}

/* Glassmorphism Surface Classes */
.glass-header {
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), inset 0 1px 0 0 var(--glass-highlight);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(var(--brand-primary-rgb), 0.3);
  box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.8), inset 0 1px 0 0 rgba(var(--brand-primary-rgb), 0.15);
}

.glass-dock {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
}

.glass-input {
  background: rgba(8, 12, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: #f1f5f9;
  transition: all 0.2s ease;
}

.glass-input:focus {
  border-color: var(--brand-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.18), 0 10px 20px -10px rgba(0,0,0,0.5);
}

.glass-pill {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

/* Tab Navigation */
.tab-btn {
  color: #94a3b8;
  background-color: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #05070B;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  font-weight: 700;
  box-shadow: 0 4px 18px 0 var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Glass Buttons */
.btn-gold {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  color: #05070B;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px 0 var(--brand-glow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px 0 var(--brand-glow);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Chat Inbox Glassmorphism */
.chat-conversation-item {
  border-radius: 0.875rem;
  margin: 0.25rem 0.5rem;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.chat-conversation-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.chat-conversation-item.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.glass-bubble-out {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(217, 119, 6, 0.28) 100%);
  border: 1px solid rgba(245, 158, 11, 0.38);
  backdrop-filter: blur(10px);
  color: #fef3c7;
}

.glass-bubble-in {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  color: #f1f5f9;
}

/* Glow Utilities */
.glow-amber {
  box-shadow: 0 0 25px -4px var(--hat-gold-glow);
}

.glow-emerald {
  box-shadow: 0 0 20px -4px rgba(16, 185, 129, 0.4);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(5, 7, 11, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.4);
}

/* Toggle Switch */
.toggle-checkbox:checked {
  right: 0;
  border-color: var(--hat-gold);
}
.toggle-checkbox:checked + .toggle-label {
  background-color: var(--hat-gold);
}

/* ====================================================
   DRAG-AND-DROP CANVAS WORKFLOW STUDIO STYLES
   ==================================================== */
#canvasGridOverlay {
  background-color: #05070b;
  background-image: radial-gradient(rgba(245, 158, 11, 0.2) 1.2px, transparent 1.2px);
  background-size: 28px 28px;
}

#canvasViewport {
  user-select: none;
  -webkit-user-select: none;
}

#canvasTransformLayer {
  will-change: transform;
  transform-origin: 0 0;
}

.canvas-node {
  position: absolute;
  width: 300px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 1.25rem;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.canvas-node.is-selected {
  border-color: var(--hat-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3), 0 25px 45px -10px rgba(0, 0, 0, 0.9);
}

.canvas-node.is-dragging {
  opacity: 0.92;
  transform: scale(1.02);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.95);
  border-color: #38bdf8;
  z-index: 1000 !important;
}

.canvas-node-header {
  cursor: grab;
  padding: 0.875rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 1.25rem;
  border-top-right-radius: 1.25rem;
}

.canvas-node-header:active {
  cursor: grabbing;
}

.canvas-node-body {
  padding: 1rem 1.1rem;
}

.canvas-port {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background-color: #0f172a;
  border: 2.5px solid #94a3b8;
  cursor: crosshair;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 30;
}

.canvas-port:hover {
  transform: scale(1.4);
  background-color: var(--hat-gold);
  border-color: #ffffff;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.9);
}

.canvas-port-input {
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
}
.canvas-port-input:hover {
  transform: translateY(-50%) scale(1.4);
}

.canvas-port-output {
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
}
.canvas-port-output:hover {
  transform: translateY(-50%) scale(1.4);
}

/* Canvas Connection Wires & Interactive Stroke */
.connection-wire-group {
  pointer-events: all !important;
  cursor: pointer;
}

.canvas-connection-line {
  stroke: #10b981;
  stroke-width: 2.5;
  fill: none;
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.connection-wire-group:hover .canvas-connection-line {
  stroke: #f43f5e !important;
  stroke-width: 3.5 !important;
}

.connection-wire-group:hover path {
  filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.8));
}

#svgTempWire {
  stroke: #f59e0b;
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
  fill: none;
  pointer-events: none;
}

/* ==========================================================================
   ENTERPRISE SAAS SIDEBAR & MODERN NAVIGATION FACELIFT
   ========================================================================== */

.app-sidebar {
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 4px 0 24px -4px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}
.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.3);
}

.sidebar-group-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.85rem 0.75rem 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.sidebar-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-align: left;
}

.sidebar-nav-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.sidebar-nav-btn.active {
  color: #fef08a;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.06) 100%);
  border-color: rgba(245, 158, 11, 0.35);
  font-weight: 600;
  box-shadow: 0 4px 16px -2px rgba(245, 158, 11, 0.15), inset 0 0 12px rgba(245, 158, 11, 0.05);
}

.sidebar-nav-btn.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 20%;
  bottom: 20%;
  width: 3.5px;
  border-radius: 4px;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.sidebar-nav-btn .nav-icon {
  width: 1.125rem;
  height: 1.125rem;
  color: #64748b;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-nav-btn:hover .nav-icon {
  color: #f59e0b;
}

.sidebar-nav-btn.active .nav-icon {
  color: #f59e0b;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}

/* Mobile Bottom Navigation Dock */
.mobile-bottom-dock {
  background: rgba(9, 13, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 24px -4px rgba(0, 0, 0, 0.6);
}

.mobile-dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.5rem;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}

.mobile-dock-btn.active {
  color: #f59e0b;
  font-weight: 700;
}

.mobile-dock-btn.active .dock-icon-box {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

/* ==========================================================================
   LIGHT MODE & ADAPTIVE THEME SYSTEM
   ========================================================================== */

html.light {
  --hat-gold: #d97706;
  --hat-gold-glow: rgba(217, 119, 6, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(226, 232, 240, 0.9);
  --glass-highlight: rgba(0, 0, 0, 0.02);
}

html.light body {
  background-color: #f8fafc !important;
  background-image: 
    radial-gradient(1200px circle at 50% -20%, rgba(245, 158, 11, 0.08), transparent 45%),
    radial-gradient(800px circle at 100% 60%, rgba(16, 185, 129, 0.03), transparent 40%) !important;
  color: #0f172a !important;
}

html.light .app-sidebar {
  background: rgba(255, 255, 255, 0.96) !important;
  border-right-color: #e2e8f0 !important;
  box-shadow: 4px 0 24px -4px rgba(0, 0, 0, 0.06) !important;
}

html.light header {
  background: rgba(255, 255, 255, 0.88) !important;
  border-bottom-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html.light .glass-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02) !important;
  color: #0f172a !important;
}

html.light .glass-card:hover {
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.08) !important;
}

html.light .sidebar-group-title {
  color: #94a3b8 !important;
}

html.light .sidebar-nav-btn {
  color: #64748b !important;
}

html.light .sidebar-nav-btn:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html.light .sidebar-nav-btn.active {
  color: #b45309 !important;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.8) 0%, rgba(253, 230, 138, 0.4) 100%) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 4px 14px -2px rgba(245, 158, 11, 0.2) !important;
}

html.light .glass-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.light .glass-input:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

html.light .mobile-bottom-dock {
  background: rgba(255, 255, 255, 0.96) !important;
  border-top-color: #e2e8f0 !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06) !important;
}

html.light .mobile-dock-btn {
  color: #64748b !important;
}

html.light .mobile-dock-btn.active {
  color: #d97706 !important;
}

/* Polished Minimalist Sidebar Footer Cards */
.sidebar-status-strip {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-status-strip:hover {
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

/* Dashboard KPI Card Micro-Glow */
.kpi-card {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.kpi-card:hover {
  transform: translateY(-2px);
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(var(--brand-primary-rgb), 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* White-Label Theme Swatches & Dynamic Studio Controls */
.theme-swatch {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-swatch:hover {
  transform: scale(1.05);
}
.theme-swatch.active-swatch {
  box-shadow: 0 0 0 2px #ffffff, 0 0 16px var(--brand-glow) !important;
}
.brand-text {
  color: var(--brand-primary) !important;
}
.brand-bg {
  background-color: var(--brand-primary) !important;
}
.brand-border {
  border-color: var(--brand-primary) !important;
}


