/* ═══════════════════════════════════════════════════════
   Systematronic — Dark Cyber Theme
   ═══════════════════════════════════════════════════════ */

:root {
  --bg: #050a18; --surface: #0a1628; --card: #0d1f3c; --border: #1a2d4d; --hover: #132240;
  --cyan: #00d4ff; --cyan-dim: rgba(0,212,255,0.15); --cyan-glow: rgba(0,212,255,0.25);
  --blue: #3b82f6; --brand: #f97316;
  --text: #e2e8f0; --text-dim: #94a3b8; --text-muted: #64748b;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  font-family: var(--font-body); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #67e8f9; }
img { max-width: 100%; display: block; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2a4060; }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.875rem;
  border: none; cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, #0891b2, #3b82f6); color: #fff;
}
.btn-primary:hover { box-shadow: 0 0 20px rgba(0,212,255,0.25); filter: brightness(1.1); }
.btn-outline {
  background: rgba(0,212,255,0.05); border: 1px solid rgba(0,212,255,0.3); color: #67e8f9;
}
.btn-outline:hover { background: rgba(0,212,255,0.12); border-color: rgba(0,212,255,0.5); }

/* ── Cards ── */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.5rem; transition: all 0.3s;
}
.card:hover { border-color: rgba(0,212,255,0.25); box-shadow: 0 0 20px rgba(0,212,255,0.06); }

/* ── Section ── */
.section { padding: 5rem 0; }
.section-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: #f0f9ff; margin-bottom: 0.75rem;
}
.section-subtitle { color: var(--text-dim); font-size: 1.1rem; max-width: 40rem; }

