/* ─── Reset & Base ─────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cyan: #4FC3F7;
  --cyan-dark: #0288D1;
  --cyan-light: #B3E5FC;
  --cyan-bg: #E1F5FE;
  --red: #E53935;
  --red-light: #FFCDD2;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --text: #263238;
  --text-sub: #78909C;
  --text-light: #B0BEC5;
  --border: #ECEFF1;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.1);
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ─── Header ───────────────────────────────── */
.header {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-dark) 100%);
  color: white;
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg);
  border-radius: 50% 50% 0 0;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 4px;
  font-weight: 400;
}

/* ─── Tabs ─────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  background: var(--card);
  margin: 0 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  z-index: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 1;
  min-width: 48px;
  padding: 12px 4px 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tab-day {
  font-size: 15px;
  font-weight: 600;
}

.tab-date {
  font-size: 11px;
  opacity: 0.7;
}

.tab:hover { color: var(--cyan-dark); background: var(--cyan-bg); }

.tab.active {
  color: var(--cyan-dark);
  background: var(--cyan-bg);
  font-weight: 700;
}

.tab.active .tab-day { color: var(--cyan-dark); }

/* 오늘 표시: 빨간 밑줄 + Today 라벨 */
.tab.today::after {
  content: 'Today';
  position: absolute;
  bottom: 2px;
  font-size: 9px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.5px;
}

.tab.today.active::after {
  color: var(--red);
}

/* ─── Date Title ───────────────────────────── */
.date-title {
  padding: 16px 16px 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.date-title span {
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 400;
  margin-left: 6px;
}

/* ─── Menu Cards ───────────────────────────── */
.menu-area {
  flex: 1;
  padding: 8px 12px 16px;
}

.menu-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.menu-card:hover { box-shadow: var(--shadow-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-icon {
  font-size: 22px;
}

.card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.card-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--cyan-bg);
  color: var(--cyan-dark);
  white-space: nowrap;
}

.menu-list {
  list-style: none;
  padding: 8px 0;
}

.menu-item {
  font-size: 14px;
  padding: 8px 16px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.5;
  color: var(--text);
}

.menu-emoji {
  font-size: 16px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.menu-text {
  flex: 1;
}

.menu-sub {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 1px;
}

/* 빈 상태 / 휴무 */
.empty-card {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-sub);
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.empty-text {
  font-size: 14px;
}

/* ─── Footer ───────────────────────────────── */
.footer {
  padding: 12px 12px 28px;
  text-align: center;
}

.btn-refresh {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-dark) 100%);
  color: white;
  border: none;
  border-radius: 28px;
  padding: 13px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(79,195,247,0.3);
  letter-spacing: -0.3px;
}

.btn-refresh:active {
  transform: scale(0.96);
}

.btn-refresh.loading {
  opacity: 0.7;
  pointer-events: none;
}

.update-info {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 8px;
}

.source-info {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 4px;
  opacity: 0.7;
}

.source-info a {
  color: var(--text-light);
  text-decoration: none;
}

/* ─── Loading ──────────────────────────────── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sub);
  font-size: 14px;
}

.loading::before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}

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

.error {
  text-align: center;
  padding: 50px 20px;
  color: #E53935;
  font-size: 14px;
}

.cache-badge {
  display: inline-block;
  background: var(--cyan-dark);
  color: white;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 600;
  vertical-align: middle;
}

/* ─── 반응 & 댓글 ────────────────────────── */
  font-size: 12px;
  opacity: 0.6;
  flex-shrink: 0;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-sub);
}





.comment-count {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-sub);
  transition: color 0.2s;
}

.comment-count:hover,
.comment-count.active {
  color: var(--cyan-dark);
}

/* ─── 탭 개선 ────────────────────────────── */
.tab.active .tab-date {
  color: var(--cyan-dark);
  font-weight: 600;
}

.tab.today .tab-day {
  color: var(--red);
}



/* ─── 식단 요청 게시판 ───────────────────── */
.request-section {
  padding: 16px 12px;
  text-align: center;
}

.btn-request {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto 16px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-dark) 100%);
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79,195,247,0.25);
}

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

.recent-requests {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.recent-requests .loading,
.recent-requests .empty,
.recent-requests .error {
  padding: 24px;
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
}

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

.request-list li {
  border-bottom: 1px solid var(--border);
}

.request-list li:last-child {
  border-bottom: none;
}

.request-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s;
}

.request-list a:hover {
  background: var(--bg);
}

.request-list strong {
  font-size: 14px;
  font-weight: 500;
}

.request-list .meta {
  font-size: 11px;
  color: var(--text-light);
  margin-left: 8px;
  white-space: nowrap;
}
