@font-face {
  font-family: 'Comfortaa';
  src: url('/comfortaa.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Comfortaa', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background: #2c3e50;
  color: white;
  padding: 1rem 0;
  margin-bottom: 2rem;
}

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

header h1 {
  font-size: 1.5rem;
}

nav {
  position: relative;
}

.hamburger-menu {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  transition: opacity 0.2s;
}

.hamburger-menu:hover {
  opacity: 0.8;
}

.hamburger-menu img {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  margin-top: 0.5rem;
  z-index: 1000;
}

.nav-dropdown.show {
  display: block;
}

.nav-dropdown a {
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.nav-dropdown a:last-child {
  border-bottom: none;
}

.nav-dropdown a:hover {
  background: #f5f5f5;
}

.nav-dropdown a img {
  width: 24px;
  height: 24px;
  filter: none;
}

.auth-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-container h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
}

.btn {
  background: #3498db;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
}

.btn:hover {
  background: #2980b9;
}

.btn-small {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-danger {
  background: #e74c3c;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-success {
  background: #27ae60;
}

.btn-success:hover {
  background: #229954;
}

.btn-secondary {
  background: #95a5a6;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.error {
  color: #e74c3c;
  margin-bottom: 1rem;
  text-align: center;
}

.success {
  color: #27ae60;
  margin-bottom: 1rem;
  text-align: center;
}

.card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.card h2,
.card h3 {
  margin-bottom: 1rem;
}

.meal-section {
  margin-bottom: 2rem;
}

.meal-section h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: none;
  position: relative;
}

.meal-macro-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  display: flex;
  border-radius: 2px;
  overflow: hidden;
}

.meal-macro-bar-protein {
  background: #aa5bea;
  height: 100%;
}

.meal-macro-bar-carbs {
  background: #5be5ea;
  height: 100%;
}

.meal-macro-bar-fat {
  background: #eade5b;
  height: 100%;
}

.meal-macro-bar-empty {
  background: #ddd;
  height: 100%;
  flex: 1;
}

.meal-list {
  list-style: none;
}

.meal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

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

.meal-item-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.meal-item-details {
  font-size: 0.9rem;
  color: #666;
}

.search-results {
  list-style: none;
  margin-top: 1rem;
}

.search-result-item {
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  border: 2px solid transparent;
}

.search-result-item:hover {
  border-color: #3498db;
}

.search-result-item.selected {
  background: #e8f4f8;
  border-color: #3498db;
}

.nutrition-display {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f0f0f0;
  border-radius: 4px;
}

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

.nutrition-item {
  padding: 0.5rem;
  background: white;
  border-radius: 4px;
  font-size: 0.9rem;
}

.nutrition-item-label {
  font-weight: 600;
  text-transform: capitalize;
}

.date-selector {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.date-selector-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.date-btn-today {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.summary-section {
  background: #e8f4f8;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

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

.summary-item {
  text-align: center;
}

.summary-label {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
}

.link {
  color: #3498db;
  text-decoration: none;
  text-align: center;
  display: block;
  margin-top: 1rem;
}

.link:hover {
  text-decoration: underline;
}

.quantity-inputs {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.quantity-inputs .form-group {
  flex: 1;
}

/* Header logo and branding */
.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  height: 50px;
  width: auto;
}

/* Modal styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

.modal-overlay.scrollable {
  overflow-y: auto;
}

.modal-content {
  max-width: 500px;
  margin: 4rem auto;
  background: white;
  border-radius: 8px;
  padding: 2rem;
}

.modal-content-large {
  max-width: 600px;
  margin: 2rem auto;
  background: white;
  border-radius: 8px;
  padding: 2rem;
}

/* Button spacing */
.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Content visibility */
.hidden {
  display: none;
}

/* Date selector button */
.date-btn {
  width: auto;
}

.date-btn img {
  max-width: 30px;
  max-height: 30px;
  filter: brightness(0) invert(1);
}

/* Text colors */
.text-muted {
  color: #999;
}

.text-secondary {
  color: #666;
}

.text-small {
  font-size: 0.85rem;
}

.text-smaller {
  font-size: 0.9rem;
}

.text-large {
  font-size: 1.1rem;
}

/* Spacing utilities */
.mb-1 {
  margin-bottom: 1rem;
}

.mb-1-5 {
  margin-bottom: 1.5rem;
}

.mb-0-5 {
  margin-bottom: 0.5rem;
}

.mt-1 {
  margin-top: 1rem;
}

.mt-1-5 {
  margin-top: 1.5rem;
}

.mt-0-5 {
  margin-top: 0.5rem;
}

.p-0-5 {
  padding: 0.5rem;
}

.p-1 {
  padding: 1rem;
}

.py-0-25 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

/* List styles */
.list-unstyled {
  list-style: none;
  padding: 0;
}

/* Grid utilities */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* Max height utilities */
.max-h-400 {
  max-height: 400px;
  overflow-y: auto;
}

/* Flex utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
}

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

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

.gap-0-5 {
  gap: 0.5rem;
}

.gap-1 {
  gap: 1rem;
}

/* Cursor utilities */
.cursor-pointer {
  cursor: pointer;
}

/* Interaction item styling */
.interaction-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  cursor: pointer;
}

/* Background utilities */
.bg-light {
  background: #f5f5f5;
}

.border-radius-4 {
  border-radius: 4px;
}

/* Inline block utility */
.inline-block {
  display: inline-block;
}

/* Toggle switch */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #3498db;
}

input:checked + .slider:before {
  transform: translateX(30px);
}

/* Selection button group */
.selection-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.selection-button-group button {
  flex: 1;
  min-width: 80px;
  padding: 0.5rem;
  border: 2px solid #ddd;
  background: white;
  color: #333;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.selection-button-group button.selected {
  background: #3498db;
  border-color: #3498db;
  color: white;
}

.selection-button-group button:hover {
  border-color: #3498db;
}

/* Result display box */
.result-display {
  margin-top: 1rem;
  padding: 1rem;
  background: #e8f4f8;
  border-radius: 4px;
  border-left: 4px solid #3498db;
}

.result-display p {
  margin: 0.5rem 0;
}

/* Auto calc inputs section */
.auto-calc-inputs {
  display: none;
  margin-top: 1rem;
}

.auto-calc-inputs.active {
  display: block;
}

.manual-calc-inputs {
  display: none;
  margin-top: 1rem;
}

.manual-calc-inputs.active {
  display: block;
}

/* Card header toggle */
.card-header-toggle {
  cursor: pointer;
  user-select: none;
}

/* Margin left utility */
.ml-1 {
  margin-left: 1rem;
}

/* Flex with gap and wrap */
.flex-wrap {
  flex-wrap: wrap;
}

/* Radio button group */
.radio-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Result display for dark theme */
.result-display-dark {
  padding: 1rem;
  background: #222;
  border-radius: 4px;
  margin-top: 1rem;
}

/* Status color utilities */
.text-success {
  color: #27ae60;
  font-weight: 600;
}

.text-warning {
  color: #e67e22;
}

.text-info {
  color: #3498db;
}

/* Calorie Bar Visualization */
.calorie-bar-container {
  margin-top: 1.5rem;
  width: 100%;
}

.calorie-bar-background {
  position: relative;
  width: 100%;
  height: 30px;
  background: #e8e8e8;
  border-radius: 15px;
  overflow: visible;
  cursor: pointer;
  border: 1px solid #ccc;
}

.calorie-bar-limit-line {
  position: absolute;
  right: 10%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #e74c3c;
  z-index: 2;
}

.calorie-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  border-radius: 15px 0 0 15px;
  transition: width 0.5s ease, background-color 0.3s ease, opacity 1s ease;
  z-index: 1;
}

