/* ==== RESET CƠ BẢN ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* ==== KHUNG CHÍNH ==== */
.kcal-calculator-container {
  width: 100%;
  max-width: 700px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;

  margin-left: auto;
  margin-right: auto;
  
}

/* ==== THẺ NỘI DUNG ==== */
.kcal-card {
  padding: 40px 30px;
}

.kcal-card h2 {
  text-align: center;
  font-weight: 700;
  color: #1a365d;
  margin-bottom: 30px;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: -0.5px;
}

/* ==== INPUT + LABEL - LAYOUT 3 CỘT ==== */
.input-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  display: block;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
  font-size: 13px;
}

.input-group input,
.input-group select {
      appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  background: #f8fafc;
  height: auto;
  
    appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}

/* ==== THÊM MŨI TÊN CHO SELECT ==== */
.input-group select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23667' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 40px; /* để không đè lên mũi tên */
  cursor: pointer;
}

.input-group input:focus,
.input-group select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background: #ffffff;
}

.input-group input:hover,
.input-group select:hover {
  border-color: #cbd5e0;
}

/* ==== BUTTON ==== */
button {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 12px;
  background: #3b82f6;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(0);
}

#addMealBtn {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

#addMealBtn:hover {
  box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

#analyzeBtn {
  margin-top: 20px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

#analyzeBtn:hover {
  box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4);
}

#resetBtn {
  background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
  box-shadow: 0 4px 15px rgba(113, 128, 150, 0.3);
}

#resetBtn:hover {
  box-shadow: 0 8px 25px rgba(113, 128, 150, 0.4);
}

/* ==== KHỐI HIỂN THỊ KẾT QUẢ ==== */
.tdee-display {
  background: #3b82f6;
  color: white;
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 24px;

  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.tdee-display .label {
  font-size: 14px;
  opacity: 0.95;
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tdee-display .value {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  margin: 8px 0;
}

.tdee-display .unit {
  font-size: 14px;
  opacity: 0.9;
  font-weight: 500;
}

/* ==== DANH SÁCH MÓN ĂN ==== */
#mealList {
  margin-bottom: 20px;
  min-height: 60px;
}

.meal-item {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease-out;
}

.meal-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  border-color: #cbd5e0;
}

.meal-item span {
  font-weight: 500;
  color: #2d3748;
}

.meal-item button {
  width: auto;
  background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(252, 129, 129, 0.3);
}

.meal-item button:hover {
  background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(252, 129, 129, 0.4);
}

/* ==== KHUNG TỔNG KẾT ==== */
.summary-box {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 14px;
  padding: 20px 24px;
  margin-top: 20px;
  border: 2px solid #e2e8f0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  align-items: center;
}

.summary-row:last-child {
  margin-bottom: 0;
}

.summary-label {
  font-weight: 600;
  color: #2d3748;
  font-size: 15px;
}

.summary-value {
  font-weight: 700;
  font-size: 16px;
  color: #3b82f6;
}

/* ==== TRẠNG THÁI RỖNG ==== */
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: #a0aec0;
  font-style: italic;
  font-size: 14px;
}

/* ==== ANIMATION ==== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
  .input-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .kcal-calculator-container {
    max-width: 600px;
  }
}

@media (max-width: 480px) {
  .kcal-card {
    padding: 30px 20px;
  }

  .kcal-card h2 {
    font-size: 20px;
  }

  button {
    font-size: 15px;
    padding: 12px;
  }

  .tdee-display .value {
    font-size: 40px;
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .input-group label {
    font-size: 13px;
  }
}

/* ==== Tùy chỉnh SweetAlert2 ==== */
.swal2-popup {
  border-radius: 20px !important;
  font-family: "Inter", sans-serif !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2) !important;
}

.swal2-title {
  color: #1a365d !important;
  font-weight: 700 !important;
  font-size: 26px !important;
  margin-bottom: 10px !important;
}

.swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
}

.swal2-confirm {
  background: #3b82f6 !important;
  border-radius: 12px !important;
  padding: 14px 32px !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
  border: none !important;
  transition: all 0.3s ease !important;
}

.swal2-confirm:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

.swal2-cancel {
  background: #e2e8f0 !important;
  color: #2d3748 !important;
  border-radius: 12px !important;
  padding: 14px 32px !important;
  font-weight: 600 !important;
  border: none !important;
}

.swal2-input {
  border: 2px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  font-family: "Inter", sans-serif !important;
  font-size: 15px !important;
  transition: all 0.3s ease !important;
  background: #f8fafc !important;
}

.swal2-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
  background: #ffffff !important;
}

/* Animation cho popup */
.animated-popup {
  animation: popupSlideIn 0.4s ease-out !important;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==== POPUP PHÂN TÍCH KẾT QUẢ ==== */
.analysis-result {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #334155;
  text-align: center;
  padding: 10px 5px 0;
}

.analysis-message {
  font-size: 17px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ==== GỢI Ý SẢN PHẨM ==== */
.recommend-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
}

.recommend-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 180px;
  text-decoration: none;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.recommend-card:hover {
  transform: translateY(-4px);
  border-color: #93c5fd;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.recommend-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-bottom: 1px solid #e5e7eb;
}

.recommend-info {
  padding: 10px 12px 14px;
  text-align: center;
}

.recommend-info h4 {
  font-size: 14px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.recommend-info h4:hover {
  color: #2563eb;
}

@media (max-width: 480px) {
  .recommend-card {
    width: 100%;
  }

  .recommend-grid {
    flex-direction: column;
    align-items: center;
  }

  .recommend-card img {
    height: 180px;
  }
}
/* === TẮT TOÀN BỘ ANIMATION & TRANSITION === */
* {
  animation: none !important;
  transition: none !important;
}
