/* --- 1. Header Layout --- */
.modern-header {
  position: sticky;
  top: 0;
  z-index: 9000;
  width: 100%;
  padding: 20px 0;
  pointer-events: none; /* Let clicks pass through outside the bar */
}

.glass-container {
  pointer-events: auto;
  width: 100%;
  max-width: var(--max-width); /* 979px Alignment */
  height: 68px;
  margin: 0 auto;
  background: var(--panel-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  box-sizing: border-box; /* Ensures padding doesn't break layout */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* --- 2. Branding --- */
.brand-cluster { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.logo-orb {
  width: 36px; height: 36px;
  background: rgba(29, 205, 159, 0.1);
  border-radius: 50%;
  border: 1px solid rgba(29, 205, 159, 0.3);
  display: flex; justify-content: center; align-items: center;
}
.logo-orb img { width: 20px; height: 20px; }
.brand-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700; font-size: 18px; color: var(--text-main);
}

/* --- 3. Desktop Nav --- */
.nav-pills {
  display: flex; gap: 4px;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.pill-link {
  background: transparent; border: none;
  padding: 8px 24px; border-radius: 8px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.pill-link:hover { color: #fff; background: rgba(255,255,255,0.03); }
.pill-link.active {
  background: rgba(29, 205, 159, 0.15);
  color: var(--primary-accent);
  box-shadow: 0 0 10px rgba(29, 205, 159, 0.1);
}

/* --- 4. Right Controls --- */
.system-controls { display: flex; align-items: center; gap: 16px; }
.gas-indicator {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.3); padding: 8px 14px;
  border-radius: 20px; border: 1px solid rgba(255,255,255,0.05);
}
.indicator-dot { width: 6px; height: 6px; background: var(--primary-accent); border-radius: 50%; }
.gas-meta { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }
.gas-meta strong { color: var(--primary-accent); }

/* --- 5. Mobile Toggle (Hamburger) --- */
.modern-toggle {
  display: none; /* Hidden on Desktop */
  background: none; border: none; cursor: pointer;
  width: 30px; height: 30px; padding: 0;
  flex-direction: column; justify-content: center; gap: 6px;
}
.hamburger-line {
  width: 24px; height: 2px; background: #fff;
  transition: transform 0.3s, opacity 0.3s;
  margin: 0 auto;
}
/* Animation State */
.modern-toggle.active .top { transform: translateY(4px) rotate(45deg); }
.modern-toggle.active .bot { transform: translateY(-4px) rotate(-45deg); }

/* =========================================
   MOBILE DRAWER (Viewport Safe)
   ========================================= */
.modern-drawer {
  position: fixed;
  inset: 0; /* aligned to top, right, bottom, left: 0 */
  width: 100%;
  height: 100%;      /* Fallback for older browsers */
  height: 100dvh;    /* Dynamic Viewport Height (Fixes mobile address bar issues) */
  z-index: 2147483647; /* Max Z-Index to ensure it's on top of EVERYTHING */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden; /* Prevents double scrollbars */
}

.modern-drawer.open {
  pointer-events: auto;
  opacity: 1;
}

.drawer-backdrop {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  /* Fix for iOS Safari touch passthrough */
  -webkit-touch-callout: none; 
}

.drawer-panel {
  position: absolute;
  bottom: 0; 
  left: 0;
  width: 100%;
  max-height: 85vh; /* Prevents panel from being too tall */
  background: #0f1216;
  border-top: 2px solid var(--primary-accent);
  border-radius: 20px 20px 0 0;
  
  /* Padding handles iPhone Safe Area (Home Indicator) */
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  
  transform: translateY(100%); /* Start hidden below screen */
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  
  box-sizing: border-box; /* Ensures padding doesn't widen the element */
  overflow-y: auto; /* Allows scrolling inside menu if phone is in landscape */
}

.modern-drawer.open .drawer-panel {
  transform: translateY(0); /* Slide up to visible area */
}

/* Content Styles (No changes needed here, but ensuring they are safe) */
.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #fff; font-family: 'Rajdhani', sans-serif; font-weight: 700;
}
.close-btn { background: none; border: none; color: #666; font-size: 24px; padding: 10px; cursor: pointer; }

.drawer-links { display: flex; flex-direction: column; gap: 10px; }

.drawer-item {
  width: 100%; display: flex; justify-content: space-between;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
  padding: 16px; border-radius: 12px;
  color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 14px;
  cursor: pointer; box-sizing: border-box;
}.drawer-footer {
  margin-top: 20px; text-align: center; font-size: 10px; color: #666;
  display: flex; justify-content: center; align-items: center; gap: 8px;
}
.status-dot { width: 6px; height: 6px; background: var(--primary-accent); border-radius: 50%; box-shadow: 0 0 6px var(--primary-accent); }

/* --- 7. Responsive Media Query --- */
@media (max-width: 1024px) {
  .glass-container { width: 92%; }
}
@media (max-width: 768px) {
  .nav-pills { display: none; }
  .modern-toggle { display: flex; }
  .modern-header { padding: 10px 0; }
  .glass-container { height: 60px; padding: 0 16px; }
} 
