/* =========================================================
   SOP SYSTEM UI CORE — DESIGN SYSTEM v1
   Fix: alignment, inconsistency, active states, typography
========================================================= */

/* ===== ROOT DESIGN TOKENS ===== */
:root {
  /* colors */
  --bg: #0b1220;
  --panel: #111a2e;
  --panel-2: #0f172a;

  --primary: #1d4ed8;
  --primary-hover: #2563eb;

  --text: #e5e7eb;
  --muted: #94a3b8;

  --border: rgba(255,255,255,0.08);

  /* layout */
  --radius: 10px;
  --radius-lg: 14px;

  /* spacing system */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;

  /* typography */
  --font: Inter, system-ui, -apple-system, sans-serif;
}

/* ===== GLOBAL RESET ===== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* =========================================================
   BACKGROUND SYSTEM (video optional)
========================================================= */

.video-background {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  overflow: hidden;
}

.video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* dark overlay for readability */
.overlay {
  min-height: 100vh;
  background: rgba(0, 0, 0, 0.35);
}

/* =========================================================
   NAVBAR (FIXED SYSTEM)
   - alignment consistent
   - single style system
   - no mixed buttons
========================================================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: var(--space-3) var(--space-5);

  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(10px);

  border-bottom: 1px solid var(--border);
}

/* LEFT LOGO */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: 14px;
}

.logo img {
  height: 34px;
}

/* CENTER MENU (CRITICAL FIX) */
.menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex: 1;
}

/* UNIFIED NAV ITEMS (fix visual inconsistency) */
.menu a,
.drop-btn {
  all: unset;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 12px;
  border-radius: var(--radius);

  font-size: 13px;
  font-weight: 500;

  color: var(--muted);
  cursor: pointer;

  transition: 0.2s ease;
}

/* HOVER UNIFIED */
.menu a:hover,
.drop-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ACTIVE STATE (SYSTEM FIX) */
.menu a.active,
.drop-btn.active {
  background: var(--primary);
  color: white;
}

/* RIGHT SIDE USER AREA */
.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--muted);
}

/* =========================================================
   MOBILE MENU (CONSISTENT BEHAVIOR)
========================================================= */

.menu-toggle {
  display: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 900px) {

  .menu-toggle {
    display: block;
  }

  .menu {
    position: absolute;
    top: 60px;
    left: 0;

    width: 100%;
    flex-direction: column;

    background: rgba(10, 15, 28, 0.98);
    border-bottom: 1px solid var(--border);

    padding: var(--space-4);
    gap: var(--space-3);

    display: none;
  }

  .menu.show {
    display: flex;
  }

  .logo span {
    display: none;
  }
}

/* =========================================================
   DROPDOWN SYSTEM (FIXED CONSISTENCY)
========================================================= */

.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;

  top: 100%;
  left: 0;

  min-width: 220px;

  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);

  overflow: hidden;
  z-index: 99999;
}

.dropdown-content a {
  display: block;
  padding: 10px 12px;

  color: var(--muted);
  font-size: 13px;

  text-decoration: none;
  transition: 0.2s;
}

.dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.dropdown.open .dropdown-content {
  display: block;
}

/* MOBILE DROPDOWN FIX */
@media (max-width: 900px) {
  .dropdown-content {
    position: static;
    width: 100%;
    border-radius: 0;
  }
}

/* =========================================================
   UI COMPONENTS (SOP SYSTEM BASE)
========================================================= */

/* BUTTON SYSTEM (fix inconsistent buttons) */
button {
  font-family: var(--font);
  font-size: 13px;

  padding: 8px 12px;
  border-radius: var(--radius);

  border: 1px solid transparent;

  background: var(--primary);
  color: white;

  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  background: var(--primary-hover);
}

/* SECONDARY BUTTON */
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* =========================================================
   PANEL / LAYOUT SYSTEM
========================================================= */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);

  border-radius: var(--radius-lg);

  padding: var(--space-4);
  margin: var(--space-4);
}

/* SIMPLE GRID BASE (fix layout inconsistency) */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* RESPONSIVE GRID */
@media (max-width: 900px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   TYPOGRAPHY SYSTEM (fix mixed fonts feel)
========================================================= */

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}
