@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ===== CSS VARIABLES — LIGHT MODE (default) ===== */
:root {
  --primary: #0077b6;
  --primary-light: #00b4d8;
  --primary-dark: #023e8a;
  --accent: #f77f00;
  --accent-light: #fcbf49;
  --surface: #f0f7fb;
  --surface-2: #ffffff;
  --surface-3: #daeef8;
  --surface-card: rgba(255, 255, 255, 0.92);
  --surface-card-hover: rgba(0, 119, 182, 0.07);
  --border: rgba(0, 119, 182, 0.12);
  --border-strong: rgba(0, 119, 182, 0.35);
  --text-primary: #01273d;
  --text-secondary: #145c82;
  --text-muted: #4a85a3;
  --glass-bg: rgba(240, 247, 251, 0.82);
  --glass-border: rgba(0, 180, 216, 0.2);
  --shadow: 0 4px 24px rgba(0, 77, 128, 0.08);
  --shadow-md: 0 8px 30px rgba(0, 77, 128, 0.1);
  --shadow-lg: 0 16px 56px rgba(0, 77, 128, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --cat-tourism: #06d6a0;
  --cat-culture: #f77f00;
  --cat-sport: #ef476f;
  --cat-education: #118ab2;
  --cat-community: #8338ec;
  --cat-health: #ff6b6b;
  --cat-holiday: #e63946;
  --cat-default: #94a3b8;
}

/* ===== DARK MODE ===== */
body.dark {
  --surface: #0d1b2a;
  --surface-2: #112233;
  --surface-3: #1a2f45;
  --surface-card: rgba(255, 255, 255, 0.05);
  --surface-card-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(0, 180, 216, 0.3);
  --text-primary: #e8f4f8;
  --text-secondary: #8db8cc;
  --text-muted: #4a7a90;
  --glass-bg: rgba(13, 27, 42, 0.85);
  --glass-border: rgba(0, 180, 216, 0.2);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Sarabun', 'Outfit', sans-serif;
  background-color: var(--surface);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(0, 180, 216, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(0, 119, 182, 0.08) 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(131, 56, 236, 0.03) 0%, transparent 70%);
}

body.dark {
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(0, 119, 182, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(247, 127, 0, 0.1) 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(131, 56, 236, 0.06) 0%, transparent 70%);
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input {
  font-family: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 99px;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.loading-logo span {
  color: var(--accent);
}

.loading-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 99px;
  animation: loadBar 1.6s ease-in-out forwards;
}

@keyframes loadBar {
  0% {
    width: 0%
  }

  60% {
    width: 80%
  }

  100% {
    width: 100%
  }
}

/* ===== APP LAYOUT ===== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 24px;
  box-shadow: 0 1px 12px rgba(0, 77, 128, 0.06);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.header-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header-logo-text .title-th {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-logo-text .title-en {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 240px;
}

.search-bar:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.search-bar svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  width: 100%;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.btn-font-size {
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 700;
  transition: all var(--transition);
  padding: 0 6px;
  font-size: 0.78rem;
}

.btn-font-size:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.font-size-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px;
}

/* Header Buttons */
.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-icon:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-icon.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-pill {
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-secondary);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-pill:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
}

.btn-pill.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-color: transparent;
  color: white;
}

.btn-pill .ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-light);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  gap: 24px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.sidebar-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Category filters */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.cat-item:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
  transform: translateX(4px);
}

.cat-item.active {
  background: linear-gradient(135deg, rgba(0, 119, 182, 0.1), rgba(0, 180, 216, 0.08));
  color: var(--primary-dark);
  border-color: var(--border-strong);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface-3);
  border-radius: 99px;
  padding: 1px 7px;
}

/* Mini stats */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-cell {
  background: linear-gradient(135deg, var(--surface-3), var(--surface-card));
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.stat-cell:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow);
}

