/*= require devise */

/* ─── Typography ──────────────────────────────────────────────── */
body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #F9F7F4;
  color: #1C1917;
}

/* Tabular numerals for financial data */
.tabular-nums,
td.numeric,
.financial-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ─── Logo ────────────────────────────────────────────────────── */
.logo-container {
  transition: opacity 0.2s ease-out;
}

.logo-container:hover {
  opacity: 0.85;
}

.logo-medmba {
  transition: opacity 0.2s ease-out;
}

.logo-medmba:hover {
  opacity: 0.85;
}

/* ─── Navigation ──────────────────────────────────────────────── */
nav.header-nav {
  background-color: #0F0E0D;
  border-color: #282B37;
}

/* Nav link active state — orange underline, not blue */
.nav-link-active {
  border-bottom-color: #FF4A0F !important;
  color: #FFFFFF !important;
}

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
  background-color: #FEFCFA;
  border: 1px solid #E5E0D8;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.06), 0 4px 16px rgba(28, 25, 23, 0.04);
  transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(28, 25, 23, 0.10), 0 8px 32px rgba(28, 25, 23, 0.06);
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  background-color: #FF4A0F;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  border: none;
  box-shadow: 0 2px 8px rgba(255, 74, 15, 0.30);
  transition: background-color 0.15s ease-out, box-shadow 0.15s ease-out, transform 0.15s ease-out;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #E03D08;
  box-shadow: 0 4px 16px rgba(255, 74, 15, 0.45);
  transform: scale(1.01);
}

.btn-primary:focus {
  outline: 2px solid #FF4A0F;
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  background-color: transparent;
  color: #1C1917;
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid #E5E0D8;
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #F4F1EE;
  border-color: #D4CEC4;
}

/* ─── Tables ──────────────────────────────────────────────────── */
.data-table thead th {
  background-color: #F4F1EE;
  color: #9C9690;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #E5E0D8;
}

.data-table tbody tr:hover {
  background-color: #F9F7F4;
}

.data-table tbody td {
  border-bottom: 1px solid #E5E0D8;
  color: #1C1917;
}

/* ─── Mobile Navigation ───────────────────────────────────────── */
@media (max-width: 640px) {
  nav a,
  nav button {
    min-height: 44px;
    min-width: 44px;
  }

  [data-mobile-nav-target="menu"] nav a {
    padding: 0.75rem 1rem;
  }

  .logo-medmba {
    max-height: 40px;
  }

  body {
    overflow-x: hidden;
  }
}

@media (min-width: 641px) {
  [data-mobile-nav-target="menu"],
  [data-mobile-nav-target="overlay"] {
    display: none !important;
  }
}

/* ─── Mobile menu animations ──────────────────────────────────── */
[data-mobile-nav-target="menu"],
[data-mobile-nav-target="overlay"] {
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-mobile-nav-target="menu"] {
  max-width: 80vw;
}

/* ─── Accessibility ───────────────────────────────────────────── */
nav button:focus,
nav a:focus {
  outline: 2px solid #FF4A0F;
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
}

body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ─── Charts ──────────────────────────────────────────────────── */
canvas {
  max-width: 100%;
  height: auto !important;
}

/* ─── Touch targets ───────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  a, button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Mobile Navigation Styles */
/* Ensure mobile menu is above other content */
[data-mobile-nav-target="menu"] {
  max-width: 80vw;
}

/* Smooth transitions for mobile menu */
[data-mobile-nav-target="menu"],
[data-mobile-nav-target="overlay"] {
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Touch-friendly tap targets for mobile */
@media (max-width: 640px) {
  /* Ensure minimum tap target size of 44x44px for mobile */
  nav a,
  nav button {
    min-height: 44px;
    min-width: 44px;
  }

  /* Improve spacing for mobile navigation items */
  [data-mobile-nav-target="menu"] nav a {
    padding: 0.75rem 1rem;
  }

  /* Make logo smaller on mobile */
  .logo-medmba {
    max-height: 40px;
  }

  /* Prevent horizontal scroll on mobile */
  body {
    overflow-x: hidden;
  }
}

/* Tablet and larger screens */
@media (min-width: 641px) {
  /* Hide mobile menu on larger screens */
  [data-mobile-nav-target="menu"],
  [data-mobile-nav-target="overlay"] {
    display: none !important;
  }
}

/* Accessibility: Focus states for keyboard navigation */
nav button:focus,
nav a:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Prevent layout shift when mobile menu opens */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Mobile-specific improvements for common UI patterns */
@media (max-width: 640px) {
  /* Improve button spacing on mobile */
  .space-x-3 > * + * {
    margin-left: 0.5rem !important;
  }

  /* Stack buttons vertically on very small screens */
  @media (max-width: 480px) {
    .md\:mt-0.md\:ml-4 {
      margin-top: 1rem;
      margin-left: 0;
    }

    /* Make action buttons full width on mobile */
    .inline-flex.items-center.px-4 {
      width: 100%;
      justify-content: center;
    }
  }

  /* Improve table responsiveness */
  table {
    font-size: 0.875rem;
  }

  table th,
  table td {
    padding: 0.5rem 0.75rem;
  }

  /* Improve card spacing on mobile */
  .p-6 {
    padding: 1rem;
  }

  /* Reduce heading sizes on mobile */
  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  /* Improve grid spacing on mobile */
  .gap-6 {
    gap: 1rem;
  }

  .gap-8 {
    gap: 1.5rem;
  }
}

/* Ensure charts are responsive */
canvas {
  max-width: 100%;
  height: auto !important;
}

/* Improve touch targets for links and buttons */
@media (hover: none) and (pointer: coarse) {
  a, button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
