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

:root {
  --bg-dark: #f8fafc; /* Neutral light-gray backdrop */
  --bg-dark-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.74); /* Translucent white glass */
  --bg-glass: rgba(255, 255, 255, 0.5);
  --primary: #10b981; /* High contrast emerald green */
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.1);
  --secondary: #06b6d4; /* Sunny cyan sky */
  --accent: #d97706; /* Earth amber */
  --accent-glow: rgba(217, 119, 6, 0.08);
  --text-main: #0f172a; /* Slate 900 for text readability */
  --text-muted: #334155; /* Slate 700 for descriptions */
  --border-color: rgba(16, 185, 129, 0.16); /* Emerald green borders */
  --border-active: rgba(16, 185, 129, 0.35);
  --font-sans: 'Outfit', 'Noto Sans JP', sans-serif;
  --font-gothic: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
}

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

.keep-together {
  display: inline-block;
  white-space: normal;
}

.form-actions-flex {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

body {
  background-color: var(--bg-dark);
  background-image: none;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.75;
  letter-spacing: 0.03em;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Ambient glow blobs in background */
body::before, body::after {
  content: '';
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.12;
  pointer-events: none;
  display: none; /* Hide green/blue ambient glow */
}

body::before {
  top: -10%;
  right: -10%;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

body::after {
  bottom: -10%;
  left: -10%;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-dark-secondary);
  border: 2px solid var(--bg-dark);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-active);
}

/* Layout */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(248, 250, 252, 0.85);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-gothic);
  font-size: 1.5rem;
  font-weight: 300;
  color: #000000;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 1px;
}

.logo span {
  color: #064e3b;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-glow);
}

.nav-btn {
  background: var(--primary);
  color: var(--bg-dark) !important;
  font-weight: 600;
}

.nav-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 15px var(--primary-glow);
}

main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  position: relative;
}

footer {
  font-family: var(--font-gothic);
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-dark-secondary);
}

/* Glassmorphism Cards */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: var(--transition-smooth);
}

/* Routing Views */
.view-section {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
  display: block;
}

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

/* Hero Section */
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 0;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero-text h1 span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.cta-group {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 4rem;
}

.stat-item {
  background: var(--bg-glass);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: var(--transition-smooth);
}

.stat-item.stat-featured {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
  background: var(--bg-card);
  transform: scale(1.03);
}

.stat-item.stat-featured:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.22);
}

.stat-item.stat-featured .stat-label {
  font-weight: 700;
  color: var(--text-main);
}

.stat-item.stat-secondary {
  opacity: 0.6;
  border-color: rgba(16, 185, 129, 0.08);
}

.stat-item.stat-secondary:hover {
  opacity: 0.9;
  transform: scale(1.01);
}

.stat-item.stat-secondary .stat-num {
  color: var(--text-muted);
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.25rem;
  text-decoration: none;
}
a.stat-num:hover {
  color: var(--primary-hover);
  transform: scale(1.08);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-visual {
  display: flex;
  justify-content: center;
  position: relative;
}

.badge-illustration {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-active);
  position: relative;
  animation: rotateDashed 60s linear infinite;
}

.badge-illustration::after {
  content: '🧹';
  font-size: 6rem;
  position: absolute;
  animation: float 4s ease-in-out infinite;
}

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

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

/* Forms & UI Elements */
.form-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.9rem 1.2rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  background: #ffffff;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Primary/Secondary Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #10b981 100%);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 222, 128, 0.3);
}

.btn-featured-events {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
}

.btn-featured-events:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.35);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.25);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Invitation Dialog / Gate Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 14, 11, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  max-width: 480px;
  width: 90%;
  transform: scale(0.9);
  transition: var(--transition-smooth);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* Event List Grid */
.events-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.events-header h2 {
  font-size: 2.25rem;
  font-weight: 800;
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* Event Card Design */
.event-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
}

.event-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-active);
  box-shadow: 0 12px 40px rgba(74, 222, 128, 0.08);
}

