body {
  padding-top: 0.5rem;
  padding-top: max(0.5rem, env(safe-area-inset-top));
  background-color: #f8f9fa;
}

.tab-content {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.message {
  margin-bottom: 1rem;
}

.message.user .message-content {
  background-color: #e3f2fd;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-left: 2rem;
}

.message.assistant .message-content {
  background-color: #f5f5f5;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-right: 2rem;
}

.message.system .message-content {
  background-color: #fff3cd;
  padding: 0.75rem;
  border-radius: 0.5rem;
  text-align: center;
  font-style: italic;
}

#messages-container {
  background-color: #fafafa;
  min-height: 400px;
}

#prompt-input {
  resize: vertical;
  min-height: 80px;
}

.conversation-pair {
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 1rem;
}

.conversation-pair:last-child {
  border-bottom: none;
}

/* Navbar with safe area support */
#main-navbar {
  padding-top: env(safe-area-inset-top);
}

#main-navbar .container {
  padding-top: 25px;
  padding-bottom: 25px;
}

.navbar-brand {
  font-weight: bold;
}

.card {
  transition: transform 0.2s ease-in-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

.message-image img {
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#image-preview-container .card {
  border: 1px dashed #6c757d;
  background-color: #f8f9fa;
}

.session-image {
  margin-bottom: 0.5rem;
}

.session-image img {
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.session-image img:hover {
  transform: scale(1.05);
}

.image-info {
  font-size: 0.8rem;
}

#image-input {
  cursor: pointer;
}

.input-group-text {
  cursor: pointer;
}

/* Typing indicator for streaming */
.message.assistant .message-content:empty::after {
  content: "●●●";
  animation: typing 1.4s infinite;
  color: #6c757d;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: initial;
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Nutrition Facts Label Styling */
.nutrition-label-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.nutrition-facts-label {
  background-color: white;
  border: 2px solid #000;
  padding: 0;
  width: 280px;
  font-family: Arial, sans-serif;
  font-size: 11px;
  line-height: 1.2;
  color: #000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nutrition-header {
  border-bottom: 2px solid #000;
  padding: 8px;
  text-align: center;
}

.food-name {
  font-size: 14px;
  font-weight: bold;
  margin: 0 0 4px 0;
  color: #2c3e50;
}

.nutrition-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
}

.serving-info {
  padding: 8px;
  border-bottom: 1px solid #000;
}

.serving-per-container {
  font-size: 10px;
  margin-bottom: 2px;
}

.serving-size {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.serving-amount {
  font-weight: bold;
}

.calories-section {
  padding: 8px;
  border-bottom: 8px solid #000;
}

.amount-per-serving {
  font-size: 10px;
  margin-bottom: 2px;
}

.calories-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 22px;
  font-weight: bold;
}

.calories-from-fat {
  font-size: 10px;
  text-align: right;
  margin-top: 2px;
}

.daily-value-header {
  padding: 4px 8px;
  background-color: #000;
  color: white;
  font-size: 10px;
  font-weight: bold;
  text-align: right;
}

.nutrients-section {
  padding: 0;
}

.nutrient-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 8px;
  border-bottom: 1px solid #000;
  font-size: 11px;
}

.nutrient-line.indent {
  padding-left: 16px;
}

.nutrient-line.sub-indent {
  padding-left: 24px;
}

.nutrient-name {
  flex-grow: 1;
}

.nutrient-amount {
  margin-right: 8px;
}

.nutrient-dv {
  font-weight: bold;
  min-width: 30px;
  text-align: right;
}

.vitamins-section {
  padding: 0;
  border-top: 2px solid #000;
}

.vitamin-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
}

.vitamin-name {
  flex-grow: 1;
}

.vitamin-amount {
  margin-right: 8px;
}

.vitamin-dv {
  font-weight: bold;
  min-width: 30px;
  text-align: right;
}

.footnote {
  padding: 8px;
  border-top: 1px solid #000;
  font-size: 9px;
  line-height: 1.3;
}

/* Nutrition summary badges */
.nutrition-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.nutrition-highlights .badge {
  font-size: 0.75rem;
}

.nutrition-quick-stats {
  background-color: #f8f9fa;
  padding: 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
}

/* Activity log styling (combines food and symptoms) */
#activity-log-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Activity filter buttons */
#activity-filter-buttons .btn {
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
  font-weight: 600;
}

#activity-filter-buttons .btn-check:checked + .btn {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

/* Activity item cards (unified styling) */
.activity-item-card {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.activity-item-card:hover {
  border-color: #007bff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.food-activity:hover {
  background-color: #f8f9fa;
}

.symptom-activity:hover {
  background-color: #fff8e1;
}

/* Enhanced activity card styling */
.activity-datetime {
  font-size: 0.75rem;
  line-height: 1.2;
}

.activity-relative-time {
  font-weight: 500;
  color: #6c757d;
}

.symptom-additional-info {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f3f4;
}

.severity-description {
  font-style: italic;
}

.activity-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.activity-type-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.food-indicator {
  background-color: #e3f2fd;
  color: #1976d2;
  border: 1px solid #2196f3;
}

.symptom-indicator {
  background-color: #fff8e1;
  color: #f57c00;
  border: 1px solid #ff9800;
}

.medicine-indicator {
  background-color: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ab47bc;
}

.activity-type-icon {
  font-size: 1rem;
  line-height: 1;
}

.activity-type-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.activity-timestamp {
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  border: 1px solid #e9ecef;
}

.activity-item-main {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.activity-item-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-right: 0.75rem;
  border: 1px solid #dee2e6;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.activity-item-image:hover {
  transform: scale(1.1);
}

.activity-item-info {
  flex: 1;
}

.activity-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.3;
}

.activity-details {
  color: #6c757d;
  font-size: 0.9rem;
  display: block;
  margin-top: 0.2rem;
}

.activity-nutrition-facts {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.activity-severity-badge {
  margin-left: auto;
}

.activity-severity-badge .badge {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
}

/* Food log list styling (legacy - now handled by activity styling) */
#food-log-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Symptoms log styling (legacy - now handled by activity styling) */
#symptoms-log-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.symptom-item-card {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.symptom-item-card:hover {
  background-color: #fff8e1;
  border-color: #ffc107;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.symptom-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.symptom-item-main {
  flex: 1;
}

.symptom-item-info {
  flex: 1;
}

.symptom-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.3;
}

.symptom-severity {
  color: #6c757d;
  font-size: 0.9rem;
  display: block;
  margin-top: 0.2rem;
}

.symptom-timestamp {
  color: #6c757d;
  font-size: 0.8rem;
  display: block;
  margin-top: 0.2rem;
}

.symptom-severity-badge {
  margin-left: 1rem;
}

.symptom-severity-badge .badge {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
}

/* Symptom modal styling */
#symptom-modal .modal-dialog {
  max-width: 700px;
}

.symptom-btn {
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.symptom-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.symptom-btn.active {
  background-color: #007bff !important;
  border-color: #007bff !important;
  color: white !important;
}

#severity-btn-group .btn {
  flex: 1;
  padding: 0.75rem;
  font-weight: 600;
}

#severity-btn-group .btn-outline-success:checked + label,
#severity-btn-group .btn-outline-success.active {
  background-color: #198754;
  border-color: #198754;
  color: white;
}

#severity-btn-group .btn-outline-warning:checked + label,
#severity-btn-group .btn-outline-warning.active {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

#severity-btn-group .btn-outline-danger:checked + label,
#severity-btn-group .btn-outline-danger.active {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}

#selected-symptom-preview {
  border-radius: 0.5rem;
  border: 1px solid #bee5eb !important;
  background-color: #d1ecf1 !important;
  color: #0c5460 !important;
}

/* Symptom actions modal styling */
#selected-symptom-info {
  background-color: #fff8e1;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #ffecb3;
}

#symptom-actions-buttons .btn {
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
}

#duplicate-symptom-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#delete-symptom-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.food-item-card {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.food-item-card:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.food-activity-processing {
  background-color: #f8f9fa;
  border-style: dashed;
  opacity: 0.8;
  cursor: wait;
}
.food-activity-processing .activity-name {
  font-style: italic;
  color: #6c757d;
}

.food-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.food-item-main {
  display: flex;
  align-items: center;
  flex: 1;
}

.food-item-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-right: 0.75rem;
  border: 1px solid #dee2e6;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.food-item-image:hover {
  transform: scale(1.1);
}

