/* Sofia Pro Font Definitions */
@import url('https://fonts.googleapis.com/css2?family=Sofia+Pro:wght@300;400;500;600;700;900&display=swap');

/* CSS Variables for MedFinder Colors */
:root {
  --color-mf-black: #000000;
  --color-mf-salmon: #F9A7A7;
  --color-mf-salmon-hover: #EA8C9A;
  --color-mf-salmon-active: #E15C70;
  --color-mf-light-salmon: #f7cccc;
  --color-mf-green: #B0F7A9;
  --color-mf-green-hover: #99E88C;
  --color-mf-green-active: #80D96E;
  --color-mf-light-green: #E8F5E8;
  --color-mf-blue: #A8F4F4;
  --color-mf-light-blue: #EFFDFD;
  --color-mf-blue-hover: #82D2E8;
  --color-mf-blue-active: #54C1DF;
  --color-mf-navy: #132F4E;
  --color-mf-navy-hover: #081C34;
  --color-mf-navy-active: #020F1F;
  --color-mf-gray: #E8E8E8;
  --color-mf-gray-hover: #D1D1D1;
  --color-mf-gray-active: #BABABA;
}

/* Dark Mode CSS Variables */
:root.dark {
  --color-mf-salmon: #F9A7A7;
  --color-mf-salmon-hover: #EA8C9A;
  --color-mf-salmon-active: #E15C70;
  --color-mf-light-salmon: #4A2626;
  --color-mf-green: #B0F7A9;
  --color-mf-green-hover: #99E88C;
  --color-mf-green-active: #80D96E;
  --color-mf-light-green: #1F2A1F;
  --color-mf-blue: #A8F4F4;
  --color-mf-light-blue: #1F2626;
  --color-mf-blue-hover: #82D2E8;
  --color-mf-blue-active: #54C1DF;
  --color-mf-navy: #132F4E;
  --color-mf-navy-hover: #081C34;
  --color-mf-navy-active: #020F1F;
  --color-mf-gray: #4B5563;
  --color-mf-gray-hover: #6B7280;
  --color-mf-gray-active: #9CA3AF;
}

/* Base Styles */
body {
  font-family: 'Sofia Pro', sans-serif;
  font-weight: 400;
  color: var(--color-mf-navy);
}

/* Dark mode base styles - ensure proper text contrast */
.dark body {
  background-color: transparent !important;
  color: #f9fafb !important;
}

/* Override all text colors in dark mode for proper contrast */
.dark *:not(.bg-mf-salmon):not(.bg-mf-green):not(.bg-mf-blue):not(.bg-mf-navy):not(.bg-mf-gray) {
  color: #f9fafb !important;
}

/* Preserve specific branded button colors - keep text black for light backgrounds */
.dark button.bg-mf-salmon,
.dark .bg-mf-salmon,
.dark .bg-mf-salmon *,
.dark .btn-mf-salmon,
.dark .btn-mf-salmon *,
.dark button.bg-mf-salmon *,
.dark a.bg-mf-salmon,
.dark a.bg-mf-salmon * {
  color: #000000 !important;
}

.dark button.bg-mf-green,
.dark .bg-mf-green,
.dark .bg-mf-green *,
.dark .btn-mf-green,
.dark .btn-mf-green *,
.dark button.bg-mf-green *,
.dark a.bg-mf-green,
.dark a.bg-mf-green * {
  color: var(--color-mf-navy) !important;
}

.dark button.bg-mf-blue,
.dark .bg-mf-blue,
.dark .bg-mf-blue *,
.dark .btn-mf-blue,
.dark .btn-mf-blue *,
.dark button.bg-mf-blue *,
.dark a.bg-mf-blue,
.dark a.bg-mf-blue * {
  color: #000000 !important;
}

.dark button.bg-mf-gray,
.dark .bg-mf-gray,
.dark .bg-mf-gray *,
.dark button.bg-mf-gray *,
.dark a.bg-mf-gray,
.dark a.bg-mf-gray * {
  color: #000000 !important;
}

/* Keep navy buttons with white text */
.dark button.bg-mf-navy,
.dark .bg-mf-navy,
.dark .bg-mf-navy *,
.dark .btn-mf-navy,
.dark .btn-mf-navy *,
.dark button.bg-mf-navy *,
.dark a.bg-mf-navy,
.dark a.bg-mf-navy * {
  color: #ffffff !important;
}

