/* ==========================================================================
   ILYAS USEINOV — PORTFOLIO V26 (PERFECT HEADER ALIGNMENT & CACHE-BUSTING)
   Clean 3-Column Header Layout, Embedded Left Controls, Zero Cache Stagnation
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --panel-bg: rgba(15, 23, 42, 0.94);
  --panel-border: #1e293b;

  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-dim: #64748b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 14px;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* Fullscreen WebGL Canvas */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

/* Top Header Navigation */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  z-index: 120;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: #1e293b;
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Header Embedded Controls (Desktop) */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.key-hint-badge {
  background: #1e293b;
  border: 1px solid var(--panel-border);
  color: var(--text-sub);
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

.orbit-control-btn {
  background: #1e293b;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 5px 14px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 34px;
}

.orbit-control-btn:hover {
  border-color: var(--text-sub);
  background: #334155;
}

.satellites-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sat-nav-btn {
  background: #1e293b;
  border: 1px solid var(--panel-border);
  color: var(--text-sub);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 36px;
}

/* Color Indicators */
.sat-nav-btn.nav-earth::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  display: inline-block;
}

.sat-nav-btn.nav-hub1::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  display: inline-block;
}

.sat-nav-btn.nav-hub2::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  display: inline-block;
}

.sat-nav-btn.nav-hub3::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  display: inline-block;
}

.sat-nav-btn.nav-hub4::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-amber);
  display: inline-block;
}

.sat-nav-btn:hover, .sat-nav-btn.active {
  border-color: var(--text-sub);
  color: var(--text-main);
  background: #334155;
}

.header-tg-btn {
  flex-shrink: 0;
}

/* Global Overview Card */
.overview-card {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 840px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.overview-card.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 20px);
  pointer-events: none;
}

.overview-info {
  flex: 1;
}

.overview-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.overview-text {
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.45;
}

.overview-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Project Chips Dock */
.bottom-project-dock {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  padding: 6px 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  max-width: 92vw;
  overflow-x: auto;
  scrollbar-width: none;
}

.bottom-project-dock::-webkit-scrollbar {
  display: none;
}

.bottom-project-dock.active {
  opacity: 1;
  visibility: visible;
}

.dock-chip-btn {
  background: #1e293b;
  border: 1px solid var(--panel-border);
  color: var(--text-sub);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
  min-height: 36px;
}

.dock-chip-btn:hover, .dock-chip-btn.active {
  border-color: var(--text-sub);
  color: var(--text-main);
  background: #334155;
}

/* Satellite Drawer Panel */
.satellite-panel {
  position: fixed;
  top: 80px;
  right: 24px;
  width: 440px;
  max-height: calc(100vh - 120px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  z-index: 130;
  opacity: 0;
  visibility: hidden;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  overflow-y: auto;
}

.satellite-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sat-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-close {
  background: #1e293b;
  border: 1px solid var(--panel-border);
  color: var(--text-sub);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.panel-close:hover {
  color: var(--text-main);
  border-color: var(--text-sub);
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.35;
}

.panel-text {
  color: var(--text-sub);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 16px;
}

.panel-bullets {
  list-style: none;
  color: var(--text-sub);
  font-size: 0.86rem;
  margin-bottom: 18px;
}

.panel-bullets li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.panel-bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-sub);
  background: #1e293b;
  border: 1px solid var(--panel-border);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Common Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 40px;
}

.btn-primary {
  background: var(--text-main);
  color: #0b0f19;
}

.btn-primary:hover {
  background: #e5e7eb;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--panel-border);
}

.btn-outline:hover {
  border-color: var(--text-sub);
  background: rgba(255, 255, 255, 0.03);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #111827;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-family: var(--font-mono);
  z-index: 1000;
  display: none;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS
   ========================================================================== */
@media (max-width: 768px) {
  .top-header {
    height: auto;
    min-height: 54px;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left {
    gap: 8px;
  }

  .brand {
    font-size: 0.88rem;
  }

  .header-tg-btn {
    display: none;
  }

  /* 🌟 ABSOLUTELY HIDE CONTROL BUTTONS AND KEYBOARD HINT BADGE ON MOBILE DEVICES WITH !IMPORTANT */
  .header-controls,
  .key-hint-badge,
  .orbit-control-btn,
  #btn-reset-orbit,
  .bottom-controls-bar {
    display: none !important;
  }

  .satellites-nav {
    width: 100%;
    overflow-x: auto;
    padding: 4px 0 2px 0;
    gap: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .satellites-nav::-webkit-scrollbar {
    display: none;
  }

  .sat-nav-btn {
    scroll-snap-align: start;
    font-size: 0.74rem;
    padding: 6px 12px;
    min-height: 38px;
  }

  /* Mobile Bottom Sheet Drawer */
  .satellite-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding: 20px;
    transform: translateY(100%);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9);
  }

  .satellite-panel.active {
    transform: translateY(0);
  }

  .overview-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    bottom: 16px;
    width: calc(100% - 24px);
  }

  .overview-title {
    font-size: 1rem;
  }

  .overview-text {
    font-size: 0.78rem;
  }

  .overview-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 6px;
  }

  .overview-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 6px 10px;
    min-height: 38px;
  }

  .bottom-project-dock {
    top: 104px;
    max-width: 95vw;
    padding: 4px 10px;
  }

  .dock-chip-btn {
    min-height: 36px;
    font-size: 0.74rem;
    padding: 4px 12px;
  }
}
