/* ============================================================
   LAYOUT - Portal Dashboard
   ============================================================ */

.portal-page {
  width: 100%;
  padding: 4px 18px 0;
}

.utility-bar {
  max-width: 1760px; /* Match dashboard-shell */
  margin: 0 auto 2px;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* Flexible outer columns to keep center centered */
  gap: 20px;
  align-items: center;
}

.logo-container {
  justify-self: end;
  display: flex;
  align-items: center;
  padding-right: 23px; /* As requested */
}
.mobile-brand { display: none; }

.utility-logo {
  height: 60px; /* Increased size for prestige */
  display: block;
  transition: transform 0.2s;
}

.utility-logo:hover {
  transform: scale(1.05);
}

.utility-logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  line-height: 1.1;
}

.mobile-brand .utility-logo-text,
.mobile-brand-text {
  font-size: 18px;
}

.utility-icon {
  border: 0;
  background: rgba(255,255,255,0.28);
  backdrop-filter: blur(10px);
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(40, 53, 73, 0.08);
  cursor: pointer;
}

.ev-bike-icon,
.ev-charger-icon {
  position: relative;
}

.ev-bike-icon span,
.ev-charger-icon span {
  position: absolute;
  display: block;
}

.ev-bike-icon .bike-wheel {
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  bottom: 12px;
}

.ev-bike-icon .wheel-front {
  left: 30px;
}

.ev-bike-icon .wheel-back {
  left: 11px;
}

.ev-bike-icon .bike-frame {
  left: 18px;
  bottom: 19px;
  width: 17px;
  height: 2px;
  background: #ffffff;
  transform: rotate(-20deg);
  transform-origin: left center;
}

.ev-bike-icon .bike-seat {
  left: 18px;
  bottom: 25px;
  width: 9px;
  height: 2px;
  background: #ffffff;
  border-radius: 999px;
  transform: rotate(-18deg);
}

.ev-bike-icon .bike-handle {
  left: 31px;
  bottom: 24px;
  width: 8px;
  height: 2px;
  background: #ffffff;
  border-radius: 999px;
  transform: rotate(28deg);
}

.search-shell {
  min-height: 52px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #C7C7C7; /* Slim grey border */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 0 20px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  width: 100%;
  min-width: 0;
}

.search-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 720px; /* Slightly narrower search */
  margin: 0 auto;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #1f2937;
  font-size: 18px;
  font-weight: 500;
}

.search-input::placeholder {
  color: #7b8592;
}

.search-icon {
  width: 24px;
  height: 24px;
  border: 3px solid #6b7280;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 10px;
  height: 3px;
  background: #6b7280;
  transform: rotate(45deg);
  border-radius: 3px;
}

.search-copy {
  color: #7b8592;
  font-size: 18px;
  font-weight: 500;
  flex: 1;
}

.search-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-chip {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #22c55e 50%, #f59e0b 100%);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,0.45);
}