/* Force Tailwind dark mode styles to take precedence */
.dark .bg-white {
  background-color: #111827 !important;
}

.dark .bg-gray-50 {
  background-color: #1f2937 !important;
}

.dark .text-gray-900 {
  color: #f9fafb !important;
}

.dark .text-gray-700 {
  color: #d1d5db !important;
}

.dark .text-gray-600 {
  color: #9ca3af !important;
}

.dark .text-gray-500 {
  color: #9ca3af !important;
}

.dark .text-gray-800 {
  color: #e5e7eb !important;
}

.dark .text-black {
  color: #f9fafb !important;
}

/* Ensure buttons and links remain readable - but not branded buttons */
.dark button:not([class*="bg-mf-"]):not([class*="btn-mf-"]),
.dark a:not([class*="bg-mf-"]):not([class*="btn-mf-"]),
.dark input,
.dark select,
.dark textarea {
  color: #f9fafb !important;
}

/* Status badge text colors for dark mode */
.dark .status-success {
  color: #000000 !important;
}

.dark .status-pending {
  color: #000000 !important;
}

.dark .status-error {
  color: #ffffff !important;
}

.dark .status-default {
  color: #ffffff !important;
}

/* Table and card content in dark mode */
.dark table,
.dark .table,
.dark td,
.dark th,
.dark tr {
  color: #f9fafb !important;
}

.dark .card,
.dark .card-body,
.dark .card-header {
  color: #f9fafb !important;
}

/* Ensure all text elements are white in dark mode */
.dark p,
.dark span,
.dark div,
.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6,
.dark label,
.dark .text-sm,
.dark .text-base,
.dark .text-lg,
.dark .text-xl {
  color: #f9fafb !important;
}

/* Override any Tailwind text color classes in dark mode */
.dark .text-gray-900,
.dark .text-gray-800,
.dark .text-gray-700,
.dark .text-gray-600,
.dark .text-gray-500,
.dark .text-black {
  color: #f9fafb !important;
}

/* Code blocks and monospace elements in dark mode */
.dark code,
.dark pre,
.dark .font-mono,
.dark .monospace,
.dark .search-id,
.dark .bg-gray-100 {
  background-color: #374151 !important;
  color: #f9fafb !important;
}

.dark .bg-gray-200 {
  background-color: #4b5563 !important;
}

.dark .bg-gray-300 {
  background-color: #6b7280 !important;
}

/* Input fields and form elements in dark mode */
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="tel"],
.dark input[type="date"],
.dark input[type="search"],
.dark input[type="password"],
.dark select,
.dark textarea {
  background-color: #374151 !important;
  color: #f9fafb !important;
  border-color: #4b5563 !important;
}

.dark input[type="text"]:focus,
.dark input[type="email"]:focus,
.dark input[type="tel"]:focus,
.dark input[type="date"]:focus,
.dark input[type="search"]:focus,
.dark input[type="password"]:focus,
.dark select:focus,
.dark textarea:focus {
  background-color: #4b5563 !important;
  border-color: #6b7280 !important;
}

/* Placeholder text in dark mode */
.dark input::placeholder,
.dark textarea::placeholder {
  color: #9ca3af !important;
}

/* Toggle switches in dark mode - ensure checked state shows primary color */
.dark input[type="checkbox"]:checked ~ div.peer-checked\:bg-mf-blue {
  background-color: var(--color-mf-blue) !important;
}

/* Alternative approach using peer-checked utility */
.dark .peer:checked ~ .peer-checked\:bg-mf-blue {
  background-color: var(--color-mf-blue) !important;
}

/* Table row hover states in dark mode */
.dark tr:hover,
.dark .hover\\:bg-gray-50:hover {
  background-color: #374151 !important;
}

.dark tbody tr:hover {
  background-color: #374151 !important;
}

.dark .hover\\:bg-gray-100:hover {
  background-color: #4b5563 !important;
}

/* Font Weight Classes */
.font-sofia-light {
  font-family: 'Sofia Pro', sans-serif;
  font-weight: 300;
}

.font-sofia-regular {
  font-family: 'Sofia Pro', sans-serif;
  font-weight: 400;
}

.font-sofia-medium {
  font-family: 'Sofia Pro', sans-serif;
  font-weight: 500;
}

