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

/* ─── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #0a0a0f;
  color: #d1d5db;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0d0d14; }
::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a5a; }

/* ─── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 56px;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; padding: 0 20px; gap: 16px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 800; color: #fff;
}
.navbar-brand span { color: #f97316; }
.navbar-logo {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #f97316, #dc2626);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #fff;
}
.navbar-nav {
  display: flex; align-items: center; gap: 4px; flex: 1;
}
.navbar-nav a {
  padding: 5px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: #9ca3af;
  transition: all .15s; display: flex; align-items: center; gap: 5px;
}
.navbar-nav a:hover, .navbar-nav a.active {
  background: rgba(255,255,255,0.06); color: #fff;
}
.navbar-nav a.active { color: #f97316; }
.navbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.navbar-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; color: #9ca3af; }
.navbar-mobile { display: none; }

/* ─── Page layout ────────────────────────────────────────────────────────────── */
.page-content { padding-top: 56px; min-height: 100vh; }

/* ─── WinOLS Shell (Dashboard) ───────────────────────────────────────────────── */
.winols-shell {
  display: flex; flex-direction: column;
  height: calc(100vh - 56px);
  background: #0a0a0f;
  overflow: hidden;
}
.winols-menubar {
  background: #141420; border-bottom: 1px solid #1e1e2e;
  padding: 0 12px; height: 28px;
  display: flex; align-items: center; gap: 0;
  flex-shrink: 0;
}
.winols-menubar button {
  background: none; border: none; cursor: pointer;
  padding: 0 8px; height: 28px;
  font-size: 11px; color: #9ca3af;
  transition: background .1s;
}
.winols-menubar button:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ─── Dropdown Menus ─────────────────────────────────────────────────────────── */
.menu-item { position: relative; display: inline-block; }
.menu-item > button { height: 28px; }
.menu-dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: #1a1a2a; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; min-width: 180px; z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  padding: 4px 0; margin-top: 2px;
}
.menu-dropdown.open { display: block; }
.menu-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; font-size: 11px; color: #9ca3af;
  transition: background .1s; white-space: nowrap;
}
.menu-dropdown a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.menu-sep { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 0; }
.winols-toolbar {
  background: #111118; border-bottom: 1px solid #1a1a2a;
  padding: 4px 8px; display: flex; align-items: center; gap: 6px;
  flex-shrink: 0; flex-wrap: wrap;
}
.winols-statusbar {
  background: #0d0d18; border-top: 1px solid #1a1a2a;
  padding: 3px 12px; display: flex; align-items: center; gap: 16px;
  flex-shrink: 0; font-size: 10px; color: #6b7280;
}
.winols-statusbar .status-item { display: flex; align-items: center; gap: 4px; }
.winols-body {
  display: flex; flex: 1; overflow: hidden;
}
.winols-sidebar {
  width: 260px; background: #0e0e18; border-right: 1px solid #1a1a2a;
  display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
}
.winols-sidebar-header {
  background: #141420; border-bottom: 1px solid #1e1e2e;
  padding: 6px 12px; font-size: 10px; font-weight: 700;
  color: #6b7280; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: space-between;
}
.winols-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.winols-tabs {
  background: #0d0d18; border-bottom: 1px solid #1a1a2a;
  display: flex; padding: 0 8px; gap: 2px; flex-shrink: 0;
}
.winols-tab {
  padding: 5px 12px; font-size: 11px; color: #6b7280;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.winols-tab:hover { color: #d1d5db; }
.winols-tab.active { color: #f97316; border-bottom-color: #f97316; }
.winols-content { flex: 1; overflow: auto; }

/* ─── HEX Editor ─────────────────────────────────────────────────────────────── */
.hex-container { display: flex; flex-direction: column; height: calc(100vh - 56px); }
.hex-toolbar {
  background: #111118; border-bottom: 1px solid #1a1a2a;
  padding: 4px 8px; display: flex; align-items: center; gap: 6px;
  flex-shrink: 0; flex-wrap: wrap; min-height: 40px;
}
.hex-toolbar-sep { width: 1px; height: 20px; background: #2a2a3a; margin: 0 2px; }
.hex-toolbar-group { display: flex; align-items: center; gap: 4px; }
.hex-body { display: flex; flex: 1; overflow: hidden; }
.hex-sidebar {
  width: 200px; background: #0e0e18; border-right: 1px solid #1a1a2a;
  display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
}
.hex-sidebar-header {
  background: #141420; border-bottom: 1px solid #1e1e2e;
  padding: 6px 10px; font-size: 9px; font-weight: 700;
  color: #6b7280; letter-spacing: 1px;
}
.hex-main { flex: 1; overflow: auto; background: #080810; }
.hex-grid { padding: 8px; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.hex-row { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.hex-row:hover { background: rgba(255,255,255,0.02); }
.hex-addr { color: #4b5563; width: 80px; flex-shrink: 0; font-size: 10px; }
.hex-bytes { flex: 1; display: flex; flex-wrap: wrap; gap: 2px; }
.hex-byte {
  display: inline-block; width: 22px; text-align: center;
  cursor: pointer; padding: 1px 2px; border-radius: 2px;
  color: #9ca3af; transition: all .1s;
}
.hex-byte:hover { background: rgba(249,115,22,0.15); color: #fb923c; }
.hex-byte.selected { background: rgba(249,115,22,0.3); color: #fff; }
.hex-byte.modified { background: rgba(74,154,74,0.2); color: #4aff4a; }
.hex-byte.map-highlight-0 { background: rgba(74,154,74,0.22); color: #4aff4a; }
.hex-byte.map-highlight-1 { background: rgba(100,149,237,0.22); color: #6ab5ff; }
.hex-byte.map-highlight-2 { background: rgba(255,165,0,0.22); color: #ffcc44; }
.hex-byte.map-highlight-3 { background: rgba(220,80,80,0.22); color: #ff8888; }
.hex-ascii { color: #4b5563; font-size: 10px; width: 130px; flex-shrink: 0; letter-spacing: 1px; }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 16px;
}
.card-orange { border-color: rgba(249,115,22,0.3); background: rgba(249,115,22,0.05); }
.card-green  { border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.05); }
.card-blue   { border-color: rgba(96,165,250,0.3); background: rgba(96,165,250,0.05); }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-size: 12px;
  font-weight: 600; cursor: pointer; transition: all .15s;
  border: 1px solid transparent; white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-sm { padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-primary {
  background: linear-gradient(135deg, #f97316, #dc2626);
  color: #fff; border-color: transparent;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: #9ca3af;
  border-color: rgba(255,255,255,0.1);
}
.btn-outline:hover { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.2); }
.btn-green {
  background: rgba(74,222,128,0.15); color: #4ade80;
  border-color: rgba(74,222,128,0.3);
}
.btn-green:hover { background: rgba(74,222,128,0.25); }
.btn-danger {
  background: rgba(248,113,113,0.15); color: #f87171;
  border-color: rgba(248,113,113,0.3);
}
.btn-danger:hover { background: rgba(248,113,113,0.25); }
.btn-blue {
  background: rgba(96,165,250,0.15); color: #60a5fa;
  border-color: rgba(96,165,250,0.3);
}
.btn-blue:hover { background: rgba(96,165,250,0.25); }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
}
.badge svg { width: 10px; height: 10px; }
.badge-orange { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.badge-green  { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.badge-blue   { background: rgba(96,165,250,0.15); color: #60a5fa; border: 1px solid rgba(96,165,250,0.3); }
.badge-red    { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.badge-yellow { background: rgba(250,204,21,0.15); color: #facc15; border: 1px solid rgba(250,204,21,0.3); }
.badge-gray   { background: rgba(156,163,175,0.1); color: #9ca3af; border: 1px solid rgba(156,163,175,0.2); }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: #6b7280; margin-bottom: 5px; letter-spacing: .5px; text-transform: uppercase; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], select, textarea {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 8px 12px;
  color: #d1d5db; font-size: 13px;
  transition: border-color .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(249,115,22,0.5);
  background: rgba(255,255,255,0.06);
}
input::placeholder, textarea::placeholder { color: #4b5563; }
select option { background: #1a1a2a; color: #d1d5db; }
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; gap: 12px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ─── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  font-size: 13px; margin-bottom: 12px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.2); color: #4ade80; }
.alert-error   { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.2); color: #f87171; }
.alert-info    { background: rgba(96,165,250,0.1);  border: 1px solid rgba(96,165,250,0.2);  color: #60a5fa; }
.alert-warning { background: rgba(250,204,21,0.1);  border: 1px solid rgba(250,204,21,0.2);  color: #facc15; }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead tr { background: rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.07); }
th { padding: 8px 12px; text-align: left; font-size: 10px; font-weight: 700; color: #6b7280; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom: none; }

/* ─── Grid helpers ───────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }

/* ─── Container ──────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ─── Chat ───────────────────────────────────────────────────────────────────── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-bubble {
  max-width: 70%; padding: 8px 12px;
  border-radius: 12px; font-size: 13px; line-height: 1.5;
}
.chat-bubble-me {
  background: linear-gradient(135deg, rgba(249,115,22,0.2), rgba(220,38,38,0.2));
  border: 1px solid rgba(249,115,22,0.3); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-other {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); color: #d1d5db;
  border-bottom-left-radius: 4px;
}
.chat-input-bar {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.07);
  background: #0d0d18; flex-shrink: 0;
}
.chat-input {
  flex: 1; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 8px 12px;
  color: #d1d5db; font-size: 13px; resize: none;
  max-height: 120px; outline: none;
}
.chat-input:focus { border-color: rgba(249,115,22,0.4); }
.icon-btn {
  background: none; border: none; cursor: pointer;
  color: #6b7280; padding: 6px; border-radius: 6px;
  display: flex; align-items: center; transition: color .15s;
}
.icon-btn:hover { color: #d1d5db; background: rgba(255,255,255,0.06); }
.icon-btn svg { width: 16px; height: 16px; }

/* ─── Drop zone ──────────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 12px; padding: 40px 20px;
  text-align: center; cursor: pointer;
  transition: all .2s;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: rgba(249,115,22,0.5);
  background: rgba(249,115,22,0.05);
}
.drop-zone.has-file { border-color: rgba(74,222,128,0.5); background: rgba(74,222,128,0.05); }

/* ─── Toast ──────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  animation: slideIn .2s ease; min-width: 240px; max-width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast-success { background: #1a3a1a; border: 1px solid rgba(74,222,128,0.3); color: #4ade80; }
.toast-error   { background: #3a1a1a; border: 1px solid rgba(248,113,113,0.3); color: #f87171; }
.toast-info    { background: #1a2a3a; border: 1px solid rgba(96,165,250,0.3);  color: #60a5fa; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Landing page ───────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 56px);
  display: flex; align-items: center;
  background: radial-gradient(ellipse at 20% 50%, rgba(249,115,22,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(96,165,250,0.06) 0%, transparent 50%),
              #0a0a0f;
  padding: 60px 20px;
}
.hero-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(249,115,22,0.1); border: 1px solid rgba(249,115,22,0.2); color: #fb923c; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; margin-bottom: 20px; }
.hero-title { font-size: clamp(32px,5vw,56px); font-weight: 900; line-height: 1.1; color: #fff; margin-bottom: 16px; }
.hero-title span { background: linear-gradient(135deg, #f97316, #dc2626); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 15px; color: #9ca3af; line-height: 1.7; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-preview {
  background: #0d0d18; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.hero-preview-bar {
  background: #141420; border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 8px 12px; display: flex; align-items: center; gap: 6px;
}
.hero-preview-dot { width: 8px; height: 8px; border-radius: 50%; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 20px;
  transition: all .2s;
}
.feature-card:hover { border-color: rgba(249,115,22,0.2); background: rgba(249,115,22,0.03); transform: translateY(-2px); }
.feature-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.pricing-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 28px; position: relative;
}
.pricing-card.featured { border-color: rgba(249,115,22,0.3); background: rgba(249,115,22,0.05); }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .navbar-toggle { display: flex; }
  .navbar-mobile {
    display: none; position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
    background: rgba(10,10,15,0.98); backdrop-filter: blur(12px);
    z-index: 99; padding: 20px; flex-direction: column; gap: 4px;
    overflow-y: auto;
  }
  .navbar-mobile.open { display: flex; }
  .navbar-mobile a {
    padding: 12px 16px; border-radius: 10px;
    font-size: 14px; font-weight: 500; color: #9ca3af;
    display: flex; align-items: center; gap: 10px;
    transition: all .15s;
  }
  .navbar-mobile a:hover, .navbar-mobile a.active {
    background: rgba(255,255,255,0.06); color: #fff;
  }
  .navbar-mobile a.active { color: #f97316; }
  .hero-content { grid-template-columns: 1fr; gap: 32px; }
  .hero-preview { display: none; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .winols-sidebar { display: none; }
  .winols-sidebar.open { display: flex; position: fixed; top: 56px; left: 0; bottom: 0; z-index: 50; width: 280px; }
  .hex-sidebar { display: none; }
  .table-wrap { font-size: 11px; }
  th, td { padding: 6px 8px; }
  .container { padding: 0 12px; }
  .container-sm { padding: 0 12px; }
}
@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
