/* ═══════════════════════════════════════════════════════════
   fesio.pro — V4.1 Ultra-Premium Interface
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg-color: #010103;
  --primary: #10b981;
  --secondary: #06b6d4;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --glass-bg: rgba(8, 8, 12, 0.45);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glass-blur: blur(24px) saturate(180%);
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow: hidden; /* Fully controlled app experience */
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ═════ BACKGROUND ═════ */
.cyber-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(16, 185, 129, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 185, 129, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.glow-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw; height: 80vw;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

/* ═════ HEADER & TYPOGRAPHY ═════ */
.header {
  position: relative;
  z-index: 10;
  padding: 1.8rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0; /* GSAP */
}

/* New Ultra-Premium Typography */
.logo {
  display: flex;
  align-items: baseline;
  user-select: none;
}
.logo-text {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: #fff;
}
.logo-accent {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--primary);
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.5); /* Glowing neon without ugly drop shadow */
}

.header-tagline { 
  font-family: var(--font-mono); 
  font-size: 0.65rem; 
  letter-spacing: 0.25em; 
  color: var(--text-muted); 
  text-transform: uppercase; 
}

/* ═════ MAIN 3D ═════ */
.main-viewport {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.sphere-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#neural-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: auto; /* Required for mouse tracking raycast */
}

/* ═════ RADIAL NODES ═════ */
.nodes-wrapper {
  position: absolute;
  top: 50%; left: 50%;
  width: 800px; height: 600px;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

.node-wrapper {
  position: absolute;
  pointer-events: auto;
  opacity: 0; /* GSAP */
}

.node-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
}

.node-btn:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
  color: #fff;
}

.node-icon {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--primary);
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.3s;
}

.node-btn:hover .node-icon {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  color: #fff;
}

.node-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
}

.node-label small {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.02em;
}

