/* Modern, Mobile-First MyCare Buddy Styles */

/* Improved Placeholder Text Visibility */
.form-control::placeholder {
  color: #6c757d !important;
  opacity: 0.8 !important;
  font-style: italic;
}

.form-control:focus::placeholder {
  color: #adb5bd !important;
  opacity: 0.6 !important;
}

/* Better form field visibility */
.form-control {
  border: 2px solid #dee2e6 !important;
  background-color: #ffffff !important;
  color: #495057 !important;
}

/* Missing Details Prompt Styles */
.missing-details-prompt {
  background: rgba(255, 193, 7, 0.9) !important;
  border: 2px solid #ffc107 !important;
  color: #000 !important;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(255, 193, 7, 0.3);
  animation: slideIn 0.5s ease-out;
}

.missing-details-prompt h6 {
  color: #dc3545 !important;
  margin-bottom: 1rem;
}

.missing-details-prompt .form-label {
  color: #000 !important;
  font-weight: 600;
}

.missing-details-prompt .form-select,
.missing-details-prompt .form-range {
  margin-bottom: 0.5rem;
}

.missing-details-prompt .badge {
  font-size: 1rem;
  min-width: 40px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
:root {
  /* Blue Gradient Theme - Inspired by Modern App Design */
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --secondary: #64748B;
  --success: #10B981;
  --success-light: #34D399;
  --info: #0ea5e9;
  --info-light: #38bdf8;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --danger: #ef4444;
  --danger-light: #f87171;
  
  /* Modern Blue Gradients */
  --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  --gradient-success: linear-gradient(135deg, #10B981 0%, #34D399 100%);
  --gradient-info: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --gradient-hero: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  --gradient-card: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
  
  /* Cool, accessible neutrals */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Shadows & Effects */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Border Radius */
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  
  /* Animation Timing */
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
  color: var(--gray-800);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessible Typography for Elderly Users */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: var(--gray-800);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

@media (min-width: 768px) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2.25rem; }
  h3 { font-size: 2rem; }
}

/* Modern Container */
.container, .container-fluid {
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container, .container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Headers */
header {
  background: var(--gradient-primary);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: slideDown var(--transition-normal);
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Modern Cards */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  background: var(--gradient-primary);
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  color: white;
}

.card-body {
  padding: 1.5rem;
}

/* Mobile-Optimized Navigation */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

nav .btn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

@media (max-width: 768px) {
  nav {
    width: 100%;
    justify-content: space-between;
    margin-top: 1rem;
  }
  
  nav .btn {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Buttons */
.btn {
  border-radius: var(--border-radius-md);
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px; /* Touch-friendly */
  cursor: pointer;
}

.btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left var(--transition-normal);
}

.btn:hover:before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
}

.btn-info {
  background: var(--gradient-info);
  color: white;
}

.btn-warning {
  background: var(--gradient-warning);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
  color: white;
}

/* Touch-friendly button sizes for elderly users */
.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.25rem;
  min-height: 56px;
}

.btn-sm {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  min-height: 48px;
}

/* Modern Forms */
.form-control, .form-select {
  border-radius: var(--border-radius-md);
  border: 2px solid var(--gray-400);
  background-color: white;
  transition: all var(--transition-fast);
  font-size: 1.125rem;
  min-height: 52px;
  padding: 1rem 1.25rem;
  color: var(--gray-800);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.form-label {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
}

/* Range Sliders */
.form-range {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--gradient-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

/* Alerts */
.alert {
  border-radius: var(--border-radius-lg);
  border: none;
  padding: 1rem 1.25rem;
  animation: fadeInUp var(--transition-normal);
  position: relative;
  overflow: hidden;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-primary {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-left: 4px solid var(--primary);
  color: var(--primary-dark);
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
  border-left: 4px solid var(--success);
  color: #065F46;
}

.alert-info {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(34, 211, 238, 0.1) 100%);
  border-left: 4px solid var(--info);
  color: #0C4A6E;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
  border-left: 4px solid var(--warning);
  color: #92400E;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(248, 113, 113, 0.1) 100%);
  border-left: 4px solid var(--danger);
  color: #991B1B;
}

/* Special Health Cards */
.health-card {
  background: var(--gradient-card);
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius-xl);
  padding: 1.5rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.health-card:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.health-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Voice Recording Animation */
.recording {
  animation: pulse 1.5s infinite;
  background: linear-gradient(45deg, #dc3545, #fd5e53) !important;
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.5) !important;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 20px rgba(220, 53, 69, 0.5); }
  50% { transform: scale(1.1); box-shadow: 0 0 30px rgba(220, 53, 69, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 20px rgba(220, 53, 69, 0.5); }
}

/* Voice button styling */
#voiceRecordBtn {
  font-size: 2rem;
  transition: all 0.3s ease;
  border: 3px solid white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#voiceRecordBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Speech status styling */
#voiceStatus {
  font-size: 1.1rem;
  font-weight: 500;
}

#voiceTranscript {
  border-left: 4px solid #17a2b8;
  background: rgba(23, 162, 184, 0.1);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Floating Action Effects */
.floating {
  position: relative;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Mobile-First Layout */
.mobile-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .mobile-stack {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Touch Improvements */
@media (pointer: coarse) {
  .btn, .form-control, .form-select {
    min-height: 48px;
  }
  
  .btn-sm {
    min-height: 40px;
  }
  
  .btn-lg {
    min-height: 56px;
  }
}

/* Summary Box */
.summary {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: pre-wrap;
  min-height: 120px;
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--gray-800);
  transition: all var(--transition-normal);
}

.summary:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Hero Section */
.hero {
  background: var(--gradient-hero);
  color: white;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Chart Container */
#healthChart {
  max-height: 300px;
  border-radius: var(--border-radius-md);
}

/* Responsive Grid */
.responsive-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .responsive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .responsive-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Badge Enhancements */
.badge {
  font-weight: 500;
  border-radius: var(--border-radius-sm);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* Improved Spacing */
.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1E293B;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-800: #F1F5F9;
    --gray-900: #F8FAFC;
  }
  
  body {
    background-color: var(--gray-50);
    color: var(--gray-800);
  }
  
  .card {
    background: linear-gradient(145deg, #2D3748 0%, #1A202C 100%);
    border-color: var(--gray-200);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }
  
  .card {
    border: 2px solid var(--gray-600);
  }
}

/* Accessibility improvements for elderly users */
.text-muted {
  color: var(--gray-600) !important;
  font-size: 1rem !important;
}

p {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

small {
  font-size: 1rem !important;
}

.btn {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Improved spacing for readability */
.card {
  margin-bottom: 2rem;
}

.health-card {
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Better contrast for badges */
.badge {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

/* Critical text contrast fixes for elderly users */
h1, h2, h3, h4, h5, h6 {
  color: var(--gray-800) !important;
  font-weight: 700 !important;
}

.text-primary {
  color: var(--primary-dark) !important;
}

header h1, header h2, header h3, header h4, header h5, header h6 {
  color: white !important;
}

header .text-primary {
  color: white !important;
}

nav a {
  color: white !important;
}

/* Blue background text fixes */
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-primary.bg-opacity-10 h1, .bg-primary.bg-opacity-10 h2, .bg-primary.bg-opacity-10 h3, 
.bg-primary.bg-opacity-10 h4, .bg-primary.bg-opacity-10 h5, .bg-primary.bg-opacity-10 h6 {
  color: white !important;
}

.bg-primary .text-primary, .bg-primary.bg-opacity-10 .text-primary {
  color: white !important;
}

/* Override Bootstrap bg-opacity-10 */
.bg-primary.bg-opacity-10 {
  background-color: var(--primary) !important;
  background: var(--gradient-primary) !important;
  opacity: 1 !important;
}

/* Absolutely force white text on any blue background */
[class*="bg-primary"] {
  color: white !important;
}

[class*="bg-primary"] * {
  color: white !important;
}

[class*="bg-primary"] .text-primary {
  color: white !important;
}

[class*="bg-primary"] .text-muted {
  color: rgba(255,255,255,0.9) !important;
}

.btn {
  font-weight: 700 !important;
  border-width: 2px !important;
}

.btn-primary {
  background: var(--gradient-primary) !important;
  color: white !important;
  border-color: var(--primary-dark) !important;
}

.btn-info {
  background: var(--gradient-info) !important;
  color: white !important;
  border-color: var(--info) !important;
}

.btn-success {
  background: #10B981 !important;
  color: white !important;
  border-color: #059669 !important;
}

.btn-warning {
  background: #F59E0B !important;
  color: white !important;
  border-color: #D97706 !important;
}

.btn-secondary {
  background: var(--gray-600) !important;
  color: white !important;
  border-color: var(--gray-700) !important;
}

.btn-outline-primary {
  background: white !important;
  color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  border-width: 3px !important;
}

.btn-outline-secondary {
  background: white !important;
  color: var(--gray-700) !important;
  border-color: var(--gray-700) !important;
  border-width: 3px !important;
}

header .btn-outline-primary {
  background: rgba(255,255,255,0.1) !important;
  color: white !important;
  border-color: white !important;
}

header .btn-secondary {
  background: rgba(255,255,255,0.2) !important;
  color: white !important;
  border-color: rgba(255,255,255,0.3) !important;
}

.btn-outline-danger {
  background: white !important;
  color: #DC2626 !important;
  border-color: #DC2626 !important;
  border-width: 3px !important;
}

.btn-outline-info {
  background: white !important;
  color: #0891B2 !important;
  border-color: #0891B2 !important;
  border-width: 3px !important;
}

/* Navigation and header text */
nav a {
  color: white !important;
}

/* Card text */
.card-header {
  color: white !important;
}

/* All text elements */
p, span, div, small {
  color: var(--gray-700) !important;
}

.text-muted {
  color: var(--gray-500) !important;
}

header p, header span, header div, header small {
  color: white !important;
}

/* Fix blue backgrounds text visibility - More specific targeting */
.bg-primary.bg-opacity-10 {
  background: var(--gradient-primary) !important;
}

.bg-primary.bg-opacity-10 *,
.bg-primary.bg-opacity-10 p,
.bg-primary.bg-opacity-10 span,
.bg-primary.bg-opacity-10 div,
.bg-primary.bg-opacity-10 small,
.bg-primary.bg-opacity-10 h1,
.bg-primary.bg-opacity-10 h2,
.bg-primary.bg-opacity-10 h3,
.bg-primary.bg-opacity-10 h4,
.bg-primary.bg-opacity-10 h5,
.bg-primary.bg-opacity-10 h6 {
  color: white !important;
}

.bg-primary.bg-opacity-10 .text-primary {
  color: white !important;
}

.bg-primary.bg-opacity-10 .text-muted {
  color: rgba(255,255,255,0.9) !important;
}

/* Target the specific greeting card */
.health-card.bg-primary.bg-opacity-10 {
  background: var(--gradient-primary) !important;
  color: white !important;
}

.health-card.bg-primary.bg-opacity-10 * {
  color: white !important;
}

.health-card.bg-primary.bg-opacity-10 .text-primary {
  color: white !important;
}

.health-card.bg-primary.bg-opacity-10 .text-muted {
  color: rgba(255,255,255,0.9) !important;
}

/* Links */
a {
  color: var(--primary-dark) !important;
  text-decoration: underline !important;
}

a:hover {
  color: var(--primary-light) !important;
}

header a:hover {
  color: rgba(255,255,255,0.8) !important;
}