/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* ===========================
   YACHAY — Modern Design System
   Clean, minimal, earth-rooted
   =========================== */

:root {
  /* Core palette */
  --primary: #1A3C34;
  --primary-mid: #2D6A4F;
  --primary-soft: #40916C;
  --primary-pale: #D8F3DC;
  --accent: #C9913E;
  --accent-light: #E5C88E;
  --accent-pale: #FFF3E0;
  --river: #2A7B88;
  --river-light: #4DB6AC;

  /* Neutrals */
  --bg: #F8F7F4;
  --bg-card: #FFFFFF;
  --bg-elevated: #F1EFEA;
  --bg-hover: #ECEAE5;
  --text: #1A1A1A;
  --text-secondary: #5A5A5A;
  --text-muted: #9A9A9A;
  --border: #E5E3DE;
  --border-light: #F0EEEA;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);

  /* Layout */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --nav-height: 68px;
  --top-bar-height: 56px;
  --max-width: 1120px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + 8px);
  padding-top: var(--top-bar-height);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* ===========================
   TYPOGRAPHY
   =========================== */
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
h3 { font-size: 15px; font-weight: 600; }

/* ===========================
   BUTTONS
   =========================== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600; font-size: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-mid); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600; font-size: 14px;
  border: 1px solid rgba(255,255,255,0.25);
  transition: var(--transition);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.25); }

.btn-full { width: 100%; justify-content: center; }

/* ===========================
   TOP BAR
   =========================== */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--top-bar-height);
  background: rgba(248, 247, 244, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
}

.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto; height: 100%;
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
}

.logo {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; flex-shrink: 0;
}
.logo-mark { width: 28px; height: 28px; }
.logo-text {
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.5px; color: var(--primary);
}

.search-container {
  flex: 1; max-width: 420px;
  position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 12px;
  width: 16px; height: 16px;
  color: var(--text-muted); pointer-events: none;
}
.search-input {
  width: 100%; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 36px 0 36px;
  background: var(--bg-card); font-size: 13px;
  transition: var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(26, 60, 52, 0.08);
}
.search-clear {
  position: absolute; right: 6px;
  width: 24px; height: 24px;
  border-radius: var(--radius-full);
  display: none; align-items: center; justify-content: center;
}
.search-clear svg { width: 14px; height: 14px; color: var(--text-muted); }
.search-clear.visible { display: flex; }

.ambient-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.ambient-toggle svg { width: 16px; height: 16px; color: var(--primary); }
.ambient-toggle .ambient-off { display: none; }
.ambient-toggle.muted .ambient-on { display: none; }
.ambient-toggle.muted .ambient-off { display: block; }
.ambient-toggle.muted svg { color: var(--text-muted); }
.ambient-toggle:hover { background: var(--bg-elevated); }

.lang-toggle {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 600;
  transition: var(--transition);
}
.lang-toggle:hover { background: var(--bg-elevated); }
.lang-icon { width: 16px; height: 16px; color: var(--text-muted); }
.lang-active { color: var(--primary); }
.lang-inactive { color: var(--text-muted); }
.lang-sep { color: var(--border); font-weight: 400; }

/* ===========================
   BOTTOM NAVIGATION
   =========================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 14px;
  border-radius: var(--radius); transition: var(--transition);
}
.nav-item svg { width: 22px; height: 22px; color: var(--text-muted); transition: var(--transition); }
.nav-item span { font-size: 10px; font-weight: 500; color: var(--text-muted); transition: var(--transition); }
.nav-item.active svg { color: var(--primary); stroke-width: 2.2; }
.nav-item.active span { color: var(--primary); font-weight: 700; }

.nav-upload-btn {
  width: 42px; height: 42px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-spring);
}
.nav-upload-btn svg { width: 20px; height: 20px; stroke: white; color: white; }
.nav-upload:hover .nav-upload-btn { transform: scale(1.08); background: var(--primary-mid); }

/* ===========================
   VIEWS
   =========================== */
.main-content { max-width: var(--max-width); margin: 0 auto; }
.view { display: none; padding: 16px; animation: viewIn 0.25s ease; }
.view.active { display: block; }

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

/* ===========================
   HERO
   =========================== */