/* ── Header ── */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(5,10,24,0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); transition: all 0.3s;
}
#site-header.scrolled { background: rgba(5,10,24,0.95); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 4rem; max-width: 1200px; margin: 0 auto; padding: 0 1rem;
}
@media (min-width: 640px) { .header-inner { padding: 0 1.5rem; } }
.logo-link { display: flex; align-items: center; gap: 0.75rem; color: #fff; }
.logo-icon {
  width: 2.25rem; height: 2.25rem; border-radius: 0.6rem;
  background: linear-gradient(135deg, #0891b2, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 0.875rem; color: #fff;
}
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.logo-sub { font-size: 0.65rem; color: var(--text-dim); letter-spacing: 0.15em; text-transform: uppercase; }

/* Desktop nav */
.nav-desktop { display: none; align-items: center; gap: 0.25rem; }
@media (min-width: 1024px) { .nav-desktop { display: flex; } }
.nav-link {
  padding: 0.5rem 0.85rem; border-radius: 0.5rem; font-size: 0.85rem; font-weight: 500;
  color: var(--text-dim); transition: all 0.15s; cursor: pointer; background: none; border: none;
  font-family: var(--font-body);
}
.nav-link:hover { color: #fff; background: var(--hover); }
.nav-link.active { color: #fff; background: rgba(0,212,255,0.12); }

/* Products dropdown */
.nav-dropdown-wrap { position: relative; display: inline-flex; }
.nav-dropdown-wrap .nav-link svg { width: 12px; height: 12px; vertical-align: middle; margin-left: 2px; transition: transform 0.2s; }
.nav-dropdown-wrap:hover .nav-link svg { transform: rotate(180deg); }
.nav-product-dropdown {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 0.35rem; min-width: 17rem; max-height: 70vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem;
  padding: 0.35rem 0; box-shadow: 0 12px 36px rgba(0,0,0,0.5); z-index: 250;
}
.nav-product-dropdown.open { display: block; }
.nav-product-item {
  display: block; padding: 0.55rem 1rem; font-size: 0.82rem; color: var(--text-dim);
  text-decoration: none; transition: all 0.1s; white-space: nowrap; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left; font-family: var(--font-body);
}
.nav-product-item:hover { color: #fff; background: var(--hover); }
.nav-product-item.active { color: var(--cyan); font-weight: 600; }

/* Mobile sub-items */
.nav-mobile-sub { padding-left: 2rem !important; font-size: 0.8rem !important; opacity: 0.85; }

/* Language + mobile */
.header-right { display: flex; align-items: center; gap: 0.5rem; }
.lang-btn {
  display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.6rem;
  border-radius: 0.5rem; font-size: 0.75rem; font-weight: 600; color: var(--text-dim);
  background: none; border: none; cursor: pointer; transition: all 0.15s; font-family: var(--font-body);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.lang-btn:hover { color: #fff; background: var(--hover); }
.lang-dropdown {
  position: absolute; right: 0; top: 100%; margin-top: 0.5rem; width: 11rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem;
  padding: 0.35rem 0; box-shadow: 0 10px 30px rgba(0,0,0,0.4); display: none; z-index: 200;
}
.lang-dropdown.open { display: block; }
.lang-option {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem;
  font-size: 0.85rem; color: var(--text-dim); cursor: pointer; transition: all 0.1s;
  width: 100%; background: none; border: none; font-family: var(--font-body);
}
.lang-option:hover { color: #fff; background: var(--hover); }
.lang-option.active { color: var(--cyan); font-weight: 600; }

/* Mobile toggle */
.mobile-toggle {
  display: flex; padding: 0.5rem; border-radius: 0.5rem; background: none; border: none;
  color: var(--text-dim); cursor: pointer;
}
.mobile-toggle:hover { color: #fff; background: var(--hover); }
@media (min-width: 1024px) { .mobile-toggle { display: none; } }

.mobile-menu {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.mobile-menu.open { display: block; }
.mobile-menu .nav-link { display: block; width: 100%; text-align: left; padding: 0.75rem; }

/* ── Footer ── */
#site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: auto; }
.footer-grid { display: grid; gap: 2.5rem; padding: 3.5rem 0; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.2fr 0.8fr 1fr 1fr; } }
.footer-heading {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--text-muted); margin-bottom: 1.25rem;
}
.footer-link { display: block; color: var(--text-dim); font-size: 0.875rem; padding: 0.35rem 0; transition: color 0.15s; }
.footer-link:hover { color: #fff; }
.footer-contact li { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.875rem; color: var(--text-dim); padding: 0.35rem 0; }
.footer-contact svg { width: 1rem; height: 1rem; color: var(--brand); flex-shrink: 0; margin-top: 0.15rem; }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 1.25rem 0;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: 0.85rem; color: var(--text-muted);
}

/* ── Stats bar ── */
.stats-bar-wrapper {
  position: relative; overflow: hidden;
}
.stats-bar-wrapper::before {
  content: ''; position: absolute; inset: 0; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0z' fill='none'/%3E%3Cpath d='M0 0h1v40H0zM39 0h1v40h-1zM0 0v1h40V0zM0 39v1h40v-1z' fill='%2300d4ff' fill-opacity='1'/%3E%3C/svg%3E");
  pointer-events: none;
}
.stats-bar {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem;
  padding: 3rem 0 1.5rem; position: relative; z-index: 2;
}
@media (min-width: 768px) { .stats-bar { grid-template-columns: repeat(4, 1fr); } }
.stat-item { text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; color: var(--cyan); }
.stat-label { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.25rem; }

/* ── Heartbeat / Cardiogram ── */
.heartbeat-container {
  position: relative; z-index: 1; pointer-events: none;
  padding-bottom: 1rem;
}
.heartbeat-svg {
  width: 100%; height: 60px; display: block;
}

/* ── Grid layouts ── */
.grid-2 { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.grid-3 { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ── Hero section ── */
.hero {
  position: relative; padding: 8rem 0 4rem; overflow: hidden;
  background: linear-gradient(135deg, var(--bg) 0%, #0a1a35 50%, var(--bg) 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0z' fill='none'/%3E%3Cpath d='M0 0h1v40H0zM39 0h1v40h-1zM0 0v1h40V0zM0 39v1h40v-1z' fill='%2300d4ff' fill-opacity='1'/%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; }

/* ── Form ── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-dim); margin-bottom: 0.4rem; }
.form-input, .form-textarea {
  width: 100%; padding: 0.75rem 1rem; border-radius: 0.5rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: var(--font-body); font-size: 0.9rem; transition: all 0.15s;
}
.form-input:focus, .form-textarea:focus {
  outline: none; border-color: rgba(0,212,255,0.4); box-shadow: 0 0 0 3px rgba(0,212,255,0.08);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 8rem; resize: vertical; }

/* ── Chat widget ── */
#chat-toggle {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #3b82f6); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,212,255,0.25); transition: all 0.3s;
}
#chat-toggle:hover { transform: scale(1.05); box-shadow: 0 4px 30px rgba(0,212,255,0.4); }
#chat-toggle .pulse-ring {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(0,212,255,0.3);
  animation: chatPing 2s cubic-bezier(0,0,0.2,1) infinite;
}
@keyframes chatPing { 75%,100% { transform: scale(1.6); opacity: 0; } }

#chat-panel {
  display: none; position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  width: 380px; max-width: calc(100vw - 2rem); height: 560px; max-height: calc(100vh - 3rem);
  background: var(--surface); border: 1px solid rgba(0,212,255,0.15); border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); flex-direction: column; overflow: hidden;
}
#chat-panel.open { display: flex; }
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--surface), var(--card));
}
.chat-header-left { display: flex; align-items: center; gap: 0.75rem; }
.chat-avatar {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
}
.chat-status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 0.35rem; }
.chat-status-dot.online { background: #34d399; }
.chat-status-dot.offline { background: #f87171; }
.chat-status-dot.unknown { background: #fbbf24; }
.chat-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0.25rem; }
.chat-close:hover { color: var(--cyan); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.chat-empty { text-align: center; padding: 2rem 0; color: var(--text-muted); font-size: 0.875rem; }
.chat-msg { display: flex; gap: 0.5rem; max-width: 85%; }
.chat-msg.user { margin-left: auto; flex-direction: row-reverse; }
.chat-bubble {
  padding: 0.6rem 0.9rem; border-radius: 0.75rem; font-size: 0.85rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.assistant .chat-bubble { background: rgba(30,41,59,0.5); border: 1px solid var(--border); color: var(--text); }
.chat-msg.user .chat-bubble { background: rgba(0,212,255,0.12); border: 1px solid rgba(0,212,255,0.2); color: #cffafe; }
.chat-input-area {
  display: flex; align-items: flex-end; gap: 0.5rem;
  padding: 0.75rem; border-top: 1px solid var(--border); background: var(--bg);
}
#chat-input {
  flex: 1; padding: 0.6rem 0.85rem; border-radius: 0.75rem; border: 1px solid var(--border);
  background: rgba(30,41,59,0.5); color: var(--text); font-family: var(--font-body);
  font-size: 0.85rem; resize: none; max-height: 5rem;
}
#chat-input:focus { outline: none; border-color: rgba(0,212,255,0.3); }
#chat-send {
  width: 2.25rem; height: 2.25rem; border-radius: 0.75rem; border: 1px solid rgba(0,212,255,0.2);
  background: rgba(0,212,255,0.1); color: var(--cyan); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s;
}
#chat-send:hover { background: rgba(0,212,255,0.2); }
#chat-send:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Animations ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.fade-up { animation: fadeUp 0.6s ease-out forwards; }
.fade-in { animation: fadeIn 0.5s ease-out forwards; }

/* ── Utilities ── */
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.gap-6 { gap: 1.5rem; }
.hidden { display: none !important; }

/* Product card hover */
.product-card:hover { border-color: var(--cyan) !important; box-shadow: 0 0 20px rgba(0,212,255,0.12) !important; }

/* Product detail two-column layout on larger screens */
@media (min-width: 768px) {
  .detail-layout { grid-template-columns: 1fr 1fr !important; }
  .detail-features { columns: 2 !important; }
}