.calorie-bar-green {
  background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
}

.calorie-bar-yellow {
  background: linear-gradient(90deg, #e67e22 0%, #f39c12 100%);
}

.calorie-bar-red {
  background: linear-gradient(90deg, #c0392b 0%, #e74c3c 100%);
}

.macro-bar-container {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  display: flex;
  width: 100%;
  border-radius: 15px;
  overflow: hidden;
  z-index: 1;
  transition: opacity 1s ease;
}

.bar-visible {
  opacity: 1;
}

.bar-hidden {
  opacity: 0;
  pointer-events: none;
}

.macro-bar-protein {
  height: 100%;
  background:  #aa5bea;
  transition: width 0.5s ease;
}

.macro-bar-carbs {
  height: 100%;
  background:  #5be5ea;
  transition: width 0.5s ease;
}

.macro-bar-fat {
  height: 100%;
  background: #eade5b;
  transition: width 0.5s ease;
}


/* Nutrition Modal Styles */
.modal-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: #333;
  font-size: 2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  line-height: 1;
  padding: 0;
}

.modal-close-btn:hover {
  background: #e8e8e8;
  color: #c0392b;
}

.nutrition-modal-scroll {
  max-height: 70vh;
  overflow-y: auto;
}

.nutrition-pie-chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

.nutrition-details-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.macro-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.macro-detail-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

.macro-detail-info {
  flex: 1;
}

.macro-color-protein {
  background: #aa5bea;
}

.macro-color-carbs {
  background: #5be5ea;
}

.macro-color-fat {
  background: #eade5b;
}

.macro-detail-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #333;
  margin-bottom: 0.15rem;
}

.macro-detail-value {
  font-size: 0.8rem;
  color: #666;
}

.nutrition-other-details {
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #ddd;
  margin-top: 0.75rem;
}

.nutrition-other-title {
  color: #2c3e50;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.nutrition-other-item {
  font-size: 0.8rem;
  margin: 0.25rem 0;
  color: #333;
}

/* Tab styles */
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Comfortaa', sans-serif;
  color: #666;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #2c3e50;
}

.tab-btn.active {
  color: #2c3e50;
  border-bottom-color: #2c3e50;
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Day Circles for Weekly View */
.day-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  border: 2px solid #ccc;
  transition: all 0.3s ease;
}

.day-circle-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #666;
}

.day-circle.day-under-budget {
  background: #27ae60;
  border-color: #229954;
}

.day-circle.day-under-budget .day-circle-label {
  color: white;
}

.day-circle.day-near-budget {
  background: #f39c12;
  border-color: #e67e22;
}

.day-circle.day-near-budget .day-circle-label {
  color: white;
}

.day-circle.day-over-budget {
  background: #e74c3c;
  border-color: #c0392b;
}

.day-circle.day-over-budget .day-circle-label {
  color: white;
}
