/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:    #FF6B6B;
  --orange: #FF9A3C;
  --yellow: #FFD93D;
  --green:  #6BCB77;
  --teal:   #4ECDC4;
  --blue:   #4D96FF;
  --purple: #9B5DE5;
  --pink:   #F15BB5;
  --white:  #FFFFFF;
  --bg:     #FFFBF0;
  --text:   #2D2D2D;
  --muted:  #666;
  --radius: 18px;
  --shadow: 0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
}

body {
  font-family: 'Segoe UI', 'Nunito', 'Comic Sans MS', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, var(--red), var(--orange), var(--yellow), var(--green), var(--blue), var(--purple));
  background-size: 300% 300%;
  animation: rainbowShift 8s ease infinite;
  padding: 18px 20px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
}

/* ===== HEADER CLIPART ===== */
.header-clipart {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hc-item {
  position: absolute;
  left: var(--hc-x);
  top: var(--hc-y);
  width: var(--hc-size);
  height: var(--hc-size);
  animation: hcFloat 3.2s ease-in-out infinite;
  animation-delay: var(--hc-delay);
  filter: drop-shadow(1px 2px 5px rgba(0,0,0,0.18));
  opacity: 0.82;
}

@keyframes hcFloat {
  0%, 100% { transform: translateY(0px) rotate(-3deg); }
  50%       { transform: translateY(-9px) rotate(4deg); }
}

/* ===== FOOD STRIP ===== */
.food-strip {
  background: white;
  border-bottom: 3px solid rgba(0,0,0,0.06);
  padding: 6px 0;
  display: flex;
  overflow: hidden;
  gap: 0;
  white-space: nowrap;
}

.food-strip span {
  font-size: 1.3rem;
  padding: 0 10px;
  animation: stripScroll 18s linear infinite;
  display: inline-block;
}

.food-strip span:nth-child(even) {
  animation-delay: -9s;
}

@keyframes stripScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-30px); }
}

@keyframes rainbowShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.header h1 {
  color: white;
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 800;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.25);
  letter-spacing: 1px;
  border: 0;
}