.hero {
  position: relative; border-radius: var(--radius-xl);
  overflow: hidden; margin-bottom: 28px;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(145deg, #0D2B22 0%, #1A3C34 25%, #2D6A4F 60%, #1A3C34 100%);
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(201, 145, 62, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(42, 123, 136, 0.1) 0%, transparent 50%);
}
.hero-inner {
  position: relative; z-index: 1;
  padding: 40px 32px 28px;
}
.hero-badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.hero-title { font-size: 32px; color: white; margin-bottom: 12px; }
.hero-subtitle {
  font-size: 14px; color: rgba(255,255,255,0.65);
  max-width: 440px; line-height: 1.6; margin-bottom: 24px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 12px; margin-top: 28px;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08);
}
.stat-card {
  display: flex; flex-direction: column;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  min-width: 80px;
}
.stat-card .stat-number { font-size: 22px; font-weight: 800; color: var(--accent-light); }
.stat-card .stat-label {
  font-size: 11px; color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 0.3px;
}

/* ===========================
   SECTION HEADERS
   =========================== */
.section-header {
  display: flex; justify-content: space-between;
  align-items: center; margin: 28px 0 14px;
}
.see-all {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500; color: var(--primary-soft);
  transition: var(--transition);
}
.see-all svg { width: 16px; height: 16px; }
.see-all:hover { color: var(--primary); gap: 6px; }

/* ===========================
   CATEGORIES
   =========================== */
.categories-ribbon {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 0 14px; scrollbar-width: none;
}
.categories-ribbon::-webkit-scrollbar { display: none; }

.category-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.category-chip:hover { background: var(--bg-elevated); border-color: var(--primary-soft); }
.category-chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.category-chip .cat-icon { width: 18px; height: 18px; flex-shrink: 0; }
.category-chip.active .cat-icon { color: rgba(255,255,255,0.8); }

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 24px;
}
.category-card {
  position: relative; border-radius: var(--radius);
  overflow: hidden; padding: 20px 12px;
  text-align: center; cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card); border: 1px solid var(--border);
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-soft); }
.category-card .cat-icon-lg { width: 32px; height: 32px; margin: 0 auto 8px; color: var(--primary-soft); }
.category-card .cat-name { font-size: 12px; font-weight: 600; }
.category-card .cat-count { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===========================
   VIDEO GRID & CARDS
   =========================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.video-grid-full { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.video-card {
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border-light);
  cursor: pointer; transition: var(--transition);
}
.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.video-thumb {
  position: relative; width: 100%;
  padding-top: 56.25%; overflow: hidden;
}
.video-thumb-bg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.video-thumb-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.thumb-icon {
  width: 40px; height: 40px;
  color: rgba(255,255,255,0.5);
}
.video-duration {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.7);
  color: white; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: var(--radius-xs);
  backdrop-filter: blur(4px);
}
.video-new-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent);
  color: white; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.video-play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); transition: var(--transition);
}
.video-card:hover .video-play-overlay { background: rgba(0,0,0,0.15); }
.play-icon {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.85);
  transition: var(--transition-spring);
  box-shadow: var(--shadow-md);
}
.video-card:hover .play-icon { opacity: 1; transform: scale(1); }
.play-icon svg { width: 18px; height: 18px; fill: var(--primary); margin-left: 2px; }