.food-item-info {
  flex: 1;
}

.food-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.3;
}

.food-serving {
  color: #6c757d;
  font-size: 0.9rem;
}

.food-timestamp {
  color: #6c757d;
  font-size: 0.8rem;
  display: block;
  margin-top: 0.2rem;
}


.food-nutrition-facts {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.nutrition-fact {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background-color: #f8f9fa;
  padding: 0.5rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid #e9ecef;
  min-width: fit-content;
}

.nutrition-icon {
  font-size: 1rem;
  line-height: 1;
}

.nutrition-value {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.95rem;
}

.nutrition-label {
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 500;
}

.nutrition-unit {
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 500;
}

/* Enhanced nutrition fact styling */
.calories-fact {
  background-color: #e3f2fd !important;
  border-color: #2196f3 !important;
}

.calories-fact .nutrition-value,
.calories-fact .nutrition-label {
  color: #1976d2 !important;
}

.protein-fact {
  background-color: #ffe0e6 !important;
  border-color: #ff8a95 !important;
}

.carbs-fact {
  background-color: #fff8e1 !important;
  border-color: #ffc947 !important;
}

.fat-fact {
  background-color: #e8f5e8 !important;
  border-color: #81c784 !important;
}

.fiber-fact {
  background-color: #f3e5f5 !important;
  border-color: #ba68c8 !important;
}

.sugar-fact {
  background-color: #fff3e0 !important;
  border-color: #ffb74d !important;
}

.sodium-fact {
  background-color: #fce4ec !important;
  border-color: #f48fb1 !important;
}

.vitamin-c-fact {
  background-color: #fff8e1 !important;
  border-color: #ffca28 !important;
}

.calcium-fact {
  background-color: #e8eaf6 !important;
  border-color: #9fa8da !important;
}

.potassium-fact {
  background-color: #e8f5e9 !important;
  border-color: #81c784 !important;
}

.iron-fact {
  background-color: #ffebee !important;
  border-color: #ef9a9a !important;
}

.vitamin-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f3f4;
}

#vitamins-section-title {
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  border-bottom: 1px dashed #dee2e6;
  padding-bottom: 0.25rem;
}

/* Daily totals card */
#daily-totals-card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#daily-totals-card .card-body {
  padding: 1.5rem;
}

/* Food entry modal - more compact */
#food-entry-modal .modal-dialog {
  max-width: 1200px;
}

#food-entry-modal .modal-body {
  padding: 1rem;
}

#food-entry-modal .modal-footer {
  padding: 0.5rem 1rem;
}

#food-entry-modal .modal-header {
  padding: 0.5rem 1rem;
}

/* Serving count input styling */
#edit-servings-count,
#adjust-serving-count {
  text-align: center;
  font-weight: 600;
  border: 2px solid #dee2e6;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#edit-servings-count:focus,
#adjust-serving-count:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Serving adjustment section in food actions modal */
#serving-adjustment-section {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1rem;
}

#serving-adjustment-title {
  color: #495057;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

#original-nutrition-display {
  background-color: #e9ecef;
  padding: 0.5rem;
  border-radius: 0.375rem;
  text-align: center;
}

#adjusted-nutrition-display {
  background-color: #d1eddd;
  border: 1px solid #198754;
  padding: 0.5rem;
  border-radius: 0.375rem;
  text-align: center;
  color: #146c43;
}

#save-serving-adjustment-btn {
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

#save-serving-adjustment-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#save-serving-adjustment-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(25, 135, 84, 0.3);
}

/* Image upload section styling - more compact */
#image-upload-section {
  border: 1px dashed #dee2e6;
  border-radius: 0.375rem;
  padding: 0.75rem;
  background-color: #f8f9fa;
  transition: border-color 0.3s ease;
}

#image-upload-section:hover {
  border-color: #007bff;
  background-color: #f1f8ff;
}

#images-preview-container {
  margin-top: 1rem;
}

.image-preview-card {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.image-preview-card img {
  transition: transform 0.2s ease;
}

.image-preview-card:hover img {
  transform: scale(1.05);
}

.image-preview-info {
  padding: 0.5rem;
  border-top: 1px solid #f1f3f4;
  background-color: #f8f9fa;
}

.image-preview-info small {
  font-size: 0.75rem;
  color: #6c757d;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Food description textarea styling - more compact */
#food-description-input {
  resize: vertical;
  min-height: 60px;
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  padding: 0.5rem;
  font-size: 0.9rem;
}

#food-description-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Analyze button styling - more compact */
#analyze-food-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
  padding: 0.5rem;
}

#analyze-food-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
}

#analyze-food-btn:disabled {
  background: #6c757d;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* AI analysis container styling */
#ai-analysis-container {
  margin-top: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  overflow: hidden;
}

#ai-messages-container {
  font-size: 0.9rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Nutrition results placeholder */
#nutrition-results-placeholder {
  border: 1px dashed #dee2e6;
  border-radius: 0.5rem;
  background-color: #f8f9fa;
  text-align: center;
  min-height: 80px;
}

#results-placeholder-icon {
  font-size: 1.5rem;
  opacity: 0.6;
}

/* Enhanced form styling for nutrition edit - more compact */
#nutrition-edit-form {
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
}

#nutrition-edit-form .form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

#nutrition-edit-form .form-control {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  height: calc(1.75rem + 2px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Vitamin input styling */
#vitamins-row .form-label {
  font-size: 0.9rem;
  font-weight: 500;
}

#vitamin-a-edit-col .form-control {
  border-left: 3px solid #ff9800;
  transition: all 0.3s ease;
}

#vitamin-c-edit-col .form-control {
  border-left: 3px solid #ffeb3b;
  transition: all 0.3s ease;
}

#vitamin-d-edit-col .form-control {
  border-left: 3px solid #4fc3f7;
  transition: all 0.3s ease;
}

#vitamin-e-edit-col .form-control {
  border-left: 3px solid #9ccc65;
  transition: all 0.3s ease;
}

/* Highlight for supplement values */
.supplement-highlight {
  background-color: #fffde7 !important;
  border: 2px solid #fbc02d !important;
  font-weight: 700 !important;
  color: #e65100 !important;
  box-shadow: 0 0 5px rgba(251, 192, 45, 0.5) !important;
}

/* Label highlighting for supplements */
.supplement-highlight ~ label {
  color: #e65100 !important;
  font-weight: 700 !important;
}

#calcium-edit-col .form-control {
  border-left: 3px solid #7986cb;
}

#iron-edit-col .form-control {
  border-left: 3px solid #ef5350;
}

#potassium-edit-col .form-control {
  border-left: 3px solid #66bb6a;
}

#sodium-edit-col .form-control {
  border-left: 3px solid #f06292;
}

#nutrition-edit-form .form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Save button styling */
#save-food-entry-btn {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  transition: all 0.3s ease;
}

#save-food-entry-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

#save-food-entry-btn:disabled {
  background: #6c757d;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

/* AI Analysis Loading State */
.ai-analyzing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.ai-analyzing::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.ai-thinking-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.ai-thinking-dots span {
  width: 8px;
  height: 8px;
  background-color: currentColor;
  border-radius: 50%;
  animation: thinking-bounce 1.4s infinite ease-in-out;
}

.ai-thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes thinking-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.ai-brain-icon {
  font-size: 1.5rem;
  animation: brain-pulse 2s infinite ease-in-out;
}

@keyframes brain-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.ai-analyzing-text {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
}

.ai-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background-color: rgba(255,255,255,0.3);
  border-radius: 0 0 0.5rem 0.5rem;
  animation: progress-fill 3s infinite ease-in-out;
}

@keyframes progress-fill {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* Success state for AI analysis */
.ai-analysis-complete {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  animation: success-fade-in 0.5s ease-out;
}

/* Supplement-specific styling */
.supplement-analysis {
  background: linear-gradient(135deg, #9c27b0 0%, #ba68c8 100%);
}

.supplement-info {
  animation: pulse-highlight 2s infinite ease-in-out;
}

@keyframes pulse-highlight {
  0%, 100% {
    background-color: #e3f2fd;
    border-color: #90caf9;
  }
  50% {
    background-color: #bbdefb;
    border-color: #64b5f6;
  }
}

@keyframes success-fade-in {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.ai-check-icon {
  font-size: 1.5rem;
  animation: check-bounce 0.6s ease-out;
}

@keyframes check-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Disabled save button state */
#save-food-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

#save-food-btn:disabled::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(108, 117, 125, 0.1);
  border-radius: inherit;
  pointer-events: none;
}

/* Form styling in modal */
#nutrition-edit-form .form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.25rem;
}

#nutrition-edit-form .form-control {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
}

