/* App theme and UI polish for BMM Track System
   - Uses Tailwind as the utility base
   - Adds small consistent tweaks for nav, tables, forms, cards
   - Keep minimal to avoid conflicts with existing Tailwind classes
*/

/* CSS variables for quick theming */
:root {
  --color-bg: #f3f4f6;           /* gray-100 */
  --color-surface: #ffffff;      /* white */
  --color-text: #111827;         /* gray-900 */
  --color-muted: #6b7280;        /* gray-500 */
  --color-border: #e5e7eb;       /* gray-200 */
  --color-primary: #4f46e5;      /* indigo-600 */
  --color-primary-700: #4338ca;  /* indigo-700 */
  --shadow-card: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.1);
}

/* Global base tweaks */
body {
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Navbar links */
.nav-link,
.mobile-link {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.5rem; /* ~px-2 py-1.5 */
  border-radius: 0.375rem;  /* rounded-md */
  font-size: 0.9rem;
  color: #374151;           /* gray-700 */
  transition: background-color .2s ease, color .2s ease;
}
.nav-link:hover,
.mobile-link:hover {
  background: #f3f4f6;      /* gray-100 */
  color: #111827;           /* gray-900 */
}
.nav-link.active,
.mobile-link.active {
  color: var(--color-primary);
  background: #eef2ff;      /* indigo-50 */
  font-weight: 600;
}

/* Card polish (for white containers) */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-card);
}

/* Buttons quick polish for consistency when not using Tailwind utilities explicitly */
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.btn-primary:hover {
  background: var(--color-primary-700);
}

/* Tables: add subtle separation, striped rows when not using Tailwind table classes */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th {
  position: sticky;
  top: 0;
  background: #f9fafb; /* gray-50 */
  z-index: 10;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #6b7280;
}
.table tbody tr {
  transition: background-color .15s ease;
}
.table tbody tr:hover {
  background: #f9fafb;
}
.table td, .table th {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

/* Responsive table wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Forms */
.form-label {
  display: inline-block;
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 0.25rem;
}
.form-control {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  color: var(--color-text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

/* Alerts */
.alert {
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}
.alert-info {
  background: #eff6ff;  /* blue-50 */
  color: #1d4ed8;       /* blue-700 */
  border: 1px solid #bfdbfe; /* blue-200 */
}
.alert-success {
  background: #ecfdf5;  /* emerald-50 */
  color: #047857;       /* emerald-700 */
  border: 1px solid #a7f3d0; /* emerald-200 */
}
.alert-warning {
  background: #fffbeb;  /* amber-50 */
  color: #b45309;       /* amber-700 */
  border: 1px solid #fde68a; /* amber-200 */
}
.alert-danger {
  background: #fef2f2;  /* red-50 */
  color: #b91c1c;       /* red-700 */
  border: 1px solid #fecaca; /* red-200 */
}

/* Utility helpers when needed without adding Tailwind classes */
.shadow-card { box-shadow: var(--shadow-card); }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.text-muted { color: var(--color-muted); }

/* Small enhancement for focus-visible on interactive elements */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Global container width: use 95% of the viewport */
/* Applies to all templates using Tailwind's max-w-7xl for the main container */
.max-w-7xl {
  max-width: 95vw !important;
}