.search-action {
  border: 1px solid #C7C7C7; /* Slim grey border */
  background: transparent;
  color: var(--menu-text-color, #2f3b4a);
  height: 36px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14px;
  font-family: var(--menu-font-family, 'Assistant', sans-serif);
  font-weight: 400; 
  cursor: pointer;
  transition: all 0.2s;
}

.search-action:hover {
  background: rgba(0, 0, 0, 0.03);
  transform: translateY(-1px);
}

.utility-status {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #000000; /* Set to black to visible on white */
  font-weight: 400; /* Sleek weight */
}

.utility-reset {
  border: 1px solid #C7C7C7; /* Slim grey border */
  background: transparent;
  color: var(--menu-text-color, #2f3b4a);
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--menu-font-family, 'Assistant', sans-serif);
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.utility-reset:hover {
  background: rgba(0, 0, 0, 0.03);
  transform: translateY(-1px);
}

.status-city,
.status-temp {
  font-size: 18px;
}

.status-sun {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb800 0%, #ff8a00 100%);
  box-shadow: 0 0 0 7px rgba(255, 200, 0, 0.12);
}

.ev-charger-icon .charger-body {
  left: 16px;
  top: 12px;
  width: 18px;
  height: 28px;
  border: 2px solid #ffffff;
  border-radius: 8px;
}

.ev-charger-icon .charger-bolt {
  left: 23px;
  top: 19px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 3px solid transparent;
  border-top: 9px solid #ffffff;
  transform: skewX(-12deg);
}

.ev-charger-icon .charger-cable {
  right: 12px;
  top: 18px;
  width: 11px;
  height: 18px;
  border: 2px solid #ffffff;
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

.ev-charger-icon .charger-tip {
  right: 10px;
  top: 16px;
  width: 4px;
  height: 7px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 0 #ffffff;
}

.dashboard-shell {
  max-width: 1760px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

header {
  background: var(--header-bg);
  color: var(--text);
  padding: 0 0 0 24px; /* Removed right padding to align with border */
  display: grid;
  /* nav-tabs | right-group | hamburger */
  grid-template-columns: 1fr auto minmax(60px, auto);
  align-items: center;
  min-height: 52px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

.header-spacer {
  display: none;
}

.nav-tabs {
  grid-column: 1;
  display: flex;
  height: 100%;
  align-items: center;
  overflow: hidden;         /* tabs never overflow — More button handles extras */
  scrollbar-width: none;
  gap: 6px;
  min-width: 0;
  padding-left: 100px;
}

.header-right-group {
  grid-column: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}


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

/* ── More Button ─────────────────────────────────────────── */
.more-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border2, #e2e8f0);
  background: var(--surface, #fff);
  color: var(--text2, #475569);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 4px;
}
.more-btn:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: var(--espn-blue, #2563eb);
  color: var(--espn-blue, #2563eb);
}
.more-btn.active {
  background: var(--menu-active-bg, #2563eb);
  color: var(--menu-active-text-color, #fff);
  border-color: var(--menu-active-bg, #2563eb);
}

/* ── More Dropdown Panel ─────────────────────────────────── */
.more-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 1100;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: none;
  flex-direction: column;
  padding: 6px 0;
}
.more-dropdown.open {
  display: flex;
}
.more-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #0f172a);
  cursor: pointer;
  border-bottom: 1px solid var(--border, #e2e8f0);
  transition: background 0.15s;
}
.more-dropdown-item:last-child {
  border-bottom: none;
}
.more-dropdown-item:hover {
  background: rgba(37, 99, 235, 0.05);
  color: var(--espn-blue, #2563eb);
}
.more-dropdown-item.active {
  background: var(--menu-active-bg, #2563eb);
  color: var(--menu-active-text-color, #fff);
}
.more-dropdown-item.active .more-dropdown-arrow {
  color: rgba(255,255,255,0.8);
}
.more-dropdown-emoji {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.more-dropdown-label {
  flex: 1;
}
.more-dropdown-arrow {
  color: var(--text-3, #94a3b8);
  font-size: 18px;
  font-weight: bold;
}

.tab {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  font-family: var(--menu-font-family);
  font-weight: var(--menu-font-weight);
  color: var(--menu-text-color);
  cursor: pointer;
  white-space: nowrap;  /* tabs never wrap — nav scrolls horizontally */
  transition: 0.2s;
  border: 1px solid transparent;
  border-radius: 14px;
  flex: 0 0 auto;       /* tabs never shrink — they scroll instead */
}

/* tabs-condensed/tight/micro/nano classes removed — fitPortalTabs is gone */

.tab:hover {
  color: var(--text);
  background: rgba(37, 99, 235, 0.05);
}

.tab.active {
  color: var(--menu-active-text-color);
  border-color: var(--menu-active-border-color);
  background: var(--menu-active-bg);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.tab-skeleton {
  width: 86px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf1f6 0%, #f7f9fb 50%, #edf1f6 100%);
  background-size: 200% 100%;
  animation: skeletonShift 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

#clockDisplay {
  font-size: 13px;
  color: var(--text2);
  font-weight: 600;
  white-space: nowrap;
}

.dark-toggle {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
}

.hamburger div {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.mobile-menu {
  position: fixed;
  top: 82px;
  right: 16px;
  width: 280px;
  max-height: calc(100vh - 98px);
  background: rgba(255,255,255,0.96);
  z-index: 1000;
  display: none;
  flex-direction: column;
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(40, 53, 73, 0.18);
  overflow-y: auto;
  padding: 10px 0;
  border: 1px solid var(--border2);
}

.mobile-menu.active { display: flex; }

.mobile-tab {
  color: var(--menu-active-text-color);
  font-size: 15px;
  font-family: var(--menu-font-family);
  font-weight: var(--menu-font-weight);
  padding: 14px 20px;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  text-align: left;
  width: 100%;
}

.mobile-tab:hover { background: var(--surface2); }
.mobile-tab.active { background: var(--menu-active-bg); }

.layout-box { flex: 1; width: 100%; }

.layout {
  display: block;
  max-width: 1720px;
  margin: 0 auto;
  padding: 20px 20px 28px;
}

.main-pane { min-width: 0; }

.section-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-left: 14px;
  border-left: 5px solid var(--espn-blue);
}

#output {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.loading-copy {
  padding: 4px 0 6px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
}

.portal-row {
  display: grid;
  grid-template-columns: 1.75fr 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.portal-row.reverse {
  grid-template-columns: 1fr 1fr 1.75fr;
}

.portal-row.four-col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

footer {
  padding: 16px 24px;
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  text-align: center;
}

.disclaimer {
  font-size: 11px;
  color: var(--footer-text);
  font-weight: 600;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.45;
}

#backToTop {
  position: fixed;
  bottom: 26px;
  right: 18px;
  width: 40px;
  height: 40px;
  background: var(--header-bg);
  color: white;
  border: none;
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(37,99,235,0.2);
}

.float-menu { display: none; }

@media (max-width: 1320px) {
  .utility-bar { grid-template-columns: 56px minmax(260px, 1fr) auto; }
  .utility-reset { order: 4; }
  .utility-status { grid-column: 1 / -1; justify-content: flex-end; }
  .portal-row,
  .portal-row.reverse {
    grid-template-columns: 1.45fr 1fr 1fr;
  }
  .portal-row.four-col {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .header-actions,
  #clockDisplay,
  .nav-tabs { display: none; }
  .hamburger { display: flex; }
  .header-spacer { display: none; }
  header { justify-content: space-between; padding: 0 16px; min-height: 56px; }
  .layout { padding: 18px 14px 24px; }
  #output { gap: 14px; }
  .portal-row,
  .portal-row.reverse,
  .portal-row.four-col {
    grid-template-columns: 1fr;
  }
  .utility-bar { grid-template-columns: 1fr; gap: 8px; }
  .utility-reset { display: none; }
}

@media (max-width: 768px) {
  .dark-toggle,
  .header-right,
  .utility-bar,
  .header-spacer,
  .nav-tabs,
  
  header { 
    position: fixed; 
    top: 0; 
    left: 0;
    right: 0; 
    width: 100%; 
    height: 56px; 
    background: var(--surface); 
    box-shadow: 0 1px 8px rgba(0,0,0,0.08); 
    z-index: 2100;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
  }
  .mobile-brand img {
    height: 38px;
    width: auto;
  }
  
  .hamburger { 
    width: 44px; 
    height: 44px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    margin: 0;
  }
  .hamburger div {
    background: var(--text);
  }

  .portal-page { padding-top: 56px !important; }

  .portal-page { padding: 0; }
  .dashboard-shell { 
    padding: 0; 
    border: none; 
    border-radius: 0; 
    margin-top: 0;
  }
  
  /* Mobile Menu Drawer */
  .mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    height: 100vh;
    background: var(--surface);
    z-index: 2000;
    transition: left 0.3s ease;
    padding: 80px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 20px 0 60px rgba(0,0,0,0.15);
    overflow-y: auto;
  }
  .mobile-menu.active {
    left: 0;
  }
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1999;
    display: none;
  }
  .mobile-menu-overlay.active {
    display: block;
  }
  .mobile-tab {
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    border-radius: 12px;
    background: var(--bg);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .mobile-tab.active {
    background: var(--brand);
    color: white;
  }

  .mobile-mode-toggle {
    margin-top: auto;
    padding: 16px;
    background: var(--surface-2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    border: 1px solid var(--border);
    cursor: pointer;
  }
}