.video-info { padding: 12px 14px; }
.video-title {
  font-size: 14px; font-weight: 600; line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.video-meta {
  display: flex; align-items: center; gap: 8px;
}
.video-community-avatar {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.video-meta-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.video-community-name {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-stats {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 3px;
}
.video-lang-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--radius-full);
  font-size: 10px; font-weight: 600;
  margin-top: 8px;
  background: var(--bg-elevated); color: var(--text-secondary);
}
.video-lang-badge svg { width: 12px; height: 12px; }

/* ===========================
   VIDEO MODAL
   =========================== */
.video-modal {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.video-modal.active { display: flex; }

.video-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.video-modal-content {
  position: relative; width: 100%; max-width: 900px;
  margin: 0 16px;
  animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute; top: -44px; right: 0;
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  z-index: 10; transition: var(--transition);
}
.modal-close svg { width: 20px; height: 20px; color: white; }
.modal-close:hover { background: rgba(255,255,255,0.2); }

.video-player {
  width: 100%; aspect-ratio: 16/9;
  background: #0a0a0a;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden; position: relative;
}
.video-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.play-button {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.play-button:hover { background: rgba(255,255,255,0.2); transform: scale(1.08); }
.play-button svg { width: 28px; height: 28px; margin-left: 3px; }

.video-modal-body {
  background: var(--bg-card);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  max-height: 280px; overflow-y: auto;
}
.video-actions-bar {
  display: flex; gap: 4px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
}
.action-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}
.action-btn:hover { background: var(--bg-elevated); color: var(--text); }
.action-btn svg { width: 18px; height: 18px; }
.action-btn.liked { color: #D32F2F; }
.action-btn.liked svg { fill: #D32F2F; stroke: #D32F2F; }

.video-details { padding: 20px; }
.video-details .vd-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.3px; }
.video-details .vd-community {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; cursor: pointer; padding: 8px;
  margin: 0 -8px 14px; border-radius: var(--radius);
  transition: var(--transition);
}
.video-details .vd-community:hover { background: var(--bg-elevated); }
.video-details .vd-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
}
.video-details .vd-community-name { font-weight: 600; font-size: 14px; }
.video-details .vd-community-loc { font-size: 12px; color: var(--text-muted); }
.video-details .vd-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.65; }
.video-details .vd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.video-details .vd-tag {
  padding: 4px 10px; background: var(--bg-elevated);
  border-radius: var(--radius-full);
  font-size: 11px; color: var(--primary-soft); font-weight: 500;
}

/* ===========================
   COMMUNITIES
   =========================== */
.communities-header, .explore-header { text-align: center; padding: 20px 0 24px; }
.communities-header h1, .explore-header h1 { margin-bottom: 6px; }
.communities-header p, .explore-header p { color: var(--text-muted); font-size: 14px; }

.communities-map { margin-bottom: 24px; }
.map-placeholder {
  position: relative; height: 340px;
  background: #0a1f18;
  background-image: url('images/amazon-map.svg');
  background-size: cover;
  background-position: center top;
  border-radius: var(--radius-xl);
  display: flex; align-items: flex-end;
  justify-content: center; padding: 20px; overflow: hidden;
}
.map-label {
  color: rgba(255,255,255,0.5);
  font-size: 12px; font-weight: 500;
  position: relative; z-index: 2;
  background: rgba(0,0,0,0.3);
  padding: 4px 12px; border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}
.map-dots { position: absolute; inset: 0; }
.map-dot {
  position: absolute;
  width: 10px; height: 10px;
  background: var(--accent-light);
  border-radius: var(--radius-full);
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 12px rgba(201, 145, 62, 0.5), 0 0 24px rgba(201, 145, 62, 0.2);
  animation: pulse 2.5s infinite;
  cursor: pointer;
  z-index: 3;
}
.map-dot::after {
  content: attr(title);
  position: absolute; bottom: 14px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7); color: white;
  padding: 2px 8px; border-radius: 6px;
  font-size: 10px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.map-dot:hover::after { opacity: 1; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* ---- Partner Section ---- */
.partner-section { margin-top: 28px; padding: 0 4px; }
.partner-card {
  background: linear-gradient(135deg, #1A3C34, #0d2b1e);
  border-radius: var(--radius-xl); padding: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}
.partner-card-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.partner-logo img { width: 48px; height: 48px; border-radius: 12px; object-fit: contain; background: rgba(255,255,255,0.1); }
.partner-info { flex: 1; min-width: 0; }
.partner-badge {
  display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--accent); margin-bottom: 2px;
}
.partner-name { color: #fff; font-size: 16px; font-weight: 700; margin: 0; }
.partner-charity { color: rgba(255,255,255,0.35); font-size: 11px; margin: 2px 0 0; }
.partner-body { color: rgba(255,255,255,0.55); font-size: 13px; line-height: 1.6; margin: 0 0 14px; }
.partner-pillars { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.partner-pillar {
  padding: 5px 12px; border-radius: 100px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.08);
}
.partner-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: opacity 0.2s;
}
.partner-link:hover { opacity: 0.8; }

/* Landing partner */
.landing-partner-logo { width: 72px; height: 72px; border-radius: 16px; object-fit: contain; background: rgba(255,255,255,0.1); padding: 4px; }
.landing-partner-link {
  display: inline-block; margin-top: 20px; color: var(--accent);
  font-weight: 600; font-size: 15px; text-decoration: none;
  padding: 10px 24px; border: 1.5px solid var(--accent);
  border-radius: var(--radius-full); transition: all 0.2s;
}
.landing-partner-link:hover { background: var(--accent); color: #fff; }

/* ---- Footer / Imprint ---- */
.site-footer {
  margin-top: 32px; padding: 24px 16px 80px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-inner { max-width: 400px; margin: 0 auto; }
.footer-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; color: var(--text-primary);
  margin-bottom: 12px;
}
.footer-partner {
  font-size: 12px; color: var(--text-muted); margin-bottom: 14px;
}
.footer-partner a {
  color: var(--primary); text-decoration: none; font-weight: 600;
}
.footer-imprint-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--text-muted); font-family: inherit;
  text-decoration: underline; text-underline-offset: 2px;
  padding: 4px 8px;
}
.footer-imprint-details {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
}
.footer-imprint-details.open {
  max-height: 120px;
}
.footer-imprint-details p {
  margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.6;
}
.footer-license {
  margin-top: 14px; font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px;
}

.communities-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.community-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer; transition: var(--transition);
}
.community-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: transparent; }