#nutrition-edit-form .form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Food thumbnails in table */
.table img {
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.table img:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Image viewer modal */
#image-viewer-modal .modal-body {
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#image-viewer-image {
  border-radius: 0.375rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Date selector styling */
#date-selector-card {
  border: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

#date-selector-card .card-body {
  padding: 0.75rem 1rem;
}

#selected-date {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  padding: 0.375rem 0.75rem;
  font-size: 0.9rem;
  min-width: 140px;
}

#selected-date:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#date-navigation .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  min-width: 32px;
}

#date-label {
  color: #495057;
  font-size: 0.9rem;
}

/* Add food and symptom buttons */
#add-food-btn,
#add-symptom-btn {
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
  flex-shrink: 0;
}

#add-food-btn:hover:not(:disabled),
#add-symptom-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#add-food-btn:disabled,
#add-symptom-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

#button-group {
  min-width: fit-content;
}

/* Responsive design improvements */
@media (max-width: 768px) {
  .container {
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
  }

  .tab-content {
    padding: 0.75rem;
  }

  .navbar {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* Mobile date selector adjustments */
  #date-selector-content {
    flex-direction: column;
    gap: 0.75rem;
  }

  #date-input-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #date-label {
    margin-bottom: 0 !important;
    font-size: 0.85rem;
  }

  #selected-date {
    width: 100%;
    max-width: 200px;
  }

  #date-navigation {
    align-self: stretch;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
  }

  #date-navigation .btn {
    flex: 1;
    max-width: 80px;
    font-size: 0.7rem;
    padding: 0.4rem 0.25rem;
  }
  
  .message.user .message-content {
    margin-left: 1rem;
  }
  
  .message.assistant .message-content {
    margin-right: 1rem;
  }
  
  #prompt-input {
    min-height: 60px;
  }
  
  .message-image img {
    max-width: 150px !important;
    max-height: 150px !important;
  }

  .nutrition-facts-label {
    width: 260px;
    font-size: 10px;
  }

  .nutrition-title {
    font-size: 20px;
  }

  .calories-line {
    font-size: 18px;
  }

  /* Mobile table adjustments */
  .table-responsive {
    border: none;
    margin: 0 -0.5rem;
  }

  .table th,
  .table td {
    padding: 0.375rem 0.15rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .table th {
    font-size: 0.75rem;
  }

  #daily-totals-row .col-3 {
    margin-bottom: 0.75rem;
  }

  #daily-totals-card .card-body {
    padding: 1rem;
  }

  .mt-4 {
    margin-top: 1rem !important;
  }

  .mb-4 {
    margin-bottom: 1rem !important;
  }

  /* Mobile food entry modal responsive adjustments */
  #food-entry-modal .modal-dialog {
    max-width: 95%;
    margin: 1rem;
  }

  #food-entry-modal .modal-body {
    padding: 1rem;
  }

  #food-entry-row .col-md-6 {
    margin-bottom: 1.5rem;
  }

  #food-description-input {
    min-height: 70px;
    font-size: 0.9rem;
  }

  .image-preview-card {
    margin-bottom: 0.75rem;
  }

  #analyze-food-btn {
    font-size: 0.95rem;
    padding: 0.75rem;
  }

  #nutrition-edit-form {
    padding: 1rem;
  }

  #nutrition-edit-form .form-control {
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  /* Mobile serving adjustment responsive design */
  #serving-adjustment-section {
    padding: 0.75rem;
  }

  #serving-adjustment-title {
    font-size: 0.9rem;
  }

  #adjust-serving-count {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  #save-serving-adjustment-btn {
    font-size: 0.75rem;
    padding: 0.5rem;
  }

  #original-nutrition-display,
  #adjusted-nutrition-display {
    padding: 0.4rem;
    font-size: 0.8rem;
  }

  /* Mobile button layout - stack vertically only on mobile */
  #daily-log-header {
    flex-direction: column;
  }
  
  #log-title-col,
  #upload-button-col {
    text-align: center !important;
  }
  
  #button-group {
    justify-content: center !important;
    flex-direction: column;
  }

  #add-food-btn,
  #add-symptom-btn {
    width: 100%;
  }
}

/* Recent Foods Filmstrip - Compact */
#recent-foods-filmstrip {
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  position: relative;
}

#filmstrip-container {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 5px;
}

#filmstrip-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

/* Add scroll indicator arrows */
.filmstrip-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 5;
  opacity: 0.8;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.filmstrip-scroll-arrow:hover {
  opacity: 1;
  background-color: white;
}

.filmstrip-scroll-left {
  left: 10px;
}

.filmstrip-scroll-right {
  right: 10px;
}

@media (max-width: 768px) {
  .filmstrip-scroll-arrow {
    width: 24px;
    height: 24px;
    font-size: 1rem;
  }
}

.filmstrip-item {
  flex: 0 0 auto;
  width: 120px;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  margin-right: 8px;
  scroll-snap-align: start;
}

.filmstrip-item:last-child {
  margin-right: 0;
}

.filmstrip-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: #007bff;
}

.filmstrip-item-image {
  height: 80px;
  width: 100%;
  object-fit: cover;
  background-color: #e9ecef;
  display: flex;
  justify-content: center;
  align-items: center;
}

.filmstrip-item-info {
  padding: 0.5rem;
  text-align: center;
}

.filmstrip-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.4em;
}

.filmstrip-no-items {
  width: 100%;
  text-align: center;
  padding: 1.5rem;
  color: #6c757d;
  font-style: italic;
}

.filmstrip-use-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(13, 110, 253, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  font-size: 0.7rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.filmstrip-item:hover .filmstrip-use-btn {
  opacity: 1;
}

.filmstrip-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #adb5bd;
}

/* Body metrics modal styling */
#body-metrics-modal .modal-dialog {
  max-width: 500px;
}

#current-metrics-display {
  background-color: #e3f2fd;
  border-color: #90caf9;
}

#body-metrics-form .form-label {
  color: #495057;
}

#body-metrics-form .form-control,
#body-metrics-form .form-select {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#body-metrics-form .form-control:focus,
#body-metrics-form .form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#save-metrics-btn {
  background: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

