/* Ensure body margin accounts for the fixed navbar */
body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Main container to push content below the navbar */
.main-content {
  margin-top: 20px;
  margin-left: 300px; /* Same as the sidebar width */
  margin-right: 300px; /* Same as the sidebar2 width */
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    padding: 15px;
  }

  /* Show sidebar toggle buttons on mobile */
  .sidebar-toggle-left,
  .sidebar-toggle-right {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  /* Add text labels next to icons on mobile */
  .sidebar-toggle-left::after {
    content: "Shortcuts";
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
  }

  .sidebar-toggle-right::after {
    content: "Date/Time";
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
  }

  /* Mobile sidebar access hint */
  .mobile-sidebar-hint {
    display: block;
    background: #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
  }

  .mobile-sidebar-hint p {
    margin: 0;
    font-size: 0.9rem;
    color: #495057;
  }

  .mobile-sidebar-hint .hint-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    font-size: 1.5rem;
  }

  .sidebar-toggle-left {
    left: 0;
  }

  .sidebar-toggle-right {
    right: 0;
  }

  /* Off-canvas sidebars (hidden via transform) */
  .sidebar,
  .sidebar2 {
    position: fixed;
    top: 56px;
    height: calc(100vh - 56px);
    width: 280px;
    background-color: #f8f9fa;
    z-index: 1040; /* Above content but below overlay */
    overflow-y: auto;
    transition: transform 280ms ease;
    will-change: transform;
    padding-bottom: 20px;
  }

  /* Close button inside sidebars */
  .sidebar .close-sidebar,
  .sidebar2 .close-sidebar {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
    background: #343a40;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
  }

  /* Add padding to sidebar content for close button */
  .sidebar > *:not(.close-sidebar),
  .sidebar2 > *:not(.close-sidebar) {
    padding-right: 15px;
  }

  .sidebar .close-sidebar:hover,
  .sidebar2 .close-sidebar:hover {
    background: #23272b;
  }

  /* Hidden positions */
  .sidebar {
    left: 0;
    transform: translateX(-110%);
  }
  .sidebar2 {
    right: 0;
    transform: translateX(110%);
  }

  /* When toggled show via transform */
  .sidebar.show {
    transform: translateX(0);
  }
  .sidebar2.show {
    transform: translateX(0);
  }

  /* Overlay between content and drawers */
  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 1050;
  }
  .overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .content {
    padding: 0;
  }

  .content h1 {
    font-size: 1.5rem;
    margin: 15px 0 10px 0;
  }

  .content h2 {
    font-size: 1.2rem;
    margin: 12px 0 8px 0;
  }

  .content p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .content ul {
    padding-left: 20px;
  }

  .content li {
    margin-bottom: 8px;
  }

  /* Adjust search form for mobile */
  .d-flex {
    flex-wrap: wrap;
  }

  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 10px;
    min-height: 44px; /* Touch-friendly minimum */
  }

  .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 15px;
  }

  /* Improve button size on navbar */
  .navbar-toggler {
    padding: 10px;
    min-height: 44px;
    min-width: 44px;
  }

  /* Dropdown menu adjustments */
  .dropdown-menu {
    position: static;
    height: auto;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 5px;
  }

  /* Footer adjustments */
  footer {
    position: relative;
    bottom: auto;
    width: 100%;
    margin-top: 20px;
    padding: 15px 10px;
  }

  section {
    margin-bottom: 20px;
  }
}

/* Tablet view (landscape) */
@media (max-width: 1024px) and (min-width: 769px) {
  .main-content {
    margin-left: 0;
    margin-right: 250px;
    padding: 20px;
  }

  /* Show sidebar toggles on tablet */
  .sidebar-toggle-left,
  .sidebar-toggle-right {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Show mobile hint on tablet too */
  .mobile-sidebar-hint {
    display: block;
    background: #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
  }

  .mobile-sidebar-hint p {
    margin: 0;
    font-size: 0.9rem;
    color: #495057;
  }

  .mobile-sidebar-hint .hint-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    font-size: 1.5rem;
  }

  .sidebar {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    width: 300px;
    height: calc(100vh - 56px);
    z-index: 1040;
  }

  .sidebar.show {
    display: block;
  }

  .sidebar2 {
    width: 250px;
  }
}

/* Extra small devices (less than 376px) */
@media (max-width: 375px) {
  .navbar-brand {
    font-size: 0.9rem;
  }

  .navbar {
    padding: 0.3rem 0;
  }

  .content {
    padding: 0;
  }

  .content h1 {
    font-size: 1.3rem;
  }

  .content h2 {
    font-size: 1rem;
  }

  .form-control,
  .btn {
    font-size: 14px;
  }
}

/* 
  Styles for a dropdown menu component:
  - Positioned absolutely relative to its nearest positioned ancestor.
  - Appears directly below the triggering element (top: 100%; left: 0).
  - Z-index ensures it appears above other elements when displayed.
  - Initially hidden (display: none) until triggered.
  - Styled with a light background color (#f8f9fa) and a border for visibility.
  - Fixed height of 300px with scrollable content (overflow: auto) for long lists.
*/
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1;
  display: none;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  height: 300px;
  overflow: auto;
}

/* Desktop: hide sidebar close buttons */
.sidebar .close-sidebar,
.sidebar2 .close-sidebar {
  display: none;
}

/* Hide mobile hint on desktop */
.mobile-sidebar-hint {
  display: none;
}