.community-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.community-avatar svg { width: 24px; height: 24px; }
.community-card-info { flex: 1; min-width: 0; }
.community-card-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.community-card-loc { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.community-card-stats { display: flex; gap: 12px; font-size: 11px; color: var(--text-secondary); }
.community-card-stats span { display: flex; align-items: center; gap: 4px; }
.community-card-stats svg { width: 13px; height: 13px; color: var(--text-muted); }

/* Community Detail */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 0; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 12px;
  transition: var(--transition);
}
.back-btn svg { width: 18px; height: 18px; }
.back-btn:hover { color: var(--primary); }

.community-banner {
  height: 180px; border-radius: var(--radius-xl);
  overflow: hidden; margin-bottom: -36px; position: relative;
}
.community-banner-bg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.community-banner-bg svg { width: 48px; height: 48px; color: rgba(255,255,255,0.3); }

.community-info { position: relative; z-index: 2; padding: 0 8px; }
.community-detail-header {
  background: var(--bg-card);
  border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border-light);
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.community-detail-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.3px; }
.community-detail-loc { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }
.community-detail-loc svg { width: 14px; height: 14px; }
.community-detail-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 16px; }
.community-detail-stats { display: flex; gap: 24px; }
.community-detail-stats .stat { display: flex; flex-direction: column; }
.community-detail-stats .stat-number { font-size: 20px; font-weight: 800; color: var(--primary); }
.community-detail-stats .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }

/* ===========================
   UPLOAD
   =========================== */
.upload-container { max-width: 520px; margin: 0 auto; }
.upload-header { text-align: center; padding: 20px 0 16px; }
.upload-header h1 { margin-bottom: 6px; }
.upload-header p { color: var(--text-muted); font-size: 14px; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px; text-align: center;
  margin-bottom: 24px; cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
}
.upload-zone:hover { border-color: var(--primary-soft); background: rgba(26,60,52,0.02); }
.upload-icon { margin-bottom: 12px; }
.upload-icon svg { width: 48px; height: 48px; stroke: var(--text-muted); margin: 0 auto; }
.upload-text { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--text-muted); }

.upload-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
.form-group input,
.form-group textarea,
.form-group select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 14px;
  transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(26,60,52,0.06);
}

.lang-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-chip {
  padding: 6px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px; cursor: pointer;
  transition: var(--transition); background: var(--bg-card);
}
.lang-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===========================
   PROFILE
   =========================== */
.profile-container { max-width: 560px; margin: 0 auto; }
.profile-header { text-align: center; padding: 24px 0; }
.profile-avatar {
  width: 68px; height: 68px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.profile-header h2 { font-size: 20px; }
.profile-community { font-size: 13px; color: var(--primary-soft); font-weight: 500; margin-top: 2px; }
.profile-location {
  font-size: 12px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
}
.profile-stats-row {
  display: flex; justify-content: center; gap: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}
.profile-stat { display: flex; flex-direction: column; align-items: center; }
.profile-stat .stat-number { font-size: 20px; font-weight: 800; }
.profile-stat .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.profile-section { margin-bottom: 24px; }
.profile-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

.settings-list {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius); overflow: hidden;
}
.setting-item {
  display: flex; justify-content: space-between;
  align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.setting-item:last-child { border-bottom: none; }
.setting-value { color: var(--text-muted); font-size: 13px; }

.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 11px; cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  border-radius: var(--radius-full);
  background: white; left: 3px; top: 3px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ===========================
   FILTER PILLS
   =========================== */
.filter-pills { display: flex; gap: 6px; }
.filter-pill {
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500;
  background: var(--bg-elevated); cursor: pointer;
  transition: var(--transition); white-space: nowrap;
  border: 1px solid transparent;
}
.filter-pill:hover { background: var(--bg-hover); }
.filter-pill.active { background: var(--primary); color: white; }

/* ===========================
   TOAST
   =========================== */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%; transform: translateX(-50%) translateY(200px);
  visibility: hidden;
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  z-index: 300;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.4s;
  box-shadow: var(--shadow-xl);
}
.toast.visible { transform: translateX(-50%) translateY(0); visibility: visible; }
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent-light); }