#save-metrics-btn:hover {
  background: linear-gradient(135deg, #0bacce 0%, #0b5ed7 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

/* Make the track metrics button stand out */
#track-body-btn {
  background: linear-gradient(135deg, #0dcaf0 0%, #17a2b8 100%);
  border: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

#track-body-btn:hover {
  background: linear-gradient(135deg, #0bacce 0%, #138496 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

/* Responsive design for activity cards */
@media (max-width: 768px) {
  .activity-item-card {
    padding: 0.75rem;
  }

  .activity-item-image {
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
  }

  .activity-name {
    font-size: 1rem;
  }

  .activity-details {
    font-size: 0.8rem;
  }

  .activity-timestamp {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }

  .activity-type-indicator {
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
  }

  .activity-type-label {
    font-size: 0.75rem;
  }

  .activity-nutrition-facts {
    gap: 0.5rem;
  }

  .nutrition-fact {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  .nutrition-value {
    font-size: 0.85rem;
  }

  .nutrition-unit,
  .nutrition-label {
    font-size: 0.75rem;
  }

  .activity-severity-badge {
    margin-left: 0.5rem;
  }

  .activity-severity-badge .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  /* Activity filter buttons on mobile */
  #activity-filter-buttons .btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  /* Legacy responsive styling for food and symptom cards */
  .food-item-card {
    padding: 0.75rem;
  }

  .food-item-image {
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
  }

  .food-name {
    font-size: 1rem;
  }

  .food-serving {
    font-size: 0.8rem;
  }

  .food-timestamp {
    font-size: 0.7rem;
  }

  .food-nutrition-facts {
    gap: 0.5rem;
  }

  .symptom-item-card {
    padding: 0.75rem;
  }

  .symptom-name {
    font-size: 1rem;
  }

  .symptom-severity,
  .symptom-timestamp {
    font-size: 0.8rem;
  }

  .symptom-severity-badge {
    margin-left: 0.5rem;
  }

  .symptom-severity-badge .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  /* Symptom modal responsive adjustments */
  #symptom-modal .modal-dialog {
    max-width: 95%;
    margin: 1rem;
  }

  .symptom-btn {
    padding: 0.6rem;
    font-size: 0.8rem;
  }

  #severity-btn-group .btn {
    padding: 0.6rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .activity-item-card {
    padding: 0.5rem;
  }

  .activity-item-header {
    margin-bottom: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .activity-item-image {
    width: 35px;
    height: 35px;
    margin-right: 0.4rem;
  }

  .activity-name {
    font-size: 0.95rem;
  }

  .activity-details {
    font-size: 0.75rem;
  }

  .activity-timestamp {
    font-size: 0.7rem;
    padding: 0.15rem 0.3rem;
  }

  .activity-type-indicator {
    gap: 0.25rem;
    padding: 0.15rem 0.4rem;
  }

  .activity-type-label {
    font-size: 0.7rem;
  }

  .activity-nutrition-facts {
    gap: 0.4rem;
  }

  .nutrition-fact {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    min-width: auto;
  }

  .nutrition-icon {
    font-size: 0.9rem;
  }

  .nutrition-value {
    font-size: 0.8rem;
  }

  .nutrition-unit,
  .nutrition-label {
    font-size: 0.7rem;
  }

  .activity-severity-badge .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }

  /* Activity filter buttons on small screens */
  #activity-filter-buttons {
    width: 100%;
  }

  #activity-filter-buttons .btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
    flex: 1;
  }

  /* Food entry modal small screen adjustments */
  #food-entry-modal .modal-body {
    padding: 0.75rem;
  }

  #food-entry-row .col-md-6 {
    margin-bottom: 1rem;
  }

  #food-description-input {
    min-height: 60px;
    font-size: 0.85rem;
  }

  #image-upload-section {
    padding: 0.75rem;
  }

  .image-preview-card {
    margin-bottom: 0.5rem;
  }

  .image-preview-card img {
    height: 80px;
  }

  #analyze-food-btn {
    font-size: 0.9rem;
    padding: 0.65rem;
  }

  #nutrition-edit-form {
    padding: 0.75rem;
  }

  #nutrition-edit-form .form-control {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  #save-food-entry-btn {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
  }

  /* Small screen serving adjustment */
  #serving-adjustment-section {
    padding: 0.5rem;
  }

  #serving-adjustment-title {
    font-size: 0.85rem;
  }

  #serving-adjustment-row .col-6 {
    margin-bottom: 0.5rem;
  }

  #adjust-serving-count {
    font-size: 0.85rem;
    padding: 0.4rem;
  }

  #save-serving-adjustment-btn {
    font-size: 0.7rem;
    padding: 0.4rem;
  }

  #original-nutrition-display,
  #adjusted-nutrition-display {
    padding: 0.3rem;
    font-size: 0.75rem;
  }

  /* Legacy responsive styling */
  .food-item-card,
  .symptom-item-card {
    padding: 0.5rem;
  }

  .food-item-header,
  .symptom-item-header {
    margin-bottom: 0.5rem;
  }

  .food-item-image {
    width: 35px;
    height: 35px;
    margin-right: 0.4rem;
  }

  .food-name,
  .symptom-name {
    font-size: 0.95rem;
  }

  .food-serving,
  .symptom-severity {
    font-size: 0.75rem;
  }

  .food-timestamp,
  .symptom-timestamp {
    font-size: 0.65rem;
  }

  .food-nutrition-facts {
    gap: 0.4rem;
  }

  .symptom-severity-badge .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }

  .symptom-btn {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  #severity-btn-group .btn {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .activity-item-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .activity-type-indicator {
    align-self: flex-start;
  }

  .activity-timestamp {
    align-self: flex-end;
    font-size: 0.65rem;
  }

  .activity-nutrition-facts {
    gap: 0.3rem;
  }

  .nutrition-fact {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
  }

  .nutrition-icon {
    font-size: 0.8rem;
  }

  .nutrition-value {
    font-size: 0.75rem;
  }

  .nutrition-unit,
  .nutrition-label {
    font-size: 0.65rem;
  }

  .activity-severity-badge .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
  }

  /* Activity filter buttons on very small screens */
  #activity-filter-buttons .btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.3rem;
  }

  /* Legacy responsive styling */
  .food-nutrition-facts {
    gap: 0.3rem;
  }

  .symptom-severity-badge .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
  }

  .symptom-btn {
    padding: 0.4rem;
    font-size: 0.7rem;
  }

  #severity-btn-group .btn {
    padding: 0.4rem;
    font-size: 0.7rem;
  }
}

/* Allergen display styling */
.activity-allergens {
  margin-top: 0.5rem;
}

.allergen-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 0.375rem;
  font-size: 0.8rem;
}

.allergen-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.allergen-label {
  font-weight: 600;
  color: #856404;
  flex-shrink: 0;
}

.allergen-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
}

.allergen-badge {
  background-color: #dc3545;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 0.75rem;
  text-transform: capitalize;
  white-space: nowrap;
}

/* Exercise activity card styling */
.exercise-activity {
  background-color: #e8f5e9;
  border-color: #81c784;
}

.exercise-activity:hover {
  background-color: #c8e6c9;
  border-color: #66bb6a;
}

.medicine-activity {
  background-color: #f3e5f5;
  border-color: #ce93d8;
}

.medicine-activity:hover {
  background-color: #e1bee7;
  border-color: #ba68c8;
}

.exercise-indicator {
  background-color: #c8e6c9;
  color: #2e7d32;
  border: 1px solid #81c784;
}

.exercise-indicators {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: 1rem;
}

.exercise-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e9ecef;
  min-width: fit-content;
}

.exercise-icon {
  font-size: 1rem;
  line-height: 1;
}

.exercise-value {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.95rem;
}

.exercise-unit {
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 500;
}

.duration-indicator {
  background-color: #e3f2fd !important;
  border-color: #2196f3 !important;
}

.calories-indicator {
  background-color: #ffe0e6 !important;
  border-color: #ff8a95 !important;
}

.speed-indicator {
  background-color: #fff8e1 !important;
  border-color: #ffc947 !important;
}

.exercise-note {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f3f4;
}

/* Exercise modal styling */
#exercise-modal .modal-dialog {
  max-width: 600px;
}

.exercise-btn {
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.exercise-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.exercise-btn.active {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
  color: white !important;
}

#exercise-details-row .form-control {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#exercise-details-row .form-control:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

#selected-exercise-preview {
  border-color: #c3e6cb !important;
  background-color: #d4edda !important;
  color: #155724 !important;
}

/* Exercise actions modal styling */
#selected-exercise-info {
  background-color: #e8f5e9;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #c8e6c9;
}

#exercise-actions-buttons .btn {
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
}

/* Medicine actions modal styling */
#selected-medicine-info {
    background-color: #f3e5f5;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e1bee7;
}

#medicine-actions-buttons .btn {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
}

/* Responsive exercise styling */
@media (max-width: 768px) {
  .exercise-indicators {
    flex-direction: row;
    flex-wrap: wrap;
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .exercise-indicator {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
  
  .exercise-icon {
    font-size: 0.9rem;
  }
  
  .exercise-value {
    font-size: 0.85rem;
  }
  
  .exercise-unit {
    font-size: 0.75rem;
  }
  
  #exercise-modal .modal-dialog {
    max-width: 95%;
    margin: 1rem;
  }
  
  .exercise-btn {
    padding: 0.6rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .exercise-indicators {
    gap: 0.4rem;
  }
  
  .exercise-indicator {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .exercise-icon {
    font-size: 0.8rem;
  }
  
  .exercise-value {
    font-size: 0.8rem;
  }
  
  .exercise-unit {
    font-size: 0.7rem;
  }
  
  .exercise-btn {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
}

/* Responsive allergen styling */
@media (max-width: 768px) {
  .allergen-warning {
    padding: 0.4rem;
    font-size: 0.75rem;
    gap: 0.4rem;
  }
  
  .allergen-icon {
    font-size: 0.9rem;
  }
  
  .allergen-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
}

@media (max-width: 576px) {
  .allergen-warning {
    flex-direction: column;
    gap: 0.3rem;
  }
  
  .allergen-list {
    gap: 0.2rem;
  }
  
  .allergen-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
  }
}

/* Food actions modal styling */
#food-actions-modal .modal-dialog {
  margin: 1rem;
}

/* Desktop modal adjustments */
@media (min-width: 768px) {
  #food-actions-modal .modal-dialog {
    max-width: 500px;
    margin: 3rem auto;
  }
}

#selected-food-info {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
}