/* Mobile: show close buttons inside sidebars */
@media (max-width: 768px) {
  .sidebar .close-sidebar,
  .sidebar2 .close-sidebar {
    display: block;
  }
}

/* Sidebar styles */
.sidebar {
  position: fixed;
  top: 56px; /* Same as the navbar height */
  left: 0;
  width: 300px;
  height: calc(100vh - 56px); /* Full height minus navbar height */
  background-color: #f8f9fa;
  padding-top: 20px;
  border-right: 1px solid #ddd;
}

/* Hide sidebar toggle buttons on desktop (default) */
.sidebar-toggle-left,
.sidebar-toggle-right {
  display: none;
  position: fixed;
  top: 56px; /* Below the navbar */
  background-color: #343a40;
  color: white;
  border: none;
  padding: 12px 15px;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 1051; /* Above navbar (1040) and overlay (1050) */
  border-radius: 0 4px 4px 0;
  transition: all 0.3s ease;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle-left {
  left: 0;
  border-radius: 0 4px 4px 0;
}

.sidebar-toggle-right {
  right: 0;
  border-radius: 4px 0 0 4px;
}

.sidebar-toggle-left:hover,
.sidebar-toggle-right:hover {
  opacity: 0.9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle-left:focus,
.sidebar-toggle-right:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Icon rotation when sidebar is open */
.sidebar-toggle-left.open i {
  transform: rotate(180deg);
}

.sidebar-toggle-right.open i {
  transform: rotate(-180deg);
}

.sidebar-toggle-left i,
.sidebar-toggle-right i {
  transition: transform 0.3s ease;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px; /* Set a max height for the links container */
  overflow-y: auto; /* Enable vertical scrolling if content overflows */
  padding-right: 8px; /* Optional: add some padding for scrollbar */
}

/* Right Sidebar styles */
.sidebar2 {
  position: fixed;
  top: 56px; /* Same as the navbar height */
  right: 0;
  width: 300px;
  height: calc(100vh - 56px); /* Full height minus navbar height */
  background-color: #f8f9fa;
  padding-top: 20px;
  border-left: 1px solid #ddd;
  text-align: center;
}

.sidebar a {
  display: block;
  color: #000;
  padding: 10px 15px;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease;
}

.shortcuts {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ynlinks {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar a.active {
  background-color: #007bff;
  color: white;
}

.sidebar a:hover {
  background-color: #ddd;
  color: black;
}

/* Content styles */
.content {
  padding: 20px;
}

footer {
  text-align: center;
}

#clock {
  font-size: 1.25rem;
  font-family: monospace;
  font-weight: bold;
}

/* Sidebar date and clock styles */
.sidebar-date {
  margin: 8px 0;
  font-size: 25px;
  color: var(--color-text);
}
.sidebar-clock {
  font-size: 0.25rem;
  font-family: monospace;
  font-weight: 200;
  margin: 8px 0 12px 0;
  color: var(--color-primary);
}

.sectionone {
  background-color: white;
  margin: 10px;
  border-radius: 10px;
  border: 1px solid black;
}

.sectiontwo {
  background-color: white;
  margin: 10px;
  border-radius: 10px;
  border: 1px solid black;
  padding: 10px;
}

.sectionthree {
  background-color: white;
  margin: 10px;
  border-radius: 10px;
  border: 1px solid black;
  padding: 10px;
}

.ppcaddress {
  text-align: left;
  line-height: 1.5;
  font-size: small;
}

.ppcemail {
  text-align: left;
  line-height: 1.5;
  font-size: small;
  margin-bottom: 10px;
}

.C5Iemail {
  text-align: left;
  line-height: 1.5;
  font-size: small;
  margin-bottom: 10px;
}

.ppccustserv {
  text-align: left;
  line-height: 1.5;
  font-size: small;
  margin-bottom: 10px;
}

.c5icustserv {
  text-align: left;
  line-height: 1.5;
  font-size: small;
  margin-bottom: 10px;
}

/* Mobile optimization: Improve form inputs */
input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  font-size: 16px; /* Prevents iOS zoom on focus */
  padding: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Paycut Dates Widget Styles */
.paycut-widget {
  text-align: center;
  padding: 10px;
}

.paycut-widget h3 {
  font-size: 1.1rem;
  margin: 0 0 10px 0;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.paycut-widget h3 i {
  color: #007bff;
}

.paycut-date-display {
  font-size: 1rem;
  font-weight: bold;
  color: #212529;
  margin-bottom: 8px;
}

.paycut-date-display #paycutLabel {
  display: block;
  font-size: 0.85rem;
  font-weight: normal;
  color: #6c757d;
  margin-bottom: 4px;
}

.paycut-date-display #paycutDate {
  display: block;
  font-size: 1.2rem;
  color: #007bff;
}

.paycut-countdown {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 5px;
}

/* Improve navbar responsiveness */
.navbar {
  padding: 0.5rem 1rem;
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.1rem;
}

/* Navigation items touch-friendly */
.nav-link {
  padding: 0.7rem 0.5rem !important;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Dropdown items should be touch-friendly */
.dropdown-item {
  padding: 0.75rem 1rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Improve readability on mobile */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
  }

  .dropdown-item {
    font-size: 0.9rem;
    padding: 10px 15px;
  }

  @supports (padding: max(0px)) {
    .main-content {
      padding: 15px max(15px, env(safe-area-inset-right));
      padding-left: max(15px, env(safe-area-inset-left));
    }
  }
}
/* Email link styles */
.email {
  text-decoration: none;
}
