/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Fallback for skip link visibility (works without Tailwind) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 0.5rem; /* 8px */
  top: 0.5rem;
  width: auto;
  height: auto;
  overflow: visible;
  background: #fff;
  color: #1d4ed8; /* blue-700 */
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  z-index: 1000;
}

/* Brand tokens (fallbacks; can be overridden per-farm in layout) */
:root {
  --brand-primary: var(--color-primary-600, #2563eb); /* Tailwind blue-600 as default */
  --brand-secondary: #64748b; /* Tailwind slate-500 as default */
}

#sidebar-nav ul {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}
#sidebar-nav li {
  list-style: none;
}

@media (min-width: 640px) {
  #erp-sidebar {
    transform: translateX(0) !important;
  }
  #main-content {
    margin-left: 16rem !important; /* ml-64 */
    position: relative;
    z-index: 45; /* Above sidebar (z-40) but below navbar (z-50) */
  }
  .sm\:ml-64 {
    margin-left: 16rem !important;
  }
  .sm\:hidden {
    display: none !important;
  }
  .sm\:translate-x-0 {
    transform: translateX(0) !important;
  }
  #navbar-sidebar-toggle {
    display: none !important;
  }
}

/* Leaflet map marker overrides
 * We use CSS-based div icons for markers and do not need the default PNG icons.
 * Disable Leaflet's default background images to avoid external icon requests
 * and define a simple style for our custom map marker.
 */
.leaflet-marker-icon,
.leaflet-marker-shadow {
  background-image: none !important;
}

.custom-map-marker {
  width: 8px;
  height: 8px;
  border-radius: 9999px; /* fully rounded */
  background-color: #ffffff;
}

/* Generic button styles for primary/secondary/text actions */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem; /* rounded-md */
  font-size: 0.875rem; /* text-sm */
  font-weight: 500;
  color: #ffffff;
  background-color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.btn-primary:hover {
  background-color: #1d4ed8; /* slightly darker */
}

.btn-primary:focus {
  outline: 2px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827; /* gray-900 */
  background-color: #ffffff;
  border: 1px solid #d1d5db; /* gray-300 */
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.btn-secondary:hover {
  background-color: #f9fafb; /* gray-50 */
}

.btn-secondary:focus {
  outline: 2px solid rgba(156, 163, 175, 0.4); /* gray-400 */
  outline-offset: 2px;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-primary);
  background-color: transparent;
  border: none;
  text-decoration: none;
  cursor: pointer;
}

.btn-text:hover {
  text-decoration: underline;
}

.btn-text:focus {
  outline: 2px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}