.event-card-header {
  margin-bottom: 1rem;
}

.event-tag {
  display: inline-block;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  margin-bottom: 0.75rem;
}

.event-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.event-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.event-card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.host-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
}

.avatar-1 { background: linear-gradient(135deg, #34d399, #059669); }
.avatar-2 { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.avatar-3 { background: linear-gradient(135deg, #fb7185, #e11d48); }
.avatar-4 { background: linear-gradient(135deg, #fbbf24, #d97706); }
.avatar-5 { background: linear-gradient(135deg, #c084fc, #7c3aed); }

.host-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
}

.host-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

.capacity-indicator {
  text-align: right;
}

.capacity-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.capacity-text.full {
  color: #f87171;
}

.capacity-bar {
  width: 60px;
  height: 4px;
  background: var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.capacity-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* Event Detail Page */
.detail-layout {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 2.5rem;
}

.detail-layout > div,
.dashboard-grid > div {
  min-width: 0;
}

.detail-main h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.detail-meta-box {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-desc {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-bottom: 2rem;
}

.mock-map {
  height: 220px;
  background: #eefdf6;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.mock-map-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0.45;
  background-image: 
    radial-gradient(var(--primary) 1.5px, transparent 1.5px),
    radial-gradient(var(--primary) 1.5px, transparent 1.5px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
}

.mock-map-pin {
  font-size: 2rem;
  z-index: 1;
  animation: float 2.5s ease-in-out infinite;
}

.mock-map-label {
  position: absolute;
  bottom: 1rem;
  background: var(--bg-dark);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 500;
}

.sidebar-box {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.participant-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
}

.participant-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.participant-name {
  font-size: 0.9rem;
  font-weight: 500;
}

/* User Account Profile */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  word-break: break-all;
  overflow-wrap: break-word;
}
.profile-card p, .profile-card h3 {
  max-width: 100%;
}

.profile-avatar-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.profile-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--bg-dark-secondary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.profile-email {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.profile-bio {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.profile-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.interest-tag {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

/* Profile Form Elements */
.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.avatar-option {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  display: flex; /* Remove !important to allow inline display: none to work */
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important; /* Slightly smaller emoji size to fit better */
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition-smooth);
}

.avatar-option:hover {
  transform: scale(1.05);
}

.avatar-option.selected {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.interests-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.interest-option {
  background: rgba(9, 14, 11, 0.5);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
  user-select: none;
}

.interest-option:hover {
  border-color: var(--text-muted);
}

.interest-option.selected {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: var(--primary);
}

/* Dashboard Tabs Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr; /* Widened from 280px to prevent inputs and avatars from wrapping/overflowing on PC */
  gap: 2.5rem;
  align-items: start;
}

.account-tabs {
  margin-top: 1.5rem;
}

.tab-nav {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.tab-nav::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.tab-btn:hover, .tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease forwards;
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.dashboard-item:hover {
  border-color: var(--border-active);
}

.dashboard-item-info h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.dashboard-item-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
  width: 90%;
}

.toast {
  background: rgba(18, 30, 23, 0.95);
  color: #ffffff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 4px solid var(--primary);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.3s ease forwards;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast-content {
  font-size: 0.9rem;
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.toast-close:hover {
  color: #ffffff;
}

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* Scroll lock control for TOP page (Home) */
body.home-active {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.home-active main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  overflow: hidden;
  height: auto;
}
body.home-active .hero {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
body.home-active .hero > .glass-panel {
  max-height: 90%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Fade transition for slideshow info */
#home-bg-event-title-container {
  transition: opacity 0.5s ease-in-out;
  opacity: 1;
}
#home-bg-event-title-container.fade-out {
  opacity: 0;
}

/* Background Slideshow Layers for Smooth Crossfade */
#bg-slideshow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
  display: none !important;
}
body.home-active #bg-slideshow-container {
  display: block !important;
}
.bg-slide-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  transition: opacity 1.5s ease-in-out;
  opacity: 0;
}
.bg-slide-layer.active {
  opacity: 1;
  z-index: -1;
}
.bg-slide-layer.next {
  opacity: 1;
  z-index: -2;
}

#admin-settings-form button {
  align-self: flex-start;
}

/* Responsive CSS */
@media (max-width: 992px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero-text h1 {
    font-size: 2.75rem;
  }
  .cta-group {
    justify-content: center;
  }
  .hero-visual {
    order: -1;
  }
  .dashboard-grid, .detail-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  :root {
    --bg-card: rgba(255, 255, 255, 0.45);
    --bg-glass: rgba(255, 255, 255, 0.25);
  }
  .nav-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .nav-menu {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }
  .logo {
    font-size: 1.25rem;
  }
  main {
    padding: 1.5rem 1rem;
  }
  .glass-panel {
    padding: 1.25rem !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .avatar-picker-grid {
    gap: 0.5rem !important;
  }
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .cta-group {
    flex-direction: column;
    width: 100%;
  }
  .cta-group .btn {
    width: 100%;
  }
  h2 {
    font-size: 1.6rem;
  }
  .hero-text h1 {
    font-size: 2rem;
  }
  .hero-text p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
  }
  .form-title {
    font-size: 1.5rem;
  }
  .detail-main h2 {
    font-size: 1.5rem;
  }
  .events-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  /* Horizontal scrollable tab navigation on mobile */
  .tab-nav {
    gap: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 2px;
  }
  .tab-nav::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
  }
  .tab-btn {
    font-size: 0.85rem;
    padding: 0.6rem 0.5rem;
    flex-shrink: 0;
  }
  /* Form actions responsiveness */
  .form-actions-flex {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }
  .form-actions-flex .btn {
    width: 100%;
  }
  #admin-settings-form button {
    align-self: stretch;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.15rem;
  }
  .hero-text h1 {
    font-size: 1.75rem;
  }
  .form-title {
    font-size: 1.35rem;
  }
  .detail-main h2 {
    font-size: 1.35rem;
  }
  .calendar-weekdays {
    font-size: 0.75rem !important;
  }
  /* Stack list items on mobile to avoid horizontal squishing */
  .dashboard-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .dashboard-item div[style*="display:flex"] {
    width: 100% !important;
    display: flex !important;
  }
  .dashboard-item div[style*="display:flex"] a,
  .dashboard-item div[style*="display:flex"] button {
    flex: 1 !important;
    text-align: center;
    width: 100% !important;
  }
  footer p {
    font-size: 0.8rem;
    line-height: 1.6;
  }
  .line-modal-actions {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }
}

/* Admin Table Styles */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.06);
}

.admin-table tbody tr {
  transition: var(--transition-smooth);
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table td .avatar-circle {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
}

/* Custom Image Avatar sizing */
.avatar-circle img, .profile-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Fix flex layout for custom previews */
.avatar-picker-grid .avatar-option {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Calendar Styling */
.calendar-day-cell {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  min-height: 100px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition-smooth);
}

.calendar-day-cell:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.15);
}

.calendar-day-cell.today {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.15);
}

.calendar-day-cell.other-month {
  opacity: 0.25;
}

.calendar-day-num {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.calendar-day-events-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
  flex-grow: 1;
}

.calendar-event-badge {
  background: rgba(74, 222, 128, 0.1);
  border-left: 3px solid var(--primary);
  color: var(--text-main);
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition-smooth);
}

.calendar-event-badge:hover {
  background: var(--primary-glow);
  transform: translateX(2px);
}

/* Mobile dot indicator (shown under dates on small screens) */
.calendar-day-dots {
  display: none;
  gap: 3px;
  justify-content: center;
  margin-top: auto;
}

.calendar-event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* Selected day highlight for day-events list loading */
.calendar-day-cell.selected {
  background: var(--primary-glow);
  border-color: var(--primary);
}

/* Calendar responsive sizing */
@media (max-width: 768px) {
  .calendar-day-cell {
    min-height: 55px;
    padding: 0.25rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .calendar-day-num {
    margin-bottom: 0;
    font-size: 0.8rem;
  }
  .calendar-day-events-container {
    display: none; /* Hide text badges on mobile */
  }
  .calendar-day-dots {
    display: flex; /* Show small dots instead */
  }
}

/* LINE Authentication Styles */
.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  background-color: #06c755;
  color: #ffffff;
  transition: var(--transition-smooth);
  width: 100%;
}

.btn-line:hover {
  background-color: #05b04b;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(6, 199, 85, 0.35);
}

.line-logo-badge {
  background: white;
  color: #06c755;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.5px;
  line-height: 1;
}

/* LINE Auth Modal Specifics */
.line-modal-content {
  background: #ffffff;
  color: #111111 !important;
  border-radius: 16px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
  transform: scale(0.9);
  transition: var(--transition-smooth);
}

.modal-overlay.active .line-modal-content {
  transform: scale(1);
}

.line-modal-header {
  background-color: #06c755;
  padding: 1.5rem;
  text-align: center;
  color: white;
}

.line-modal-logo {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.line-modal-body {
  padding: 2rem 1.75rem;
}

.line-app-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 1.25rem;
}

.line-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.line-app-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #1a1a1a;
}

.line-permissions-list {
  margin-bottom: 1.75rem;
}

.line-permissions-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #495057;
  margin-bottom: 0.75rem;
}

