/* Shared Navigation Styles - DLS Intranet */
/* Used across all applications: Localytics, Calendar, Load Tracker, Coverage, Zone Map */

/* Global 10% scale reduction for all interfaces */
html {
  font-size: 90%; /* Reduces all rem-based sizing by 10% */
}

/* ==========================================================================
   Left Sidebar Navigation (shared across all apps)
   ========================================================================== */

:root {
  --side-nav-width: 15rem;
}

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--side-nav-width);
  background: rgba(17, 24, 39, 0.98);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.side-nav-header {
  padding: 0.25rem 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
}

.side-nav-logo {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #10b981;
  text-decoration: none;
  transition: color 0.2s;
}

.side-nav-logo:hover {
  color: #34d399;
}

.side-nav-version {
  display: block;
  margin-top: 0.25rem;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 500;
}

.side-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav-link {
  display: block;
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  white-space: nowrap;
}

.side-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.side-nav-link.active {
  color: #fff;
  background: rgba(16, 185, 129, 0.15);
  font-weight: 600;
}

.side-nav-hub {
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.5rem;
}

/* Offset page content for the fixed sidebar. !important because some pages
   load their own stylesheet after shared.css and set body padding. */
body.has-side-nav {
  padding-top: 1rem !important;
  padding-left: var(--side-nav-width) !important;
}

/* Neutralize any legacy top-nav or per-page decorative sidebars in favor of
   the shared left sidebar. */
.top-nav,
.has-side-nav .layout-shell > .sidebar,
.has-side-nav nav.sidebar {
  display: none !important;
}

.has-side-nav .layout-shell {
  display: block !important;
  height: auto !important;
}

.has-side-nav .layout-main {
  margin-left: 0 !important;
}

#global-google-signin {
  display: none;
}

#global-google-signin iframe {
  height: 40px !important;
}

/* Responsive - sidebar becomes a top strip on narrow screens */
@media (max-width: 900px) {
  .side-nav {
    position: static;
    width: 100%;
    bottom: auto;
    padding: 0.5rem 0.75rem;
  }

  .side-nav-header {
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .side-nav-links {
    flex-direction: row;
    flex-wrap: wrap;
  }

  body.has-side-nav {
    padding-left: 0 !important;
  }
}

/* Global Print Styles - Ensures black text across all apps */
@media print {
  /* Reset ALL CSS variables for print */
  :root {
    --text: #000;
    --text-color: #000;
    --text-muted: #000;
    --text-grey: #000;
    --text-gray: #000;
    --fg: #000;
    --color: #000;
    --color-text: #000;
    --color-text-primary: #000;
    --foreground: #000;
    --border: #000;
  }

  /* Base elements for print */
  html,
  body {
    background: white;
    color: black;
  }

  /* Table elements */
  table {
    color: black;
    background-color: white;
  }

  thead {
    color: black;
    background-color: white;
  }

  tbody {
    color: black;
    background-color: white;
  }

  tr {
    color: black;
    background-color: white;
  }

  th,
  td {
    color: black;
    background-color: white;
    border-color: #333;
  }

  /* Text elements */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  span,
  a,
  li,
  label,
  button,
  input,
  select,
  textarea {
    color: black;
  }

  /* Common component classes */
  .card,
  .modal,
  .alert,
  .notification,
  .badge,
  .button,
  .btn,
  .stat-box,
  .summary-grid,
  .print-header-title,
  .table-container,
  .data-table {
    color: black;
  }

  /* Hide print-irrelevant elements */
  .no-print,
  .hidden-print,
  nav,
  .navigation,
  .sidebar,
  .menu,
  .button-group,
  .action-buttons {
    display: none;
  }

  /* Ensure links are visible and underlined */
  a {
    color: black;
    text-decoration: underline;
  }

  /* Page margins */
  @page {
    margin: 0.5in;
  }
}