#selected-food-image {
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#food-actions-buttons .btn {
  padding: 0.75rem 1rem;
  font-weight: 600;
}

#duplicate-food-btn {
  border-radius: 0.5rem;
}

#delete-food-btn {
  border-radius: 0.5rem;
}

#duplicate-food-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#delete-food-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Desktop improvements for food actions modal */
@media (min-width: 992px) {
  #food-actions-buttons {
    display: flex;
    gap: 0.5rem;
  }
  
  #food-actions-buttons .btn {
    flex: 1;
  }
  
  #selected-food-info {
    padding: 1.25rem;
  }
  
  #selected-food-details h6 {
    font-size: 1.1rem;
  }
}

/* Time adjustment modal styling */
#time-adjust-modal .modal-dialog {
  max-width: 500px;
}

#time-adjust-info .alert {
  background-color: #e7f3ff;
  border-color: #b3d9ff;
  color: #004085;
}

#time-adjust-input {
  font-size: 1.1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 2px solid #ced4da;
  text-align: center;
}

#time-adjust-input:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#quick-adjust-group .btn {
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  padding: 0.6rem 0.4rem;
  position: relative;
  border: 1px solid #ced4da;
  background-color: #ffffff;
  color: #495057;
}

#quick-adjust-group .btn:hover {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.25);
}

#quick-adjust-group .btn:active {
  transform: translateY(0);
  background-color: #0056b3;
  border-color: #0056b3;
  color: white;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

#quick-adjust-group .btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Visual feedback for multiple taps */
#quick-adjust-group .btn.btn-tapped {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
  color: white !important;
  animation: tap-feedback 0.3s ease;
}

@keyframes tap-feedback {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

#time-validation-warning {
  border-color: #ffc107;
  background-color: #fff3cd;
  color: #856404;
}

#time-adjust-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive time adjustment modal */
@media (max-width: 768px) {
  #time-adjust-modal .modal-dialog {
    max-width: 95%;
    margin: 1rem;
    margin-top: max(1rem, env(safe-area-inset-top));
    margin-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  
  #quick-adjust-group .btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.3rem;
  }
  
  #time-adjust-input {
    font-size: 1rem;
    padding: 0.6rem;
  }
}

@media (max-width: 576px) {
  #quick-adjust-group .btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.25rem;
  }
  
  #time-adjust-input {
    font-size: 0.95rem;
    padding: 0.5rem;
  }
}

/* Enhanced food and symptom action buttons */
#food-actions-buttons .btn,
#symptom-actions-buttons .btn {
  transition: all 0.2s ease;
  border-radius: 0.5rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
}

#adjust-food-time-btn,
#adjust-symptom-time-btn {
  border-color: #007bff;
  color: #007bff;
}

#adjust-food-time-btn:hover,
#adjust-symptom-time-btn:hover {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Analysis tab styling */
#analysis-tab {
  min-height: 600px;
}

#analysis-date-range {
  min-width: 200px;
}

#analysis-date-inputs {
  align-items: center;
}

#analysis-start-date,
#analysis-end-date {
  max-width: 140px;
}

#analysis-date-separator {
  font-size: 0.9rem;
  color: #6c757d;
  white-space: nowrap;
}

#analysis-filters .btn {
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
  font-weight: 600;
}

#analysis-filters .btn-check:checked + .btn {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

#analysis-table-card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#analysis-table {
  font-size: 0.9rem;
}

#analysis-table th {
  font-weight: 600;
  color: #495057;
  font-size: 0.85rem;
  border-bottom: 2px solid #dee2e6;
  padding: 1rem 0.75rem;
}

#analysis-table td {
  padding: 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f3f4;
}

.analysis-row:hover {
  background-color: #f8f9fa;
}

.food-row:hover {
  background-color: #f8f9fa;
}

.symptom-row:hover {
  background-color: #fff8e1;
}

.medicine-row:hover {
  background-color: #f3e5f5;
}

.type-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.food-badge {
  background-color: #e3f2fd;
  color: #1976d2;
  border: 1px solid #2196f3;
}

.symptom-badge {
  background-color: #fff8e1;
  color: #f57c00;
  border: 1px solid #ff9800;
}

.medicine-badge {
  background-color: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ab47bc;
}

.severity-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.allergen-tag {
  display: inline-block;
  background-color: #dc3545;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 0.5rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  text-transform: capitalize;
}

.food-name-cell strong {
  color: #2c3e50;
  font-size: 0.95rem;
}

.nutrition-summary {
  color: #6c757d;
  font-size: 0.8rem;
  line-height: 1.3;
}

.symptom-description {
  color: #6c757d;
  font-size: 0.8rem;
  line-height: 1.3;
  font-style: italic;
}

.analysis-date,
.analysis-time {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: #495057;
  white-space: nowrap;
}

.analysis-name {
  min-width: 200px;
  max-width: 250px;
}

.analysis-details {
  min-width: 180px;
  max-width: 220px;
}

.analysis-allergens,
.analysis-severity {
  min-width: 120px;
}

/* Analysis responsive design */
@media (max-width: 768px) {
  #analysis-header {
    margin-bottom: 2rem;
  }
  
  #analysis-title-col,
  #analysis-controls-col {
    margin-bottom: 1rem;
  }
  
  #analysis-controls-col {
    text-align: left !important;
  }
  
  #analysis-date-range {
    min-width: auto;
    margin-bottom: 1rem;
  }
  
  #analysis-date-inputs {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  #analysis-start-date,
  #analysis-end-date {
    max-width: none;
    width: 100%;
  }
  
  #analysis-date-separator {
    display: none;
  }
  
  #analysis-filters {
    width: 100%;
  }
  
  #analysis-filters .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }
  
  #analysis-table {
    font-size: 0.8rem;
  }
  
  #analysis-table th {
    font-size: 0.75rem;
    padding: 0.75rem 0.5rem;
  }
  
  #analysis-table td {
    padding: 0.5rem;
  }
  
  .analysis-name {
    min-width: 150px;
    max-width: 180px;
  }
  
  .analysis-details {
    min-width: 120px;
    max-width: 150px;
  }
  
  .type-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  .severity-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  .allergen-tag {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    margin-right: 0.15rem;
    margin-bottom: 0.15rem;
  }
}

@media (max-width: 576px) {
  #analysis-table th,
  #analysis-table td {
    padding: 0.4rem 0.3rem;
    font-size: 0.75rem;
  }
  
  #analysis-table th {
    font-size: 0.7rem;
  }
  
  .analysis-date,
  .analysis-time {
    font-size: 0.75rem;
  }
  
  .food-name-cell strong {
    font-size: 0.85rem;
  }
  
  .nutrition-summary,
  .symptom-description {
    font-size: 0.75rem;
  }
  
  .analysis-name {
    min-width: 120px;
    max-width: 140px;
  }
  
  .analysis-details {
    min-width: 100px;
    max-width: 120px;
  }
  
  .type-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
  }
  
  .severity-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
  }
  
  .allergen-tag {
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
  }
}

/* Horizontal scroll for very small screens */
@media (max-width: 480px) {
  #analysis-table-container {
    overflow-x: auto;
  }
  
  #analysis-table {
    min-width: 600px;
  }
  
  .analysis-th-details,
  .analysis-details {
    display: none;
  }
}

/* AI Analysis Section Styling */
#analysis-ai-section .card {
  border: 2px solid #e3f2fd;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

#analysis-ai-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: none;
}

#analysis-ai-title {
  font-weight: 600;
}

#reset-prompts-btn {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

#reset-prompts-btn:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Prompt configuration styling */
#analysis-ai-prefix,
#analysis-ai-suffix {
  border-radius: 0.5rem;
  border: 2px solid #dee2e6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#analysis-ai-prefix:focus,
#analysis-ai-suffix:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

#prefix-label,
#suffix-label {
  color: #495057;
  font-size: 0.95rem;
}

#prefix-help,
#suffix-help {
  font-size: 0.8rem;
  color: #6c757d;
}