.line-permission-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: #212529;
}

.line-permission-item input[type="checkbox"] {
  accent-color: #06c755;
}

.line-user-profile-preview {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  border: 1px solid #dee2e6;
}

.line-user-profile-preview label {
  color: #495057;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  display: block;
}

.line-user-info-text {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.line-mock-field {
  display: flex;
  flex-direction: column;
}

.line-mock-input {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: #212529;
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.15s ease-in-out;
}

.line-mock-input:focus {
  border-color: #06c755;
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.15);
}

.line-accounts-select-box {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  border: 1px solid #dee2e6;
}

.line-accounts-title {
  color: #495057;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.line-account-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.line-account-item:hover {
  background-color: #e9ecef;
}

.line-account-item.selected {
  background-color: rgba(6, 199, 85, 0.08);
  border-color: #06c755;
}

.line-account-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #212529;
}

.line-account-email {
  font-size: 0.75rem;
  color: #868e96;
}

.line-modal-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-line-allow {
  background-color: #06c755;
  color: white;
  flex: 1;
  border: none;
  padding: 0.85rem;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  transition: background-color 0.2s;
}

.btn-line-allow:hover {
  background-color: #05b04b;
}

.btn-line-cancel {
  background-color: #e9ecef;
  color: #495057;
  flex: 1;
  border: none;
  padding: 0.85rem;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  transition: background-color 0.2s;
}