.stat-num {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* AI Panel */
.ai-panel {
  border-color: rgba(139, 56, 236, 0.3);
}

.ai-api-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-key-input {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  transition: border-color var(--transition);
}

.ai-key-input:focus {
  border-color: var(--primary-light);
}

.ai-key-input::placeholder {
  color: var(--text-muted);
}

.btn-save-key {
  background: linear-gradient(135deg, #8338ec, #5a189a);
  color: white;
  border-radius: var(--radius-xs);
  padding: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity var(--transition);
}

.btn-save-key:hover {
  opacity: 0.85;
}

.ai-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.ai-status.connected {
  color: var(--cat-tourism);
}

/* ===== CALENDAR AREA ===== */
.calendar-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Calendar Header */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-month-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 180px;
}

.cal-month-title span {
  color: var(--primary-light);
}

.btn-nav {
  width: 36px;
  height: 36px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-nav:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
  transform: scale(1.08);
}

.btn-today {
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-today:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
}

.view-toggle {
  display: flex;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}

.view-btn {
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.view-btn.active {
  background: var(--primary);
  color: white;
}

/* AI Highlights Banner */
.ai-highlights {
  background: linear-gradient(135deg, rgba(131, 56, 236, 0.15), rgba(0, 119, 182, 0.15));
  border: 1px solid rgba(131, 56, 236, 0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: none;
  gap: 12px;
  align-items: flex-start;
}

.ai-highlights.visible {
  display: flex;
}

.ai-highlights-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.ai-highlights-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ai-highlights-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 0.9rem;
}

/* ===== CALENDAR GRID (Month View) ===== */
.calendar-grid-wrap {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.calendar-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: linear-gradient(135deg, var(--surface-3), rgba(0, 180, 216, 0.08));
  padding: 0;
}

.calendar-dow {
  text-align: center;
  padding: 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.calendar-dow:first-child {
  color: var(--cat-health);
}

.calendar-dow:last-child {
  color: var(--primary-light);
}

.calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  height: 120px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.cal-day:nth-child(7n) {
  border-right: none;
}

.cal-day:hover {
  background: var(--surface-card-hover);
  box-shadow: inset 0 0 0 2px rgba(0, 180, 216, 0.15);
}

.cal-day.other-month {
  opacity: 0.3;
}

.cal-day.today {
  background: linear-gradient(135deg, rgba(0, 119, 182, 0.08), rgba(0, 180, 216, 0.06));
}

.cal-day.today .day-num {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 2px 8px rgba(0, 119, 182, 0.3);
}



.day-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.cal-day.weekend .day-num {
  color: var(--primary-light);
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.day-event-chip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.day-event-chip:hover {
  opacity: 0.88;
  transform: scale(1.03);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.day-more {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 1px 4px;
}

/* ===== LIST VIEW (Premium Redesign) ===== */
.list-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 24px;
}

/* Date group divider */
.list-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 10px;
}

.list-date-divider:first-child {
  padding-top: 4px;
}

.list-date-divider-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.list-date-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Event card — premium redesign */
.list-event-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.list-event-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.list-event-card:hover .list-card-body {
  background: var(--surface-card-hover);
}

/* Left color stripe (replaces the ::before 3px bar) */
.list-card-stripe {
  width: 5px;
  flex-shrink: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Date badge */
.list-date-badge {
  text-align: center;
  flex-shrink: 0;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border-right: 1px solid var(--border);
}

.list-date-day {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.list-date-month {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Card body */
.list-card-body {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background var(--transition);
}

.list-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.list-event-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  flex: 1;
}

/* Days-remaining badge */
.days-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 3px 9px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.days-badge.today {
  background: linear-gradient(135deg, #06d6a0, #00b09b);
  color: white;
  box-shadow: 0 2px 8px rgba(6, 214, 160, 0.35);
}

.days-badge.soon {
  background: linear-gradient(135deg, #f77f00, #fcbf49);
  color: white;
  box-shadow: 0 2px 8px rgba(247, 127, 0, 0.3);
}

.days-badge.upcoming {
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.days-badge.past {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  opacity: 0.7;
}

.list-event-card.is-past {
  opacity: 0.65;
}

.list-event-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-event-cat {
  font-size: 0.7rem;
  border-radius: 99px;
  padding: 2px 9px;
  color: white;
  font-weight: 600;
}

.list-event-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.list-event-loc {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== LANG TOGGLE BUTTON ===== */
.btn-lang {
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-secondary);
  transition: all var(--transition);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-lang:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-lang .lang-active {
  color: var(--primary-light);
  font-weight: 800;
}

/* ===== MONTH SLIDE ANIMATION ===== */
@keyframes slideOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(-50px);
    opacity: 0;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(50px);
    opacity: 0;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(50px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

#view-month.slide-out-left {
  animation: slideOutLeft 260ms ease forwards;
}

#view-month.slide-out-right {
  animation: slideOutRight 260ms ease forwards;
}

#view-month.slide-in-left {
  animation: slideInLeft 260ms ease forwards;
}

#view-month.slide-in-right {
  animation: slideInRight 260ms ease forwards;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 0.9rem;
}

/* ===== EVENT MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 22px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: translateY(30px) scale(0.96);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-hero {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(135deg, var(--surface-3), rgba(0, 180, 216, 0.1));
  display: block;
  position: relative;
  overflow: hidden;
}

.modal-hero-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
}

.modal-body {
  padding: 26px;
}

.modal-cat-badge {
  display: inline-block;
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 18px;
  line-height: 1.35;
  color: var(--text-primary);
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--surface-3), transparent);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.modal-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.modal-meta-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-meta-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-map-link {
  color: var(--primary-light);
  font-size: 0.75rem;
}

.modal-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* AI Tips in Modal */

.modal-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.modal-ai-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-get-tips {
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(139, 56, 236, 0.2);
  border: 1px solid rgba(139, 56, 236, 0.4);
  color: #c084fc;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-get-tips:hover {
  background: rgba(139, 56, 236, 0.35);
}

.modal-tips-box {
  background: rgba(139, 56, 236, 0.08);
  border: 1px solid rgba(139, 56, 236, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  min-height: 60px;
  display: none;
}

.modal-tips-box.visible {
  display: block;
}

.modal-tips-box.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

/* EN Translation */
.modal-en-section {
  margin-top: 10px;
}

.modal-en-box {
  background: rgba(0, 119, 182, 0.08);
  border: 1px solid rgba(0, 119, 182, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: none;
}

.modal-en-box.visible {
  display: block;
}

/* Modal Action Buttons */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0, 119, 182, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary-action::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 119, 182, 0.4);
}

.btn-primary-action:hover::after {
  opacity: 1;
}

.btn-primary-action:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 119, 182, 0.25);
}

.btn-doc-action {
  background: linear-gradient(135deg, #e63946, #ff6b6b);
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}

.btn-doc-action:hover {
  box-shadow: 0 6px 24px rgba(230, 57, 70, 0.4);
}

.modal-secondary-actions {
  display: flex;
  gap: 8px;
}

.btn-secondary-action {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface-card);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-secondary-action:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Modal close button */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background var(--transition);
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.modal-hero-wrap {
  position: relative;
}

/* ===== API KEY MODAL ===== */
.api-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.api-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.api-modal-card {
  background: var(--surface-2);
  border: 1px solid rgba(139, 56, 236, 0.4);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  padding: 28px;
  box-shadow: 0 0 60px rgba(139, 56, 236, 0.2);
}

.api-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.api-modal-subtitle {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.api-modal-input {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}

.api-modal-input:focus {
  border-color: var(--primary-light);
}

.api-modal-actions {
  display: flex;
  gap: 8px;
}

.btn-api-save {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #8338ec, #5a189a);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity var(--transition);
}

.btn-api-save:hover {
  opacity: 0.85;
}

.btn-api-cancel {
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.btn-api-cancel:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(100%);
  opacity: 0;
  animation: toastIn 0.3s ease forwards;
  max-width: 320px;
}

.toast.success {
  border-color: rgba(6, 214, 160, 0.5);
}

.toast.error {
  border-color: rgba(239, 71, 111, 0.5);
}

@keyframes toastIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

/* ===== SPINNER ===== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.spinner-purple {
  border-top-color: #c084fc;
  border-color: rgba(139, 56, 236, 0.2);
}

/* ===== RESPONSIVE — TABLET (≤900px) ===== */
@media (max-width: 900px) {
  .sidebar {
    width: 200px;
  }

  .cal-day {
    min-height: 80px;
  }

  .search-bar {
    width: 180px;
  }
}

/* ===== RESPONSIVE — MOBILE (≤720px) ===== */
@media (max-width: 720px) {

  /* --- Header: 2-row compact layout --- */
  .app-header {
    padding: 0 14px;
    position: sticky;
    top: 0;
    z-index: 200;
  }

  .header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    align-items: center;
  }

  /* Row 1: logo + actions */
  .header-logo {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-logo-text .title-th {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-logo-text .title-en {
    display: none;
  }

  .header-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  /* Hide less-critical header buttons on mobile */
  #source-badge {
    display: none;
  }

  .btn-lang {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .btn-font-size {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  /* Row 2: search bar full width */
  .search-bar {
    display: flex;
    width: 100%;
    order: 10;
    /* push to new row */
    padding: 6px 14px;
    border-radius: 99px;
  }

  /* --- Main layout: single column --- */
  .main-content {
    flex-direction: column;
    padding: 12px 12px 80px;
    /* bottom padding for sticky nav */
    gap: 12px;
  }

  .sidebar {
    width: 100%;
    gap: 10px;
  }

  /* Reorder sidebar cards: stats first, then categories */
  .sidebar-card:first-child {
    order: 1;
  }

  .sidebar-card:nth-child(2) {
    order: 2;
  }

  .sidebar-card:nth-child(3) {
    order: 3;
  }

  /* --- Stats grid: 4 columns --- */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .stat-cell {
    padding: 10px 6px;
  }

  .stat-num {
    font-size: 1.1rem;
  }

  /* --- Collapsible category filter --- */
  .sidebar-title.cat-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    user-select: none;
  }

  .sidebar-title.cat-toggle::after {
    content: '▾';
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.25s ease;
  }

  .sidebar-title.cat-toggle.collapsed::after {
    transform: rotate(-90deg);
  }

  .cat-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 1;
  }

  .cat-list.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
  }

  .cat-item {
    font-size: 0.78rem;
    padding: 5px 10px;
    border-radius: 99px;
    gap: 5px;
  }

  .cat-item:hover {
    transform: none;
  }

  .cat-count {
    font-size: 0.65rem;
    padding: 0 5px;
  }

  /* --- Calendar area --- */
  .calendar-area {
    gap: 12px;
  }

  .cal-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .cal-nav {
    justify-content: space-between;
    width: 100%;
  }

  .cal-month-title {
    font-size: 1.15rem;
    min-width: 0;
    flex: 1;
    text-align: center;
  }

  /* --- View toggle → sticky bottom nav bar --- */
  .view-toggle {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-top: 1px solid var(--glass-border);
    border-radius: 0;
    padding: 8px 16px 12px;
    display: flex;
    gap: 4px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }

  .view-btn {
    flex: 1;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    line-height: 1.2;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
  }

  .view-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
  }

  /* --- Calendar grid --- */
  .cal-day {
    min-height: 62px;
    padding: 4px;
  }

  .day-num {
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
  }

  .day-event-chip {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  /* --- List view on mobile --- */
  .list-date-day {
    font-size: 1.4rem;
  }

  .list-card-body {
    padding: 10px 12px;
  }

  .list-event-title {
    font-size: 0.88rem;
  }

  .days-badge {
    font-size: 0.65rem;
    padding: 2px 7px;
  }

  /* --- Modal --- */
  .modal-meta-grid {
    grid-template-columns: 1fr;
  }

  .modal-secondary-actions {
    flex-direction: column;
  }

  .modal-card {
    border-radius: 18px;
  }
}

/* ===== RESPONSIVE — SMALL PHONES (≤400px) ===== */
@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-num {
    font-size: 1.2rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  .cal-day {
    min-height: 52px;
  }

  .day-event-chip {
    display: none;
  }

  .header-logo-text {
    max-width: 140px;
  }
}

.btn-like {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.btn-like.liked {
  background: rgba(239, 71, 111, 0.1);
  border-color: rgba(239, 71, 111, 0.4);
  color: #ef476f;
}

.btn-like:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* ===== LEAFLET MARKER CLUSTER OVERRIDES ===== */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(67, 97, 238, 0.4) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(67, 97, 238, 0.9) !important;
  color: white !important;
  font-family: var(--font-primary) !important;
  font-weight: 700 !important;
  border: 2px solid white !important;
  box-shadow: var(--shadow-md) !important;
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0 12px;
  }

  .modal-meta-grid {
    grid-template-columns: 1fr;
  }

  .modal-secondary-actions {
    flex-direction: column;
  }

  #view-month {
    padding: 0 4px;
  }

  .calendar-grid-wrap {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .cal-day {
    min-height: 70px;
    padding: 2px;
  }

  .day-num {
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
  }

  .day-event-chip {
    font-size: 0.55rem;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 4px;
  }

  .list-event-card {
    padding: 12px;
    gap: 12px;
    border-radius: 12px;
  }

  .list-date-badge {
    min-width: 50px;
    padding: 8px 4px;
  }

  .list-date-day {
    font-size: 1.5rem;
  }

  .list-date-month {
    font-size: 0.8rem;
  }

  .list-event-title {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }

  .list-event-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ===== CALENDAR SLIDE ANIMATIONS ===== */
@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-40px);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#view-month {
  will-change: transform, opacity;
}

#view-month.slide-out-left {
  animation: slideOutLeft 260ms ease forwards;
}

#view-month.slide-out-right {
  animation: slideOutRight 260ms ease forwards;
}

#view-month.slide-in-left {
  animation: slideInLeft 280ms ease forwards;
}