/* AI Analysis button styling */
#analyze-ai-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 1rem 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

#analyze-ai-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

#analyze-ai-btn:disabled {
  background: #6c757d;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* AI Response styling */
.ai-response-content {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  padding: 1.5rem;
  min-height: 400px;
  max-height: 600px;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #2c3e50;
}

/* Markdown rendering styles for AI response */
.ai-response-content h1 {
  color: #2c3e50;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2rem 0 1rem 0;
  border-bottom: 3px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.ai-response-content h2 {
  color: #2c3e50;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.ai-response-content h3 {
  color: #495057;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem 0;
}

.ai-response-content h4 {
  color: #6c757d;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
}

.ai-response-content h5 {
  color: #6c757d;
  font-size: 1rem;
  font-weight: 600;
  margin: 0.75rem 0 0.5rem 0;
}

.ai-response-content h6 {
  color: #6c757d;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.5rem 0 0.5rem 0;
}

.ai-response-content ul,
.ai-response-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.ai-response-content li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.ai-response-content ul ul,
.ai-response-content ol ol,
.ai-response-content ul ol,
.ai-response-content ol ul {
  margin: 0.25rem 0;
}

.ai-response-content blockquote {
  border-left: 4px solid #007bff;
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  background-color: #f8f9fa;
  color: #495057;
  font-style: italic;
}

.ai-response-content code {
  background-color: #f1f3f4;
  color: #d63384;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
}

.ai-response-content pre {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-size: 0.875rem;
}

.ai-response-content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

.ai-response-content table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  border: 1px solid #dee2e6;
}

.ai-response-content th,
.ai-response-content td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.ai-response-content th {
  background-color: #f8f9fa;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
}

.ai-response-content strong,
.ai-response-content b {
  color: #2c3e50;
  font-weight: 600;
}

.ai-response-content em,
.ai-response-content i {
  color: #495057;
  font-style: italic;
}

.ai-response-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.ai-response-content hr {
  border: none;
  border-top: 2px solid #e9ecef;
  margin: 2rem 0;
}

.ai-response-content a {
  color: #007bff;
  text-decoration: none;
}

.ai-response-content a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.ai-response-content h2 {
  color: #2c3e50;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.ai-response-content h3 {
  color: #495057;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem 0;
}

.ai-response-content h4 {
  color: #6c757d;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
}

.ai-response-content ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.ai-response-content li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.ai-response-content strong {
  color: #2c3e50;
  font-weight: 600;
}

.ai-response-content em {
  color: #495057;
  font-style: italic;
}

.ai-response-content p {
  margin-bottom: 1rem;
}

/* AI thinking animation */
.ai-thinking {
  text-align: center;
  color: #667eea;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 2rem;
  animation: pulse-thinking 2s infinite ease-in-out;
}

@keyframes pulse-thinking {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* AI Response placeholder styling */
.ai-response-placeholder {
  background-color: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 0.75rem;
  padding: 2rem;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#response-placeholder-content {
  max-width: 300px;
}

#response-placeholder-icon {
  opacity: 0.6;
  animation: float-icon 3s infinite ease-in-out;
}

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

#response-placeholder-title {
  color: #495057;
  font-weight: 600;
  margin-bottom: 1rem;
}

#response-placeholder-text {
  color: #6c757d;
  margin-bottom: 1rem;
  line-height: 1.5;
}

#response-placeholder-subtext {
  color: #adb5bd;
  line-height: 1.4;
}

/* Prompt and response text areas styling */
#full-prompt-text,
#raw-response-text {
  resize: vertical;
  background-color: #f8f9fa !important;
  border: 1px solid #dee2e6;
  font-family: 'Courier New', Monaco, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #495057;
}

#full-prompt-text:focus,
#raw-response-text:focus {
  background-color: #f8f9fa !important;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

#full-prompt-label,
#raw-response-label {
  color: #495057;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

#full-prompt-help,
#raw-response-help {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Responsive AI analysis section */
@media (max-width: 768px) {
  #analysis-ai-row .col-lg-6 {
    margin-bottom: 2rem;
  }
  
  #analysis-ai-prefix,
  #analysis-ai-suffix {
    font-size: 0.85rem;
  }
  
  #full-prompt-text,
  #raw-response-text {
    font-size: 0.75rem;
    rows: 4;
  }
  
  #analyze-ai-btn {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }
  
  .ai-response-content {
    min-height: 300px;
    max-height: 400px;
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  .ai-response-content h1 {
    font-size: 1.4rem;
  }
  
  .ai-response-content h2 {
    font-size: 1.2rem;
  }
  
  .ai-response-content h3 {
    font-size: 1.1rem;
  }
  
  .ai-response-content h4 {
    font-size: 1rem;
  }
  
  .ai-response-placeholder {
    padding: 1.5rem;
    min-height: 300px;
  }
  
  #response-placeholder-content {
    max-width: 250px;
  }
  
  #response-placeholder-icon {
    font-size: 2.5rem;
  }
  
  #response-placeholder-title {
    font-size: 1rem;
  }
  
  #response-placeholder-text {
    font-size: 0.9rem;
  }
  
  #response-placeholder-subtext {
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  #analysis-ai-body {
    padding: 1rem;
  }
  
  #analysis-ai-prefix,
  #analysis-ai-suffix {
    font-size: 0.8rem;
  }
  
  #full-prompt-text,
  #raw-response-text {
    font-size: 0.7rem;
    rows: 3;
  }
  
  #prefix-help,
  #suffix-help,
  #full-prompt-help,
  #raw-response-help {
    font-size: 0.7rem;
  }
  
  #analyze-ai-btn {
    font-size: 0.95rem;
    padding: 0.7rem 1.25rem;
  }
  
  .ai-response-content {
    min-height: 250px;
    max-height: 350px;
    padding: 0.75rem;
    font-size: 0.85rem;
  }
  
  .ai-response-content h1 {
    font-size: 1.2rem;
  }
  
  .ai-response-content h2 {
    font-size: 1.1rem;
  }
  
  .ai-response-content h3 {
    font-size: 1rem;
  }
  
  .ai-response-placeholder {
    padding: 1rem;
    min-height: 250px;
  }
  
  #response-placeholder-icon {
    font-size: 2rem;
  }
  
  #reset-prompts-btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}

@media (max-width: 400px) {
  #analysis-ai-prefix,
  #analysis-ai-suffix {
    rows: 6;
  }
  
  #full-prompt-text,
  #raw-response-text {
    font-size: 0.65rem;
    rows: 3;
  }
  
  #analyze-ai-btn {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }
  
  .ai-response-content {
    min-height: 200px;
    max-height: 300px;
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .ai-response-content h1 {
    font-size: 1.1rem;
  }
  
  .ai-response-content h2 {
    font-size: 1rem;
  }
  
  .ai-response-content h3 {
    font-size: 0.95rem;
  }
  
  .ai-response-placeholder {
    padding: 0.75rem;
    min-height: 200px;
  }
  
  #response-placeholder-content {
    max-width: 200px;
  }
}

#auto-id-35,
#auto-id-37 {
  color: #0d2a4c; /* dark blue */
}

/* Carb Cycling Page Styling */
#carb-cycling-tab .card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#user-info-form .form-label {
  font-weight: 600;
  color: #495057;
}

#user-info-form .form-control,
#user-info-form .form-select {
  border-radius: 0.5rem;
  border: 1px solid #ced4da;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#user-info-form .form-control:focus,
#user-info-form .form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Weight change goal input styling */
#weight-change-goal {
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
}

#weight-change-goal:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

#goal-help {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #6c757d;
}

/* Metabolism info cards */
.info-card {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 0.75rem;
  text-align: center;
  border: 1px solid #e9ecef;
  height: 100%;
}