.btn-line-cancel:hover {
  background-color: #dee2e6;
}

/* Home Logo Styles */
.home-logo-container {
  text-align: center;
  margin-bottom: 1.5rem;
  display: none;
  justify-content: center;
  align-items: center;
}

.home-logo {
  max-width: 220px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

@media (max-width: 480px) {
  .home-logo {
    max-width: 170px;
    margin-bottom: 0.5rem;
  }
}

/* Home Text Logo Inside Styles */
.home-text-logo-inside {
  font-family: var(--font-gothic);
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 1.5px;
  margin-bottom: 2rem;
  color: #000000;
  text-align: center;
  line-height: 1.3;
}

.home-text-logo-inside span {
  color: #064e3b;
}

@media (max-width: 600px) {
  .home-text-logo-inside {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
  }
}

/* Floating Corner Logo Animation for TOP page */
@keyframes logoFadeInOut {
  0% {
    opacity: 0;
    transform: scale(0.7) rotate(-5deg);
  }
  25% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  75% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.7) rotate(5deg);
  }
}

.floating-corner-logo {
  position: fixed;
  width: 100px;
  height: 100px;
  z-index: -2; /* Display above background slideshow but behind content cards */
  pointer-events: none;
  background-image: url('logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: brightness(0) invert(1);
  animation: logoFadeInOut 8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@media (max-width: 600px) {
  .floating-corner-logo {
    width: 60px;
    height: 60px;
  }
}

/* Background overrides for Events Hub page */
body.events-active:not(.events-empty-bg-active) {
  background-color: #ffffff;
  background-image: none !important;
}

body.events-empty-bg-active {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Notification and Badges Styles */
.nav-badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #ef4444; /* Bright Red */
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background-color: #ef4444;
  border-radius: 9px;
  margin-left: 6px;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Glassmorphic Alert Banner */
.notif-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.12));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: var(--border-radius-md);
  padding: 1.25rem 1.75rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.notif-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

.notif-banner-icon {
  font-size: 1.4rem;
  animation: pulseBell 2s infinite;
}

/* Notification List & Items */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  transition: var(--transition-smooth);
}