#view-month.slide-in-right {
  animation: slideInRight 280ms ease forwards;
}

/* ===== MULTI-DAY EVENT STYLES ===== */
.list-date-range-end {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 1px;
  letter-spacing: 0;
}

.list-event-card.is-multi-day {
  border-left: 3px solid var(--accent);
}

.list-event-card.is-multi-day .list-date-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
}

.list-event-card.is-multi-day .list-date-day {
  color: white;
}

.list-event-card.is-multi-day .list-date-month {
  color: rgba(255, 255, 255, 0.85);
}

.list-event-card.is-multi-day .list-date-range-end {
  color: rgba(255, 255, 255, 0.8);
}

/* ===== HEART BOOKMARK BUTTON ===== */
.btn-like {
  font-size: 1.5rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
  flex-shrink: 0;
}

.btn-like:hover {
  background: rgba(239, 71, 111, 0.10);
  transform: scale(1.2);
}

.btn-like.liked {
  animation: heartPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes heartPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
  }

  100% {
    transform: scale(1);
  }
}

/* ===== FAVORITES TAB BUTTON ===== */
.view-btn-fav {
  color: #e63946;
}

.view-btn-fav.active {
  background: linear-gradient(135deg, #e63946, #ff6b6b) !important;
  color: white !important;
}

/* ===== FAVORITES REMOVE BUTTON on card ===== */
.fav-card {
  position: relative;
}

.fav-remove-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.2s, background 0.15s;
  line-height: 1;
}

.fav-remove-btn:hover {
  background: rgba(230, 57, 70, 0.12);
  transform: scale(1.2);
}

/* ===== COLLAPSIBLE CATEGORY FILTER ===== */
.cat-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.cat-toggle::after {
  content: '−';
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  transition: transform 0.25s ease;
  line-height: 1;
}

.cat-toggle.collapsed::after {
  content: '+';
}

.cat-list {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 1;
}

.cat-list.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Mobile: collapsed by default */
@media (max-width: 768px) {
  .cat-list {
    max-height: 0;
    opacity: 0;
  }

  .cat-toggle::after {
    content: '+';
  }

  .cat-toggle.expanded::after {
    content: '−';
  }

  .cat-list.mobile-expanded {
    max-height: 600px;
    opacity: 1;
  }
}

/* ===== QUESTIONNAIRE BUTTON ===== */
.btn-questionnaire-action {
  background: linear-gradient(135deg, #06d6a0, #0cb389) !important;
  color: white !important;
  border-color: transparent !important;
}

.btn-questionnaire-action:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 214, 160, 0.35) !important;
}