/* ===========================
   EMPTY STATE
   =========================== */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===========================
   RESPONSIVE — DESKTOP
   =========================== */
@media (min-width: 768px) {
  .hero-inner { padding: 56px 48px 36px; }
  .hero-title { font-size: 38px; }

  .video-modal-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    grid-template-rows: auto auto;
    max-width: 1000px;
  }
  .video-player { border-radius: var(--radius-lg) 0 0 0; grid-column: 1; grid-row: 1; }
  .video-modal-body {
    grid-column: 2; grid-row: 1 / 3;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    max-height: none;
  }
  .video-actions-bar { border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
}

@media (min-width: 1024px) {
  h1 { font-size: 32px; }
  .hero-title { font-size: 44px; }
}

/* ===========================
   RESPONSIVE — MOBILE
   =========================== */
@media (max-width: 767px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .video-title { font-size: 13px; }
  .video-info { padding: 10px 12px; }
  .video-lang-badge { display: none; }

  .hero-inner { padding: 28px 20px 20px; }
  .hero-title { font-size: 24px; }
  .hero-subtitle { font-size: 13px; }
  .hero-stats { flex-wrap: wrap; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost { width: 100%; justify-content: center; }

  .communities-list { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .category-card { padding: 16px 8px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .video-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .logo-text { font-size: 16px; }
}

/* ============ CATEGORY CARD IMAGES ============ */
.category-card {
  position: relative;
  color: #fff;
}
.cat-bg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; opacity: 0.55;
  z-index: 0;
}
.cat-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,0.35) 100%);
  z-index: 1;
}
.category-card .cat-icon-lg,
.category-card .cat-name,
.category-card .cat-count {
  position: relative; z-index: 2;
}
.category-card .cat-icon-lg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }
.category-card .cat-name { text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.category-card .cat-count { text-shadow: 0 1px 2px rgba(0,0,0,0.3); opacity: 0.9; }

/* ============ GOVERNANCE: Access & Consent Badges ============ */
.video-access-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 10px;
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 4px;
}
.access-open { background: var(--primary-pale); color: var(--primary); }
.access-network { background: #E3F2FD; color: #1565C0; }
.access-community { background: #FFF3E0; color: #E65100; }
.access-restricted { background: #FCE4EC; color: #C62828; }
.video-sensitivity-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 10px;
  font-size: 0.65rem; font-weight: 600;
  background: #FFF8E1; color: #F57F17;
  margin-top: 4px;
}
.vd-governance {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.vd-gov-badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 12px; font-size: 0.75rem; font-weight: 600;
}
.vd-gov-info {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 12px; font-size: 0.75rem; color: var(--text-secondary);
  background: var(--bg-elevated);
}
.vd-sensitivity { background: #FFF8E1; color: #F57F17; }

/* ============ ADMIN PANEL ============ */
.admin-container { padding: 1rem; max-width: 800px; margin: 0 auto; }
.admin-header { margin-bottom: 1.5rem; }
.admin-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.admin-header p { color: var(--text-secondary); margin: 0; }
.admin-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem; overflow-x: auto;
}
.admin-tab {
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-video-row, .admin-member-row {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 12px; padding: 14px;
}
.admin-video-title, .admin-member-name { font-weight: 600; margin-bottom: 8px; }
.admin-video-controls, .admin-member-controls {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.admin-video-controls label, .admin-member-controls label {
  display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-secondary);
}
.admin-video-controls select, .admin-video-controls input[type="text"],
.admin-member-controls select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); font-size: 0.85rem;
}
.admin-settings { display: flex; flex-direction: column; gap: 16px; max-width: 400px; }
.admin-export { text-align: center; padding: 2rem 1rem; }
.admin-export p { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* ============ LANDING PAGE ============ */
.landing {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}
.landing.hidden { display: none; }
.landing-scroll > section { scroll-snap-align: start; }

/* Hero */
.landing-hero {
  position: relative;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
}
.landing-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #0D2B22 0%, #1A3C34 30%, #2D6A4F 55%, #1A3C34 80%, #0D2B22 100%);
}
.landing-hero-bg::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(201,145,62,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(42,123,136,0.06) 0%, transparent 50%);
}
.landing-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 5 Q25 20 30 30 Q35 20 30 5z' fill='%23fff' opacity='0.015'/%3E%3C/svg%3E") repeat;
}
.landing-hero-inner {
  position: relative; z-index: 1;
  text-align: center; padding: 40px 24px;
}
.landing-logo { width: 72px; height: 72px; margin-bottom: 24px; opacity: 0.9; }
.landing-title {
  font-size: 56px; font-weight: 800; color: white;
  letter-spacing: -1px; margin: 0 0 16px;
}
.landing-tagline {
  font-size: 18px; color: rgba(255,255,255,0.6);
  max-width: 360px; margin: 0 auto; line-height: 1.5;
}
.landing-scroll-hint {
  margin-top: 48px;
  animation: landing-bounce 2s ease-in-out infinite;
}
.landing-scroll-hint svg { width: 28px; height: 28px; color: rgba(255,255,255,0.3); }