.info-title {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.info-value {
  font-size: 2rem;
  font-weight: 700;
  color: #495057;
  margin-bottom: 0.25rem;
}

.info-description {
  color: #6c757d;
  font-size: 0.8rem;
}

/* Macro target cards */
.macro-target-card {
  border: 2px solid;
  border-radius: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.macro-target-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.low-carb-card {
  border-color: #dc3545;
}

.low-carb-card .card-header {
  background-color: #dc3545;
  color: white;
  border-bottom: none;
}

.medium-carb-card {
  border-color: #ffc107;
}

.medium-carb-card .card-header {
  background-color: #ffc107;
  color: #212529;
  border-bottom: none;
}

.high-carb-card {
  border-color: #28a745;
}

.high-carb-card .card-header {
  background-color: #28a745;
  color: white;
  border-bottom: none;
}

.macro-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f3f4;
}

.macro-item:last-child {
  border-bottom: none;
}

.macro-label {
  font-weight: 500;
  color: #6c757d;
  font-size: 0.9rem;
}

.macro-value {
  font-weight: 700;
  color: #495057;
  font-size: 1.1rem;
}

/* Target selection and daily progress styling */
#target-selection-card {
  border: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

#daily-target-selection {
  border-radius: 0.5rem;
  border: 2px solid #ced4da;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#daily-target-selection:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#daily-target-selection:disabled {
  background-color: #e9ecef;
  opacity: 0.65;
}

.macro-progress-item {
  position: relative;
}

.target-display {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.remaining-display {
  margin-top: 0.25rem;
}

.remaining-display small {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Enhanced daily totals with targets */
#daily-totals-card {
  border: 1px solid #dee2e6;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

#carb-cycling-setup-btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  font-weight: 600;
}

/* Guidelines alert styling */
#guidelines-alert {
  background-color: #e7f3ff;
  border-color: #b3d9ff;
  color: #004085;
}

#guidelines-list li {
  margin-bottom: 0.5rem;
}

#guidelines-list li:last-child {
  margin-bottom: 0;
}

/* Save button styling */
#save-carb-cycling-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

#save-carb-cycling-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

#save-carb-cycling-btn:disabled {
  background: #6c757d;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

/* Responsive carb cycling design */
@media (max-width: 768px) {
  #carb-cycling-header {
    margin-bottom: 2rem;
  }
  
  #carb-cycling-title-col,
  #carb-cycling-actions-col {
    margin-bottom: 1rem;
    text-align: center !important;
  }
  
  .info-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .info-value {
    font-size: 1.5rem;
  }
  
  .macro-target-card {
    margin-bottom: 1rem;
  }
  
  .macro-item {
    padding: 0.4rem 0;
  }
  
  .macro-label {
    font-size: 0.8rem;
  }
  
  .macro-value {
    font-size: 1rem;
  }
  
  #target-selection-col {
    margin-bottom: 1rem;
  }
  
  #daily-target-selection {
    font-size: 0.9rem;
  }
  
  .target-display {
    font-size: 0.75rem;
  }
  
  .remaining-display small {
    font-size: 0.7rem;
  }
}

@media (max-width: 576px) {
  #user-info-form .col-md-6 {
    margin-bottom: 1rem;
  }
  
  .info-card {
    padding: 0.75rem;
  }
  
  .info-value {
    font-size: 1.3rem;
  }
  
  .info-title {
    font-size: 0.8rem;
  }
  
  .macro-target-card .card-header h6 {
    font-size: 0.9rem;
  }
  
  .macro-target-card .card-header small {
    font-size: 0.75rem;
  }
  
  .macro-item {
    padding: 0.3rem 0;
  }
  
  .macro-label {
    font-size: 0.75rem;
  }
  
  .macro-value {
    font-size: 0.9rem;
  }
  
  #guidelines-list {
    font-size: 0.8rem;
  }
  
  #save-carb-cycling-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  #daily-target-selection {
    font-size: 0.8rem;
  }
  
  .target-display {
    font-size: 0.7rem;
  }
  
  .remaining-display small {
    font-size: 0.65rem;
  }
}

/* Extra small screens - very compact layout */
@media (max-width: 400px) {
  .container {
    padding-left: max(0.25rem, env(safe-area-inset-left));
    padding-right: max(0.25rem, env(safe-area-inset-right));
  }

  .tab-content {
    padding: 0.5rem;
  }

  .table th,
  .table td {
    padding: 0.25rem 0.1rem;
    font-size: 0.7rem;
  }

  .table th {
    font-size: 0.65rem;
  }

  .table img {
    width: 16px !important;
    height: 16px !important;
    margin-right: 2px !important;
  }

  .btn-sm {
    padding: 0.15rem 0.3rem;
    font-size: 0.65rem;
  }

  #daily-totals-card .card-body {
    padding: 0.75rem;
  }

  #daily-totals-row .col-3 h3 {
    font-size: 1.2rem;
  }

  #daily-totals-row .col-3 small {
    font-size: 0.7rem;
  }

  /* Extra small screen date selector */
  #date-selector-card .card-body {
    padding: 0.5rem;
  }

  #date-navigation .btn {
    font-size: 0.65rem;
    padding: 0.3rem 0.2rem;
    min-width: 28px;
  }

  #selected-date {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

  #date-label {
    font-size: 0.8rem;
  }

  /* Time adjustment modal on very small screens */
  #time-adjust-modal .modal-dialog {
    margin: 0.5rem;
    margin-top: max(0.5rem, env(safe-area-inset-top));
    margin-bottom: max(0.5rem, env(safe-area-inset-bottom));
    margin-left: max(0.5rem, env(safe-area-inset-left));
    margin-right: max(0.5rem, env(safe-area-inset-right));
  }
  
  #quick-adjust-group .btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.2rem;
  }
  
  #time-adjust-input {
    font-size: 0.9rem;
    padding: 0.4rem;
  }
  
  #food-actions-buttons .btn,
  #symptom-actions-buttons .btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }
  
  /* Analysis tab on very small screens */
  #analysis-table {
    min-width: 550px;
  }
  
  #analysis-filters .btn {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
  }
  
  .analysis-th-allergens,
  .analysis-allergens,
  .analysis-severity {
    display: none;
  }
  
  /* Carb cycling on extra small screens */
  .info-card {
    padding: 0.5rem;
  }
  
  .info-value {
    font-size: 1.1rem;
  }
  
  .info-title {
    font-size: 0.75rem;
  }
  
  .macro-target-card .card-header {
    padding: 0.5rem;
  }
  
  .macro-target-card .card-body {
    padding: 0.75rem;
  }
  
  .macro-item {
    padding: 0.25rem 0;
  }
  
  .macro-label {
    font-size: 0.7rem;
  }
  
  .macro-value {
    font-size: 0.8rem;
  }
  
  #target-selection-card .card-body {
    padding: 0.75rem;
  }
  
  #daily-target-selection {
    font-size: 0.75rem;
  }
  
  /* Recent foods modal on very small screens */
  .recent-foods-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  .recent-food-item {
    padding: 0.5rem !important;
  }
  
  .recent-food-image-container {
    height: 60px !important;
  }
  
  .recent-food-name {
    font-size: 0.8rem !important;
  }
  
  .recent-food-serving {
    font-size: 0.65rem !important;
  }
  
  .recent-food-macros .macro-item {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.3rem !important;
  }
  
  .last-eaten {
    font-size: 0.6rem !important;
  }
}

/* Recent Foods Modal Styling */
#recent-foods-modal .modal-dialog {
  max-width: 1200px;
}

#recent-foods-modal .modal-body {
  padding: 1.5rem;
}

.recent-foods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.recent-food-item {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.recent-food-item:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.recent-food-item.adding {
  background-color: #e9ecef;
  border-color: #007bff;
  position: relative;
}

.recent-food-item.adding::after {
  content: "Adding...";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 123, 255, 0.1);
  font-weight: 600;
  color: #007bff;
  border-radius: 0.75rem;
}

