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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: #ffffff;
  color: #000000;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  background-color: #ffffff;
}

/* SPLASH SCREEN - Animacje */
.splash-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  overflow: hidden;
}

.splash-content {
  text-align: center;
  color: white;
  animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.splash-icon {
  font-size: 80px;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

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

.splash-title {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 8px;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideInDown 0.8s ease-out;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

.splash-subtitle {
  font-size: 16px;
  opacity: 0.8;
  animation: slideInUp 0.8s ease-out 0.2s both;
}

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

.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 70px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 50%, #f0f1ff 100%);
  scroll-behavior: smooth;
  position: relative;
}

/* Scroll animation effect */
.app-content::-webkit-scrollbar {
  width: 4px;
}

.app-content::-webkit-scrollbar-track {
  background: transparent;
}

.app-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1, #a78bfa);
  border-radius: 2px;
}

.app-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4f46e5, #9370db);
}

/* QUIZ */
.quiz-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #ffffff;
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.back-btn {
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #6366f1;
  transition: transform 0.2s;
}

.back-btn:hover { transform: scale(1.1); }
.back-btn:disabled { color: #cccccc; cursor: not-allowed; }

.progress-container { flex: 1; }
.progress-text { font-size: 12px; color: #666666; font-weight: 600; margin-bottom: 8px; }
.progress-bar { height: 6px; background-color: #e0e0e0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background-color: #6366f1; transition: width 0.3s; }

.quiz-content { flex: 1; padding: 24px 16px; overflow-y: auto; background-color: #ffffff; }
.quiz-step h2 { font-size: 24px; font-weight: bold; color: #000000; margin-bottom: 24px; }

.quiz-step label { display: block; margin-bottom: 16px; font-weight: 600; color: #000000; }
.quiz-step input[type="text"], .quiz-step input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 8px;
  background-color: #f9f9f9;
  color: #000000;
  transition: border-color 0.2s;
}

.quiz-step input:focus { outline: none; border-color: #6366f1; }

.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background-color: #ffffff;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.radio-option:hover { border-color: #6366f1; background-color: #f5f5ff; }
.radio-option input { cursor: pointer; }

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background-color: #f9f9f9;
  border-left: 4px solid #6366f1;
  border-radius: 8px;
  margin-bottom: 8px;
}

.summary-label { font-size: 14px; color: #666666; font-weight: 600; }
.summary-value { font-size: 14px; color: #000000; font-weight: bold; }

.info-box {
  background-color: #e3f2fd;
  border-left: 4px solid #6366f1;
  border-radius: 8px;
  padding: 16px;
  color: #1976d2;
  font-size: 14px;
}

.quiz-footer {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid #e0e0e0;
  background-color: #f5f5f5;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #6366f1;
  color: white;
}

.btn-primary:hover {
  background-color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background-color: #ffffff;
  color: #6366f1;
  border: 2px solid #6366f1;
}

.btn-secondary:hover {
  background-color: #f0f0ff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* DASHBOARD */
.dashboard-screen {
  padding-top: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
  background-attachment: fixed;
}

.dashboard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 16px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
  animation: slideInDown 0.6s ease-out;
}

.dashboard-header > div:nth-child(2) {
  flex: 1;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid rgba(99, 102, 241, 0.2);
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.user-avatar:hover {
  transform: scale(1.05);
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.user-avatar:active {
  transform: scale(0.95);
}

.user-avatar-initials {
  color: white;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.greeting {
  font-size: 14px;
  color: #999999;
  margin-bottom: 4px;
  animation: fadeIn 0.5s ease-out 0.1s both;
}

.user-name {
  font-size: 24px;
  font-weight: bold;
  color: #000000;
  animation: fadeIn 0.5s ease-out 0.2s both;
}

.date {
  font-size: 14px;
  color: #666666;
  animation: fadeIn 0.5s ease-out 0.3s both;
}

.card {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 16px;
  margin: 0 16px 16px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: slideInUp 0.5s ease-out;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }

.card:hover {
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
  transform: translateY(-4px);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-header button {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.card-header button:hover {
  background-color: rgba(99, 102, 241, 0.2);
  transform: translateX(2px);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #000000;
}

/* BMI Card - Mini Card with Modern Design */
.bmi-card {
  background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
  border: none;
  color: #ffffff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  margin: 16px 16px 8px;
  animation: slideInDown 0.5s ease-out;
}

.bmi-card .card-header {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
}

.bmi-card .card-title {
  color: #ffffff;
  font-size: 14px;
}

.bmi-content {
  text-align: center;
  margin: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.bmi-value {
  font-size: 28px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 2px;
}

.bmi-category {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 4px;
}

.bmi-weight {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.weight-value {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

/* Calorie Ring */
.calorie-ring-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  height: 180px;
  animation: zoomIn 0.6s ease-out;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.calorie-ring {
  width: 160px;
  height: 160px;
  filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.2));
  animation: spin 0.8s ease-out;
}

@keyframes spin {
  from {
    transform: rotate(-180deg);
    opacity: 0;
  }
  to {
    transform: rotate(0deg);
    opacity: 1;
  }
}

.calorie-ring-center {
  position: absolute;
  text-align: center;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

.ring-value {
  font-size: 32px;
  font-weight: bold;
  color: #6366f1;
}

.ring-label {
  font-size: 12px;
  color: #666666;
  margin-top: 2px;
  font-weight: 600;
}

.ring-sub {
  font-size: 11px;
  color: #999999;
  margin-top: 2px;
}

.macros-info { display: flex; flex-direction: column; gap: 12px; }
.macro-item { display: flex; align-items: center; gap: 8px; padding: 8px; background-color: #f9f9f9; border-radius: 8px; }
.macro-ball { width: 12px; height: 12px; border-radius: 6px; }
.macro-content { flex: 1; display: flex; justify-content: space-between; }
.macro-label { font-size: 12px; color: #666666; }
.macro-value { font-size: 14px; font-weight: 600; color: #000000; }

/* Slider */
.slider-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.slider-value { font-size: 20px; font-weight: bold; color: #6366f1; }

.slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e0e0e0;
  border-radius: 3px;
  cursor: pointer;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.slider-label { font-size: 12px; color: #666666; min-width: 40px; text-align: center; }

.slider-presets { display: flex; gap: 8px; }
.preset-button {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  background-color: #ffffff;
  color: #666666;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-button:hover { border-color: #6366f1; background-color: #f0f0ff; }
.preset-button.active {
  background-color: #6366f1;
  border-color: #6366f1;
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Meals */
.meals-section { margin-bottom: 16px; }
.meals-header { display: flex; justify-content: space-between; padding: 0 16px 12px; }
.add-btn { font-size: 24px; cursor: pointer; transition: transform 0.2s; }
.add-btn:hover { transform: scale(1.1); }

.meal-card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 12px;
  margin: 0 16px 12px;
  border: 2px solid #f0f0f0;
  transition: all 0.2s;
}

.meal-card:hover { border-color: #6366f1; }

.meal-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.meal-title { display: flex; align-items: center; gap: 12px; flex: 1; }
.meal-icon { font-size: 24px; }
.meal-info { display: flex; flex-direction: column; gap: 2px; }
.meal-type { font-size: 12px; font-weight: 600; color: #999999; }
.meal-name { font-size: 14px; font-weight: 600; color: #000000; }
.action-btn { font-size: 16px; background: none; border: none; cursor: pointer; padding: 4px; }

.meal-nutrition {
  display: flex;
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
  justify-content: space-around;
}

.nutrition-item { display: flex; flex-direction: column; align-items: center; flex: 1; }
.nutrition-label { font-size: 11px; color: #999999; margin-bottom: 2px; font-weight: 600; }
.nutrition-value { font-size: 14px; font-weight: bold; color: #000000; }

.meal-footer { display: flex; justify-content: space-between; border-top: 1px solid #f0f0f0; padding-top: 8px; font-size: 12px; }
.meal-count { color: #666666; }
.meal-time { color: #6366f1; font-weight: 500; }

/* Day Navigation */
.day-navigation { display: flex; gap: 8px; padding: 0 16px 16px; overflow-x: auto; margin-bottom: 20px; }

.day-button {
  flex-shrink: 0;
  min-width: 60px;
  padding: 12px 8px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  background-color: #ffffff;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.day-button:hover { border-color: #6366f1; background-color: #f0f0ff; }
.day-button.active { background-color: #6366f1; border-color: #6366f1; color: white; }
.day-name { font-size: 12px; color: #666666; margin-bottom: 2px; }
.day-button.active .day-name { color: white; }
.day-date { font-size: 14px; font-weight: bold; color: #000000; }
.day-button.active .day-date { color: white; }

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 12px 0 16px 0;
  z-index: 100;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.nav-button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
  padding: 8px 4px;
  position: relative;
}

.nav-button:hover {
  color: #6366f1;
}

.nav-button.active {
  color: #6366f1;
}

.nav-button.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: #6366f1;
  border-radius: 2px;
}

.nav-icon { font-size: 24px; }
.nav-label { font-size: 10px; font-weight: 500; }

/* Center scan button in nav */
.nav-scan-center {
  position: relative;
  top: -18px;
  flex: none !important;
  width: 62px;
  height: 62px;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: white !important;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid white !important;
}

.nav-scan-center:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.5);
  border-color: transparent !important;
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
}

.nav-scan-icon {
  font-size: 26px;
  line-height: 1;
}

.nav-scan-center .nav-label {
  color: white;
  font-size: 9px;
  font-weight: 700;
  margin-top: 1px;
}

/* Avatar dropdown menu */
.avatar-menu-wrapper {
  position: relative;
}

.avatar-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 300;
  min-width: 180px;
  overflow: hidden;
  animation: fadeInDown 0.2s ease-out;
}

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

.avatar-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
}

.avatar-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.08);
}

.avatar-dropdown-item:not(:last-child) {
  border-bottom: 1px solid #f0f0f0;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Screens */
.screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #ffffff;
}

.screen-header {
  padding: 16px;
  font-size: 24px;
  font-weight: bold;
  color: #000000;
  background: linear-gradient(180deg, #ffffff 0%, rgba(99, 102, 241, 0.02) 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
  animation: slideInDown 0.5s ease-out;
}

.screen-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  width: 100%;
  scroll-behavior: smooth;
}
.screen-content .meal-plans-container { width: 100%; justify-content: flex-start; align-items: stretch; }
.placeholder { font-size: 48px; color: #e0e0e0; }

/* Meal Breakdown */
.meals-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.meal-breakdown-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border-left: 4px solid #6366f1;
  gap: 8px;
  transition: all 0.2s;
}

.meal-breakdown-item.meal-eaten {
  background-color: #f0fdf4;
  border-left-color: #22c55e;
}

.meal-eaten .meal-name {
  color: #22c55e;
}

.meal-eaten-check {
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
  transition: transform 0.2s;
}

.meal-eaten-check:active {
  transform: scale(0.85);
}

.meal-breakdown-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.meal-icon {
  font-size: 28px;
}

.meal-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meal-type {
  font-size: 11px;
  color: #999999;
  font-weight: 600;
}

.meal-name {
  font-size: 14px;
  color: #000000;
  font-weight: 600;
}

.meal-breakdown-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.meal-cals {
  font-size: 14px;
  font-weight: bold;
  color: #6366f1;
}

.meal-percent {
  font-size: 12px;
  color: #999999;
  font-weight: 600;
}

/* Measurements */
.measurements-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.measurement-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}

.measurement-item:hover {
  background-color: #f9f9f9;
}

.measurement-icon {
  font-size: 32px;
  margin-right: 12px;
}

.measurement-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.measurement-label {
  font-size: 12px;
  color: #999999;
  font-weight: 600;
}

.measurement-value {
  font-size: 16px;
  color: #000000;
  font-weight: bold;
}

.measurement-arrow {
  font-size: 20px;
  color: #cccccc;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  z-index: 1000;
  animation: fadeIn 0.2s ease-in;
}

.modal {
  width: 100%;
  max-width: 600px;
  background-color: #ffffff;
  border-radius: 12px 12px 0 0;
  padding: 0;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  background-color: #f9f9f9;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #000000;
}

.modal-content {
  padding: 24px 16px;
}

.modal-content label {
  display: block;
  margin-bottom: 16px;
  font-weight: 600;
  color: #000000;
}

.modal-content input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  margin-top: 8px;
  background-color: #f9f9f9;
  color: #000000;
  transition: border-color 0.2s;
}

.modal-content input:focus {
  outline: none;
  border-color: #6366f1;
}

.modal-date {
  font-size: 12px;
  color: #999999;
  margin-top: 8px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid #f0f0f0;
  background-color: #f9f9f9;
}

.modal-footer .btn {
  flex: 1;
}

/* Gender Select Screen */
.gender-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #ffffff;
}

.gender-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: #f5f5f5;
}

.gender-header .back-btn {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: #000000;
  padding: 0;
}

.gender-header .progress-bar {
  flex: 1;
  height: 2px;
  background-color: #e0e0e0;
  border-radius: 1px;
}

.gender-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 40px 24px;
}

.gender-content h2 {
  font-size: 32px;
  font-weight: bold;
  color: #000000;
  margin-bottom: 12px;
}

.gender-content p {
  font-size: 16px;
  color: #666666;
  margin-bottom: 40px;
}

.gender-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.gender-option {
  padding: 20px;
  background-color: #f9f9f9;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
  font-weight: 500;
  color: #000000;
}

.gender-option:hover {
  border-color: #6366f1;
  background-color: #f0f0ff;
}

.gender-option.active {
  background-color: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
}

.gender-text {
  display: block;
  text-align: center;
}

.gender-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  background-color: #f9f9f9;
}

.btn-large {
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 16px;
}

.btn-primary:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Meal Plans */
.meal-plans-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.meal-plan-card {
  background-color: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.meal-plan-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.plan-title {
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  color: #ffffff;
  padding: 16px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}

.plan-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-meal {
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #333333;
}

.plan-meal strong {
  display: block;
  color: #6366f1;
  margin-bottom: 4px;
  font-weight: 600;
}

/* Meal Plan Buttons */
.meal-plan-buttons {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  justify-content: center;
}

.plan-btn {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background-color: #ffffff;
  color: #666666;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.plan-btn:hover {
  border-color: #6366f1;
  background-color: #f0f0ff;
  color: #6366f1;
}

.plan-btn.active {
  background-color: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
}

.plan-select-btn {
  width: 100%;
  padding: 12px;
  background-color: #6366f1;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
}

.plan-select-btn:hover {
  background-color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Plan Preferences */
.plan-preferences-card {
  background: linear-gradient(135deg, #f9f9f9 0%, #f0f0ff 100%);
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  animation: slideInUp 0.5s ease-out;
}

.preference-group {
  margin-bottom: 12px;
}

.preference-group textarea,
.preference-group select {
  transition: all 0.2s;
}

.preference-group textarea:focus,
.preference-group select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.preference-group textarea::placeholder {
  color: #cccccc;
}

#applyPreferencesBtn {
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#applyPreferencesBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

#applyPreferencesBtn:active {
  transform: translateY(0);
}

/* Macro Card */
.macro-card {
  background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
  color: #ffffff;
  animation: slideInUp 0.5s ease-out 0.15s both;
}

.macro-card .card-header {
  color: #ffffff;
}

.macro-card .card-title {
  color: #ffffff;
}

.macro-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.macro-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.macro-item:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.macro-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.macro-value {
  font-size: 20px;
  color: #ffffff;
  font-weight: bold;
}

/* Edit Plan Section */
.edit-plan-container {
  padding: 0;
}

.edit-plan-container p {
  margin: 0 0 12px 0;
}

.edit-plan-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.edit-btn {
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
  color: #666666;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.edit-btn:hover {
  border-color: #6366f1;
  background: linear-gradient(135deg, #f0f0ff 0%, #f8f7ff 100%);
  color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.edit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.1);
}

/* ============================================ */
/* PLAN - Day selector buttons */
/* ============================================ */
.days-selector {
  display: flex;
  gap: 8px;
}

.day-pick-btn {
  flex: 1;
  padding: 10px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #666;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.day-pick-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.day-pick-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

/* Day tabs (horizontal scroll) */
.day-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.day-tabs::-webkit-scrollbar { display: none; }

.day-tab {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 56px;
}

.day-tab:hover { border-color: #6366f1; }

.day-tab.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.day-tab-name {
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.day-tab.active .day-tab-name { color: rgba(255,255,255,0.9); }

.day-tab-cal {
  font-size: 11px;
  font-weight: 700;
  color: #6366f1;
}

.day-tab.active .day-tab-cal { color: #fff; }

/* Day detail */
.day-detail {
  padding: 0 16px 16px;
}

.day-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #f0f0ff, #f8f7ff);
  border-radius: 10px;
}

.day-detail-title {
  font-size: 16px;
  font-weight: 700;
  color: #000;
}

.day-detail-cal {
  font-size: 14px;
  font-weight: 700;
  color: #6366f1;
}

/* Recipe cards */
.recipe-card {
  background: #fff;
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.recipe-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.recipe-card:active {
  transform: translateY(0);
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.recipe-meal-type {
  font-size: 12px;
  font-weight: 600;
  color: #999;
}

.recipe-kcal {
  font-size: 13px;
  font-weight: 700;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
}

.recipe-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  margin-bottom: 8px;
  line-height: 1.3;
}

.recipe-card-macros {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.recipe-card-macros span {
  background: #f5f5f5;
  padding: 3px 8px;
  border-radius: 4px;
}

.recipe-card-time {
  font-size: 12px;
  color: #999;
}

/* Recipe modal stats */
.recipe-modal-stat {
  text-align: center;
  padding: 10px 4px;
  background: #f9f9f9;
  border-radius: 8px;
}

/* ============================================ */
/* SHOPPING LIST */
/* ============================================ */
.shopping-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

.shopping-progress {
  flex: 1;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.shopping-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  border-radius: 3px;
  transition: width 0.3s;
}

.shopping-category {
  margin-bottom: 16px;
}

.shopping-cat-header {
  font-size: 14px;
  font-weight: 700;
  color: #000;
  padding: 8px 0;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 4px;
}

.shopping-cat-count {
  font-weight: 400;
  color: #999;
  font-size: 12px;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid #f8f8f8;
  cursor: pointer;
  transition: all 0.2s;
}

.shopping-item:hover {
  background: #f9f9f9;
}

.shopping-item.checked .shopping-name {
  text-decoration: line-through;
  color: #ccc;
}

.shopping-checkbox {
  font-size: 18px;
  flex-shrink: 0;
}

.shopping-name {
  flex: 1;
  font-size: 13px;
  color: #333;
}

.shopping-count {
  font-size: 11px;
  color: #999;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================ */
/* STATISTICS */
/* ============================================ */
.stat-card .stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.stat-item {
  text-align: center;
  padding: 14px 8px;
  background: #f9f9f9;
  border-radius: 10px;
}

.stat-number {
  font-size: 22px;
  font-weight: 700;
  color: #6366f1;
}

.stat-label {
  font-size: 11px;
  color: #999;
  font-weight: 600;
  margin-top: 2px;
}

/* ============================================ */
/* WATER TRACKING */
/* ============================================ */
.water-card {
  border: 2px solid rgba(59, 130, 246, 0.15);
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
}

.water-total-display {
  font-size: 13px;
  font-weight: 700;
  color: #3b82f6;
}

.water-progress {
  height: 8px;
  background: #e0e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}

.water-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.water-glasses {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.water-glass {
  font-size: 20px;
  opacity: 0.2;
  transition: all 0.3s;
}

.water-glass.filled {
  opacity: 1;
  transform: scale(1.1);
}

.water-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
}

.water-btn {
  padding: 10px 6px;
  border: 2px solid #e0e8f0;
  border-radius: 10px;
  background: #fff;
  color: #3b82f6;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.water-btn:hover {
  border-color: #3b82f6;
  background: #f0f7ff;
}

.water-btn:active {
  transform: scale(0.95);
  background: #3b82f6;
  color: #fff;
}

.water-btn-undo {
  color: #999;
  border-color: #e0e0e0;
}

.water-btn-undo:hover {
  border-color: #999;
  background: #f5f5f5;
}

.water-history {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.water-entry {
  font-size: 11px;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
}

/* ============================================ */
/* AUTH SCREEN */
/* ============================================ */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeIn 0.6s ease-out;
}

.auth-logo-icon {
  font-size: 56px;
  margin-bottom: 8px;
}

.auth-logo-title {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.auth-form {
  width: 100%;
  max-width: 360px;
  animation: slideInUp 0.5s ease-out;
}

.auth-form h2 {
  font-size: 24px;
  font-weight: 700;
  color: #000;
  margin-bottom: 20px;
  text-align: center;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  margin-bottom: 12px;
  background: #f9f9f9;
  color: #000;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.auth-form input:focus {
  outline: none;
  border-color: #6366f1;
  background: #fff;
}

.auth-form .btn-large {
  margin-top: 8px;
  padding: 16px;
  font-size: 16px;
  width: 100%;
  border-radius: 12px;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: center;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}

.auth-switch button {
  background: none;
  border: none;
  color: #6366f1;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  gap: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.auth-divider span {
  font-size: 13px;
  color: #999;
  font-weight: 500;
}

/* Google button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #fff;
  color: #333;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-google:hover {
  border-color: #4285f4;
  background: #f8f9ff;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.15);
}

.btn-google:active {
  transform: scale(0.98);
}

.google-icon {
  flex-shrink: 0;
}

/* ============================================ */
/* SCAN FAB */
/* ============================================ */
.scan-fab {
  position: fixed;
  bottom: 90px;
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
  z-index: 200;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scan-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.5);
}

.scan-fab:active {
  transform: scale(0.95);
}

/* ============================================ */
/* PORTION BADGE */
/* ============================================ */
.portion-badge {
  display: inline-block;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

.portion-badge.portion-smaller {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* ============================================ */
/* AI CHAT */
/* ============================================ */
.chat-fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  z-index: 200;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: -0.5px;
}

.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.chat-fab:active {
  transform: scale(0.95);
}

.chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.chat-window {
  width: 100%;
  max-width: 600px;
  height: 85vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: white;
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

.chat-title {
  font-size: 16px;
  font-weight: 700;
}

.chat-subtitle {
  font-size: 12px;
  opacity: 0.8;
}

.chat-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-close:hover {
  background: rgba(255,255,255,0.3);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9ff;
  scroll-behavior: smooth;
}

.chat-welcome {
  text-align: center;
  padding: 24px 16px;
}

.chat-welcome-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: white;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.chat-welcome-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #000;
}

.chat-welcome-text {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 20px;
}

.chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-suggestion {
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #fff;
  color: #6366f1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.chat-suggestion:hover {
  border-color: #6366f1;
  background: #f0f0ff;
}

.chat-msg {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-end;
}

.chat-msg-user {
  justify-content: flex-end;
}

.chat-msg-ai {
  justify-content: flex-start;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: white;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble-user {
  background: #6366f1;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble-ai {
  background: white;
  color: #333;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

/* Typing animation */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
}

.chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  animation: chatDots 1.4s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatDots {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  background: #fff;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #f9f9f9;
}

.chat-input:focus {
  border-color: #6366f1;
  background: #fff;
}

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send:hover {
  background: #4f46e5;
  transform: scale(1.05);
}

.chat-send:active {
  transform: scale(0.95);
}

/* ============================================ */
/* PROFILE SCREEN */
/* ============================================ */
.profile-avatar-section {
  text-align: center;
  padding: 24px 0;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  font-size: 28px;
}

.profile-avatar-name {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  margin-bottom: 4px;
}

.profile-avatar-email {
  font-size: 13px;
  color: #999;
}

.profile-form-card {
  margin-bottom: 16px;
}

.profile-field {
  margin-bottom: 14px;
}

.profile-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-bottom: 6px;
}

.profile-field input,
.profile-field select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: #f9f9f9;
  color: #000;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.profile-field input:focus,
.profile-field select:focus {
  outline: none;
  border-color: #6366f1;
  background: #fff;
}

.profile-msg {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  min-height: 20px;
}

.profile-msg-success {
  color: #22c55e;
}

.profile-msg-error {
  color: #ef4444;
}

.profile-logout-btn {
  background: #fff;
  color: #ef4444;
  border: 2px solid #ef4444;
}

.profile-logout-btn:hover {
  background: #fef2f2;
}

/* ============================================ */
/* PROGRESS PHOTOS */
/* ============================================ */
.progress-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.progress-photo-item {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  aspect-ratio: 1;
}

.progress-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.progress-photo-date {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
  padding: 4px;
  text-align: center;
  font-weight: 600;
}

/* Photo comparison */
.photo-compare-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.photo-compare-item {
  text-align: center;
}

.photo-compare-item img {
  width: 100%;
  border-radius: 8px;
  margin-top: 8px;
}

.photo-compare-label {
  font-size: 14px;
  font-weight: 700;
  color: #6366f1;
}