.header .tagline {
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* ===== MAIN CONTAINER ===== */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== TODAY'S LUNCH CARD ===== */
.today-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 3px solid var(--yellow);
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.today-badge {
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.today-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.today-body {
  padding: 18px 20px;
}

.today-name {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}

.today-desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

/* ===== LIKE & RATING ROW ===== */
.interaction-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.like-btn {
  background: none;
  border: 2px solid var(--red);
  border-radius: 50px;
  padding: 7px 18px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
  font-weight: 700;
  transition: all 0.2s;
}

.like-btn:hover, .like-btn.liked {
  background: var(--red);
  color: white;
  transform: scale(1.05);
}

.like-btn .heart {
  font-size: 1.2rem;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.like-btn.liked .heart {
  transform: scale(1.3);
}

/* ===== STAR RATING ===== */
.stars-widget {
  display: flex;
  align-items: center;
  gap: 4px;
}

.star {
  font-size: 1.6rem;
  cursor: pointer;
  color: #DDD;
  transition: all 0.15s;
  line-height: 1;
}

.star.filled, .star.hover { color: var(--yellow); transform: scale(1.1); }

.rating-info {
  font-size: 0.82rem;
  color: var(--muted);
  margin-left: 6px;
}

/* ===== NO LUNCH ===== */
.no-lunch {
  text-align: center;
  padding: 50px 20px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.no-lunch .emoji { font-size: 4rem; margin-bottom: 12px; }
.no-lunch h2 { font-size: 1.4rem; color: var(--purple); margin-bottom: 8px; }
.no-lunch p  { color: var(--muted); }

/* ===== SEARCH ===== */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #E0E0E0;
  border-radius: 50px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--blue); }

.btn {
  padding: 11px 20px;
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-blue   { background: var(--blue);   color: white; }
.btn-green  { background: var(--green);  color: white; }
.btn-red    { background: var(--red);    color: white; }
.btn-purple { background: var(--purple); color: white; }
.btn-orange { background: var(--orange); color: white; }
.btn-yellow { background: var(--yellow); color: var(--text); }
.btn-teal   { background: var(--teal);   color: white; }
.btn-ghost  { background: transparent; border: 2px solid currentColor; }

/* ===== LUNCH LIST CARD ===== */
.lunch-grid { display: flex; flex-direction: column; gap: 14px; }

.lunch-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 0;
  overflow: hidden;
  border-left: 5px solid var(--green);
  transition: transform 0.2s, box-shadow 0.2s;
}

.lunch-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.lunch-card-img {
  width: 100px;
  min-width: 100px;
  height: 100px;
  object-fit: cover;
}

.lunch-card-body {
  padding: 12px 14px;
  flex: 1;
}

.lunch-card-name { font-weight: 800; font-size: 1rem; margin-bottom: 4px; }
.lunch-card-date { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.lunch-card-desc { font-size: 0.85rem; color: var(--muted); }

.stars-small { color: var(--yellow); font-size: 0.9rem; }

/* ===== FORMS ===== */
.form-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 5px;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  resize: vertical;
}

.form-control:focus { border-color: var(--purple); }

/* ===== REVIEWS ===== */
.reviews-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.review-item {
  background: #F8F9FF;
  border-radius: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--blue);
}

.review-author { font-weight: 700; font-size: 0.9rem; color: var(--purple); }
.review-date   { font-size: 0.75rem; color: var(--muted); }
.review-text   { margin-top: 5px; font-size: 0.92rem; }

/* ===== SUGGESTIONS LIST ===== */
.suggestions-list { display: flex; flex-direction: column; gap: 10px; }

.suggestion-item {
  background: white;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--pink);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.suggestion-text { font-size: 0.95rem; flex: 1; }
.suggestion-author { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  background: var(--text);
  color: white;
  padding: 11px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease, fadeOut 0.4s ease 2.6s forwards;
  white-space: nowrap;
}

.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.info    { background: var(--blue); }

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

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ===== DIVIDER ===== */
.divider {
  border: none;
  border-top: 2px dashed #E0E0E0;
  margin: 6px 0;
}

/* ===== TABS ===== */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

.tab-btn {
  padding: 8px 18px;
  border: 2px solid transparent;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  background: white;
  color: var(--muted);
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
}

.tab-btn:not(.active):hover {
  border-color: var(--purple);
  color: var(--purple);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--muted);
  font-size: 0.95rem;
}
.empty-state .emoji { font-size: 2.5rem; margin-bottom: 8px; }

/* ===== ADMIN STYLES ===== */
.admin-header {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  padding: 18px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.admin-header h1 { color: white; font-size: 1.4rem; font-weight: 900; }
.admin-header .subtitle { color: rgba(255,255,255,0.85); font-size: 0.82rem; }

.admin-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.admin-nav .nav-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.admin-nav .nav-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.section-panel {
  display: none;
}
.section-panel.active { display: block; }

.suggestions-admin-item {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--pink);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.delete-btn {
  background: var(--red);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.delete-btn:hover { background: #e05555; transform: scale(1.05); }

.login-wrap {
  max-width: 380px;
  margin: 60px auto;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 36px 28px;
  text-align: center;
}

.login-wrap .lock-icon { font-size: 3rem; margin-bottom: 12px; }
.login-wrap h2 { font-size: 1.4rem; margin-bottom: 6px; color: var(--purple); }
.login-wrap p  { color: var(--muted); margin-bottom: 20px; font-size: 0.9rem; }

.image-preview {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 8px;
  display: none;
  border: 2px solid #E0E0E0;
}

.image-preview.visible { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .header h1 { font-size: 1.3rem; }
  .today-name { font-size: 1.3rem; }
  .today-img { height: 180px; }
  .interaction-row { gap: 10px; }
  .star { font-size: 1.4rem; }
  .lunch-card-img { width: 80px; min-width: 80px; height: 80px; }
  .admin-nav .nav-btn { font-size: 0.8rem; padding: 8px 10px; }
}

/* ===== SCROLL BAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 4px; }

/* ===== LOADING SPINNER ===== */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

/* ===== ADMIN LUNCH LIST ===== */
.admin-lunch-item {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--green);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.admin-lunch-item img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
}

.admin-lunch-info { flex: 1; }
.admin-lunch-name { font-weight: 800; font-size: 0.95rem; }
.admin-lunch-date { font-size: 0.78rem; color: var(--muted); }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 6px;
  transition: color 0.2s;
}

.back-btn:hover { color: white; }