@keyframes landing-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* Sections */
.landing-section {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 60px 24px;
}
.landing-section-inner {
  max-width: 560px; width: 100%;
}
.landing-label {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--primary-soft);
  margin-bottom: 20px;
}
.landing-heading {
  font-size: 28px; font-weight: 800;
  color: var(--text); line-height: 1.25;
  margin: 0 0 20px;
}
.landing-body {
  font-size: 16px; line-height: 1.7;
  color: var(--text-secondary);
  max-width: 480px;
}

/* Dark section */
.landing-section-dark {
  background: var(--primary);
}
.landing-section-dark .landing-label { color: var(--accent-light); }
.landing-section-dark .landing-heading { color: white; }
.landing-section-dark .landing-body { color: rgba(255,255,255,0.6); }

/* Accent section */
.landing-section-accent {
  background: linear-gradient(160deg, #1A3C34, #2D6A4F);
}
.landing-section-accent .landing-label { color: var(--accent-light); }
.landing-section-accent .landing-heading { color: white; }
.landing-section-accent .landing-body { color: rgba(255,255,255,0.65); }

/* Cards */
.landing-cards {
  display: flex; flex-direction: column; gap: 16px;
  margin-top: 8px;
}
.landing-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 24px;
}
.landing-card-icon { margin-bottom: 12px; }
.landing-card-icon svg { width: 32px; height: 32px; color: var(--accent-light); }
.landing-card h3 { color: white; font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.landing-card p { color: rgba(255,255,255,0.55); font-size: 14px; line-height: 1.5; margin: 0; }

/* Steps */
.landing-steps {
  display: flex; flex-direction: column; gap: 24px;
  margin-top: 8px;
}
.landing-step {
  display: flex; gap: 20px; align-items: flex-start;
}
.landing-step-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: white;
  border-radius: 50%; font-size: 16px; font-weight: 800;
}
.landing-step h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.landing-step p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin: 0; }

/* CARE grid */
.landing-care-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 24px;
}
.landing-care-item {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 16px;
  color: rgba(255,255,255,0.7); font-size: 14px;
}
.landing-care-item strong {
  display: block; font-size: 24px; color: var(--accent-light);
  margin-bottom: 4px;
}

/* Enter section */
.landing-enter { background: var(--bg); }
.landing-enter .landing-heading { text-align: center; }
.landing-enter-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 48px;
  background: var(--primary); color: white;
  border: none; border-radius: var(--radius-full);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.landing-enter-btn:hover { background: var(--primary-mid); }
.landing-enter-btn:active { transform: scale(0.97); }

/* Responsive */
@media (min-width: 768px) {
  .landing-title { font-size: 72px; }
  .landing-tagline { font-size: 20px; }
  .landing-heading { font-size: 36px; }
  .landing-cards { flex-direction: row; gap: 16px; }
  .landing-card { flex: 1; }
}
@media (max-width: 380px) {
  .landing-title { font-size: 42px; }
  .landing-care-grid { grid-template-columns: 1fr; }
}
