/**
 * Tailwind CSS-inspired styling for Primary Tabs
 */

/* Base tabs container */
nav.tabs {
  margin: 1.5rem 0;
  border: none; /* Removed from .tabs.primary to avoid affecting sidebar */
}

/* Primary tabs list */
.tabs.primary {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
  border-bottom: 1px solid #e5e7eb;
}

.tabs.primary li {
  margin: 0;
}

.tabs.primary a {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  background-color: transparent;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tabs.primary a:hover {
  background-color: transparent;
  color: black;
  transform: none !important; /* Prevent movement on hover from other styles */
}

.tabs.primary a.is-active {
  background-color: transparent;
  color: black;
  border: none;
  font-weight: 600;
}

.tabs.primary a:focus {
  outline: 2px solid grey;
  outline-offset: 2px;
}

/* --- Overrides for primary tabs within the left sidebar --- */

.region-sidebar-first .tabs.primary {
  flex-direction: column; /* Stack tabs vertically */
  width: 100%;
  background-color: transparent;
  border-bottom: none !important;
  gap: 0;
}

.region-sidebar-first .tabs.primary li {
  width: 100%;
  margin: 0.25rem 0 !important;
  border: 1px solid transparent !important; /* Initial border */
  transition: border-color 0.2s ease, background-color 0.2s ease;
  border-radius: 0;
}

.region-sidebar-first .tabs.primary li:hover {
    background-color: #F1F2F3 !important;
    border: 1px solid black !important;
}

.region-sidebar-first .tabs.primary li a {
  width: 95% !important; /* As per user's code */
  margin: 0;
  background-color: white;
  color: black;
  border-radius: 0 !important;
}

.region-sidebar-first .tabs.primary li a:hover {
  margin-left: 0.25rem !important; /* As per user's code */
  background-color: transparent !important;
}

.region-sidebar-first .tabs.primary li a.is-active {
  border: 1px solid black;
}

/* --- Responsive & Dark Mode --- */

@media (max-width: 640px) {
  .tabs.primary {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tabs.primary a,
  .tabs.primary a.is-active {
    border: none;
    border-radius: 0;
  }
}

/* Dark mode support */
.tw-dark .tabs.primary {
  border-bottom-color: #4b5563;
}

.tw-dark .tabs.primary a {
  color: black;
  background-color: transparent;
  border-color: transparent;
}

.tw-dark .tabs.primary a:hover {
  background-color: transparent;
}

.tw-dark .tabs.primary a.is-active {
  background-color: transparent;
  color: #60a5fa;
  border: none;
}

.tw-dark .tabs.primary a:focus {
  outline-color: #60a5fa;
}

@media (max-width: 640px) {
  .tw-dark .tabs.primary a.is-active {
    border: 1px solid #4b5563;
  }
}