.recent-food-image-container {
  position: relative;
  width: 100%;
  height: 120px;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 0.75rem;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recent-food-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.recent-food-image.loaded {
  opacity: 1;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.recent-food-item:hover .image-overlay {
  opacity: 1;
}

.image-overlay-icon {
  font-size: 2rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.no-image-placeholder {
  width: 100%;
  height: 100%;
  background-color: #f8f9fa;
  border: 2px dashed #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.no-image-icon {
  font-size: 3rem;
  color: #adb5bd;
}

.recent-food-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.recent-food-name {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-food-serving {
  color: #6c757d;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-food-macros {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.recent-food-macros .macro-item {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.recent-food-macros .macro-value {
  font-weight: 600;
  color: #495057;
}

.recent-food-macros .macro-unit {
  color: #6c757d;
  font-size: 0.7rem;
}

.recent-food-macros .calories {
  background-color: #e3f2fd;
  border-color: #2196f3;
}

.recent-food-macros .calories .macro-value {
  color: #1976d2;
}

.recent-food-macros .protein {
  background-color: #ffe0e6;
  border-color: #ff8a95;
}

.recent-food-macros .carbs {
  background-color: #fff8e1;
  border-color: #ffc947;
}

.recent-food-macros .fat {
  background-color: #e8f5e8;
  border-color: #81c784;
}

.recent-food-date {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f3f4;
}

.last-eaten {
  color: #6c757d;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Toast notifications with safe area support */
.toast-notification {
  top: calc(20px + env(safe-area-inset-top)) !important;
  right: calc(20px + env(safe-area-inset-right)) !important;
}

/* Toast notification animations */
@keyframes slideInRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Responsive recent foods modal */
@media (max-width: 768px) {
  #recent-foods-modal .modal-dialog {
    max-width: 95%;
    margin: 1rem;
  }
  
  #recent-foods-modal .modal-body {
    padding: 1rem;
  }
  
  .recent-foods-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
  }
  
  .recent-food-item {
    padding: 0.75rem;
  }
  
  .recent-food-image-container {
    height: 100px;
    margin-bottom: 0.5rem;
  }
  
  .recent-food-name {
    font-size: 0.95rem;
  }
  
  .recent-food-serving {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }
  
  .recent-food-macros {
    gap: 0.4rem;
    margin-bottom: 0.5rem;
  }
  
  .recent-food-macros .macro-item {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
  
  .recent-food-date {
    padding-top: 0.4rem;
  }
  
  .last-eaten {
    font-size: 0.7rem;
  }
}

@media (max-width: 576px) {
  .recent-foods-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
  }
  
  .recent-food-item {
    padding: 0.6rem;
  }
  
  .recent-food-image-container {
    height: 80px;
  }
  
  .recent-food-name {
    font-size: 0.9rem;
  }
  
  .recent-food-serving {
    font-size: 0.7rem;
  }
  
  .recent-food-macros .macro-item {
    padding: 0.15rem 0.3rem;
    font-size: 0.65rem;
  }
  
  .last-eaten {
    font-size: 0.65rem;
  }
  
  .image-overlay-icon {
    font-size: 1.5rem;
  }
  
  .no-image-icon {
    font-size: 2rem;
  }
}

/* Authentication Loading Screen */
.auth-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.auth-loading-container {
  text-align: center;
  color: white;
  max-width: 400px;
  padding: 2rem;
}

.auth-loading-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: pulse-icon 2s infinite ease-in-out;
}

@keyframes pulse-icon {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.auth-loading-text h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-loading-text p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.auth-loading-spinner {
  display: flex;
  justify-content: center;
}

.auth-loading-spinner .spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3rem;
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: white;
}

/* Responsive loading screen */
@media (max-width: 768px) {
  .auth-loading-container {
    padding: 1.5rem;
  }
  
  .auth-loading-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
  }
  
  .auth-loading-text h2 {
    font-size: 1.5rem;
  }
  
  .auth-loading-text p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .auth-loading-spinner .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (max-width: 576px) {
  .auth-loading-container {
    padding: 1rem;
  }
  
  .auth-loading-icon {
    font-size: 2.5rem;
  }
  
  .auth-loading-text h2 {
    font-size: 1.3rem;
  }
  
  .auth-loading-text p {
    font-size: 0.9rem;
  }
}

/* Ensure main content is properly hidden initially */
#main-app-content.d-none {
  display: none !important;
}

/* Phone Authentication Modal Styling */
#phone-login-modal .modal-dialog {
  max-width: 500px;
}

.auth-step {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#phone-number-input {
  font-size: 1.1rem;
  padding: 0.75rem;
  text-align: center;
  letter-spacing: 0.5px;
  font-family: 'Courier New', monospace;
}

#phone-number-input::placeholder {
  color: #6c757d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: normal;
}

/* Smart phone input feedback */
#phone-help {
  transition: color 0.3s ease;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

#phone-help.success {
  color: #28a745 !important;
}

#phone-help.info {
  color: #007bff !important;
}

#phone-help.warning {
  color: #ffc107 !important;
}

#verification-code-input {
  font-size: 1.5rem;
  padding: 1rem;
  letter-spacing: 2px;
  font-weight: bold;
}

#recaptcha-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

#send-code-btn,
#verify-code-btn,
#resend-code-btn {
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
}

#code-sent-message {
  background-color: #e7f3ff;
  border-color: #b3d9ff;
  color: #004085;
  text-align: center;
}

#code-sent-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

/* Auth Required Modals */
#auth-required-modal .modal-dialog,
#auth-required-modal .modal-dialog {
  max-width: 500px;
}

#auth-required-main-message {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

#auth-required-card {
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#welcome-icon,
#lock-icon {
  display: block;
  margin: 0 auto;
}

#main-signin-btn,
#auth-required-signin-btn {
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-size: 1.1rem;
}

/* Testimonials Section */
#testimonials-section {
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.testimonial-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.testimonial-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.testimonial-quote {
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: #495057;
  margin-bottom: 1rem;
  position: relative;
}

.testimonial-quote::before {
  content: '"';
  font-size: 3rem;
  color: #667eea;
  position: absolute;
  top: -1rem;
  left: -0.5rem;
  font-family: Georgia, serif;
  opacity: 0.3;
}

.testimonial-quote::after {
  content: '"';
  font-size: 3rem;
  color: #667eea;
  position: absolute;
  bottom: -2rem;
  right: -0.5rem;
  font-family: Georgia, serif;
  opacity: 0.3;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.testimonial-info {
  flex: 1;
}

.testimonial-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.testimonial-details {
  color: #6c757d;
  font-size: 0.85rem;
  line-height: 1.3;
}

.testimonial-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f3f4;
}

.testimonial-stat {
  text-align: center;
  flex: 1;
}

.testimonial-stat-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: #667eea;
  display: block;
}

.testimonial-stat-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.2rem;
}

/* Features showcase */
.features-showcase {
  margin-top: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.75rem;
}

.feature-description {
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Responsive testimonials */
@media (max-width: 768px) {
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .testimonial-card {
    padding: 1.25rem;
  }
  
  .testimonial-quote {
    font-size: 0.95rem;
  }
  
  .testimonial-quote::before,
  .testimonial-quote::after {
    font-size: 2.5rem;
  }
  
  .testimonial-avatar {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .testimonial-stats {
    gap: 0.75rem;
  }
  
  .testimonial-stat-value {
    font-size: 1rem;
  }
  
  .testimonial-stat-label {
    font-size: 0.7rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .feature-card {
    padding: 1.25rem;
  }
  
  .feature-icon {
    font-size: 2.5rem;
  }
  
  .feature-title {
    font-size: 1rem;
  }
  
  .feature-description {
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  #testimonials-section {
    margin-top: 2rem;
  }
  
  .testimonial-card {
    padding: 1rem;
  }
  
  .testimonial-quote {
    font-size: 0.9rem;
  }
  
  .testimonial-quote::before,
  .testimonial-quote::after {
    font-size: 2rem;
  }
  
  .testimonial-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .testimonial-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  
  .testimonial-stat-value {
    font-size: 0.95rem;
  }
  
  .feature-card {
    padding: 1rem;
  }
  
  .feature-icon {
    font-size: 2rem;
  }
}

/* Navbar adjustments for auth */
#navbar-menu {
  align-items: center;
}

#sign-out-btn {
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Responsive auth modal adjustments */
@media (max-width: 768px) {
  #phone-login-modal .modal-dialog,
  #auth-required-modal .modal-dialog {
    max-width: 95%;
    margin: 1rem;
  }
  
  #phone-number-input {
    font-size: 1rem;
    padding: 0.6rem;
  }
  
  #verification-code-input {
    font-size: 1.3rem;
    padding: 0.8rem;
    letter-spacing: 1.5px;
  }
  
  #sign-out-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    max-width: 150px;
  }

  #navbar-menu {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  #navbar-menu .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 576px) {
  #verification-code-input {
    font-size: 1.2rem;
    padding: 0.7rem;
    letter-spacing: 1px;
  }
  
  #auth-required-main-message {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  
  #main-signin-btn,
  #auth-required-signin-btn {
    font-size: 1rem;
    padding: 0.6rem 1.5rem;
  }
  
  #sign-out-btn {
    max-width: 120px;
    font-size: 0.7rem;
  }
}