/* ═════ MODALS ═════ */
.modal-overlay {
  position: fixed; inset: 0;
  background-color: rgba(1, 1, 3, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-panel {
  background: rgba(10, 10, 15, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255,255,255,0.02);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 16px;
  width: 100%; max-width: 760px;
  position: relative;
  opacity: 0; transform: translateY(20px) scale(0.98);
  display: none;
}

.modal-overlay.active .modal-panel.active {
  display: block;
  animation: modalEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalEnter { to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-close {
  position: absolute; top: 1.5rem; right: 1.8rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 2rem; cursor: pointer; transition: color 0.2s;
}
.modal-close:hover { color: #fff; }

.modal-content { padding: 3rem; max-height: 85vh; display: flex; flex-direction: column; }
.modal-tag { font-family: var(--font-mono); font-size: 0.65rem; color: var(--primary); letter-spacing: 0.2em; margin-bottom: 1rem; }
.modal-content h2 { font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: 2rem; letter-spacing: -0.04em; }

.scrollable-content { overflow-y: auto; padding-right: 1rem; }
.scrollable-content::-webkit-scrollbar { width: 4px; }
.scrollable-content::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.scrollable-content::-webkit-scrollbar-thumb { background: rgba(16,185,129,0.3); border-radius: 2px; }

.case-card {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px; margin-bottom: 1.2rem;
  transition: all 0.3s;
}
.case-card.highlight-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(10, 10, 15, 0) 100%);
  border-color: rgba(16, 185, 129, 0.2);
}
.case-card:hover { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); }
.case-card.highlight-card:hover { border-color: var(--primary); box-shadow: 0 0 30px rgba(16,185,129,0.1); }

.case-card h3 { font-size: 1.1rem; color: #fff; margin-bottom: 0.5rem; font-weight: 600; }
.case-meta { font-family: var(--font-mono); font-size: 0.65rem; color: var(--secondary); margin-bottom: 0.8rem; text-transform: uppercase; }
.case-card p { font-size: 0.85rem; line-height: 1.7; color: var(--text-muted); }

/* Floating Chatbot Widget (Minimalist Premium) */
.chat-widget {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.chat-tooltip {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  font-family: var(--font-main);
  margin-bottom: 1rem;
  line-height: 1.4;
  text-align: right;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(-10px);
  animation: fadeInDown 0.6s ease forwards 1s;
}
.chat-tooltip strong {
  color: var(--color-accent);
}
@keyframes fadeInDown {
  to { opacity: 1; transform: translateY(0); }
}
.chat-toggle {
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  padding: 1rem;
  border-radius: 50%;
  color: var(--color-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.chat-toggle:hover {
  background: rgba(10, 10, 15, 0.8);
  border-color: rgba(118,185,0,0.3);
  box-shadow: 0 0 25px rgba(118,185,0,0.2);
  transform: scale(1.05);
}

.chat-panel {
  position: absolute; top: 0; right: 0;
  width: 380px; height: 520px;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.8);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-10px) scale(0.96);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }

.chat-panel-header { padding: 1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; }
.chat-panel-title { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 0.6rem; }
.status-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.chat-panel-close { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

.chat-messages { flex: 1; padding: 1.2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; font-family: var(--font-mono); }
.msg-bubble { padding: 0.8rem 1rem; border-radius: 8px; font-size: 0.75rem; line-height: 1.5; }
.msg.bot { align-self: flex-start; max-width: 85%; }
.msg.bot .msg-bubble { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); color: #e2e8f0; }
.msg.user { align-self: flex-end; max-width: 85%; }
.msg.user .msg-bubble { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: #fff; }
.msg-sender { font-size: 0.6rem; color: var(--primary); margin-bottom: 0.3rem; opacity: 0.8; }

.chat-input-area { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; gap: 0.8rem; }
#chat-input { flex: 1; background: transparent; border: none; color: #fff; font-family: var(--font-mono); font-size: 0.8rem; outline: none; }
.chat-send-btn { background: transparent; border: none; color: var(--primary); cursor: pointer; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; }

/* ═════ FOOTER MARQUEE (Seamless) ═════ */
.footer {
  position: absolute; bottom: 0; width: 100%;
  padding: 1.2rem 0; z-index: 10;
  border-top: 1px solid rgba(255,255,255,0.03);
  background: rgba(1, 1, 3, 0.8);
  opacity: 0; /* GSAP */
}
.footer-title { text-align: center; font-family: var(--font-mono); font-size: 0.55rem; letter-spacing: 0.3em; color: rgba(255,255,255,0.4); margin-bottom: 0.8rem; }

.marquee-wrapper { 
  display: flex; overflow: hidden; width: 100%; 
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-content { 
  display: flex; gap: 4rem; 
  padding: 0 2rem;
  /* Speed will be assigned in JS if dynamic, or fixed here */
  animation: marquee 25s linear infinite; 
}
.marquee-content:hover { animation-play-state: paused; }

.marquee-item { 
  font-family: var(--font-mono); 
  font-size: 0.8rem; 
  font-weight: 700; 
  color: rgba(255,255,255,0.6); 
  text-transform: uppercase; 
  white-space: nowrap; 
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  transition: color 0.3s, text-shadow 0.3s;
  cursor: default;
}
.badge-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: transform 0.3s, filter 0.3s;
}
.badge-icon {
  flex-shrink: 0;
  transition: transform 0.3s, filter 0.3s;
}
.marquee-item:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}
.marquee-item:hover .badge-img,
.marquee-item:hover .badge-icon {
  transform: scale(1.1);
}

@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

@media (max-width: 768px) {
  .nodes-wrapper { width: 100%; height: 80%; transform: translate(-50%, -40%); }
  #wrap-audit { top: 10% !important; left: 5% !important; }
  #wrap-defense { top: 25% !important; right: 5% !important; }
  #wrap-b2b { bottom: 30% !important; left: 5% !important; }
  #wrap-training { bottom: 15% !important; right: 5% !important; }
  .chat-widget { top: auto; bottom: 5rem; right: 1rem; }
  .chat-toggle-label { display: none; }
}