.notification-item:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.06);
}

.notification-item.unread {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.04) 0%, rgba(255, 255, 255, 0.74) 10%);
  border-left: 4px solid var(--primary);
}

.notification-item-content {
  flex-grow: 1;
}

.notification-item-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.notification-item-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.notification-item-time {
  font-size: 0.8rem;
  color: #868e96;
  font-weight: 500;
}

/* Keyframes */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseBell {
  0% { transform: rotate(0); }
  10% { transform: rotate(15deg); }
  20% { transform: rotate(-10deg); }
  30% { transform: rotate(10deg); }
  40% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
  60% { transform: rotate(0); }
  100% { transform: rotate(0); }
}

/* LINE Friendship status box button styling */
#line-friendship-btn {
  width: 100%;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  background-color: #06c15f;
  color: #fff;
  border: none;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(6, 193, 95, 0.2);
}
#line-friendship-btn:hover {
  background-color: #05a852;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(6, 193, 95, 0.3);
}
#line-friendship-btn:active {
  background-color: #049046;
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(6, 193, 95, 0.1);
}
#line-friendship-btn:disabled {
  background-color: #a3a3a3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

/* Referral Relationship Tree Styles */
.referral-tree-container {
  margin-top: 1rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  max-height: 500px;
  overflow-y: auto;
}

.referral-tree-root, .referral-tree-children {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.referral-tree-children {
  margin-left: 28px;
  position: relative;
  border-left: 1px dashed rgba(16, 185, 129, 0.3); /* Emerald border dashed */
}

.referral-tree-node {
  margin: 0.75rem 0;
  position: relative;
}

.referral-tree-children .referral-tree-node::before {
  content: '';
  position: absolute;
  top: 16px;
  left: -28px;
  width: 20px;
  height: 1px;
  border-top: 1px dashed rgba(16, 185, 129, 0.3);
}

.referral-tree-node-content {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.referral-tree-node-content:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--primary);
  transform: translateX(3px);
}

.tree-avatar {
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tree-node-name {
  font-weight: 600;
}

.tree-node-username {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.tree-node-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background-color: var(--primary);
  padding: 0.1rem 0.5rem;
  border-radius: 50px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

/* Mobile Tab Navigation Styling */
@media (max-width: 768px) {
  .tab-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    white-space: normal;
    border-bottom: none;
    margin-bottom: 1.5rem;
  }

  .tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    white-space: normal;
    text-align: center;
    transition: all 0.2s ease;
    font-weight: 600;
  }

  /* Make the 5th item span across both columns for neat symmetry */
  .tab-btn:last-child {
    grid-column: span 2;
  }

  .tab-btn:hover, .tab-btn.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: none;
  }

  .tab-btn.active::after {
    display: none;
  }
}