.font-sofia-semibold {
  font-family: 'Sofia Pro', sans-serif;
  font-weight: 600;
}

.font-sofia-bold {
  font-family: 'Sofia Pro', sans-serif;
  font-weight: 700;
}

.font-sofia-black {
  font-family: 'Sofia Pro', sans-serif;
  font-weight: 900;
}

/* MedFinder Color Classes */
.bg-mf-salmon {
  background-color: var(--color-mf-salmon);
}

.bg-mf-salmon-hover:hover {
  background-color: var(--color-mf-salmon-hover);
}

.bg-mf-salmon-light {
  background-color: var(--color-mf-light-salmon);
}

.bg-mf-green {
  background-color: var(--color-mf-green);
}

.bg-mf-green-hover:hover {
  background-color: var(--color-mf-green-hover);
}

.bg-mf-green-light {
  background-color: var(--color-mf-light-green);
}

.bg-mf-blue {
  background-color: var(--color-mf-blue);
}

.bg-mf-blue-hover:hover {
  background-color: var(--color-mf-blue-hover);
}

.bg-mf-blue-light {
  background-color: var(--color-mf-light-blue);
}

.bg-mf-navy {
  background-color: var(--color-mf-navy);
}

.bg-mf-navy-hover:hover {
  background-color: var(--color-mf-navy-hover);
}

.text-mf-salmon {
  color: var(--color-mf-salmon);
}

.text-mf-green {
  color: var(--color-mf-green);
}

.text-mf-blue {
  color: var(--color-mf-blue);
}

.text-mf-navy {
  color: var(--color-mf-navy);
}

.border-mf-salmon {
  border-color: var(--color-mf-salmon);
}

.border-mf-navy {
  border-color: var(--color-mf-navy);
}

/* Custom Gradient */
.gradient-mf-blue {
  background: linear-gradient(to bottom, #ffffff, var(--color-mf-light-blue));
}

/* Button Styles */
.btn-mf-salmon {
  background-color: var(--color-mf-salmon);
  color: black;
  transition: background-color 0.2s ease;
}

.btn-mf-salmon:hover {
  background-color: var(--color-mf-salmon-hover);
}

.btn-mf-green {
  background-color: var(--color-mf-green);
  color: var(--color-mf-navy);
  transition: background-color 0.2s ease;
}

.btn-mf-green:hover {
  background-color: var(--color-mf-green-hover);
}

.btn-mf-blue {
  background-color: var(--color-mf-blue);
  color: black;
  transition: background-color 0.2s ease;
}

.btn-mf-blue:hover {
  background-color: var(--color-mf-blue-hover);
}

.btn-mf-navy {
  background-color: var(--color-mf-navy);
  color: white;
  transition: background-color 0.2s ease;
}

.btn-mf-navy:hover {
  background-color: var(--color-mf-navy-hover);
}

/* Status Badge Styles */
.status-success {
  background-color: var(--color-mf-green);
  color: var(--color-mf-navy);
}

.status-pending {
  background-color: var(--color-mf-salmon);
  color: black;
}

.status-error {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-default {
  background-color: #f3f4f6;
  color: #374151;
}

/* Tailwind Custom Classes */
.bg-gradient-mf-blue {
  background: linear-gradient(to bottom, #ffffff, var(--color-mf-light-blue));
}

/* CRITICAL OVERRIDE: Branded button text colors in dark mode */
/* This must be at the end to override all previous rules */
.dark button.bg-mf-blue,
.dark button.bg-mf-salmon,
.dark button.bg-mf-green,
.dark button.bg-mf-gray {
  color: #000000 !important;
}

.dark button.bg-mf-navy {
  color: #ffffff !important;
}

/* Active navigation tab styling in dark mode */
.dark .bg-mf-blue-light {
  background-color: #1e3a8a !important; /* Dark blue background */
}

/* Ensure active tab text remains visible */
.dark .bg-mf-blue-light,
.dark .bg-mf-blue-light * {
  color: #ffffff !important;
}

/* Preserve dark text on light background chips/badges in dark mode */
.dark .bg-purple-100,
.dark .bg-purple-100 *,
.dark .bg-blue-100,
.dark .bg-blue-100 * {
  color: #1f2937 !important; /* Dark gray text for readability on light backgrounds */
}