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

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

body {
  font-family: 'Inter', sans-serif;
  background: #0a0a0a;
  overflow: hidden;
}

.hidden { display: none !important; }

.timeline-container {
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(60, 20, 20, 0.15) 0%, transparent 60%),
    linear-gradient(180deg, #0a0a0a 0%, #121218 50%, #1a1a1a 100%);
  overflow: hidden;
  position: relative;
  cursor: grab;
  user-select: none;
}
.timeline-container:active { cursor: grabbing; }

/* ======================== HEADER ======================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  z-index: 200;
  background: linear-gradient(180deg, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.7) 70%, transparent 100%);
}
.site-title { font-size: 0.9rem; font-weight: 500; color: rgba(255,255,255,0.9); letter-spacing: 0.05em; }
.header-right { display: flex; align-items: center; gap: 10px; }
.current-date { font-size: 0.8rem; font-weight: 400; color: rgba(255,255,255,0.5); }
.header-tg-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.45);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.header-tg-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.2);
}
.header-tg-btn svg { flex-shrink: 0; }

@media (max-width: 600px) {
  .header-tg-label { display: none; }
}

.header-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.2s;
}
.header-share-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.2);
}

/* ======================== SEARCH BOX ======================== */
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0 10px;
  transition: border-color 0.2s, background 0.2s;
}
.search-box:focus-within {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.09);
}
.search-icon { color: rgba(255,255,255,0.35); flex-shrink: 0; cursor: pointer; }
.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255,255,255,0.85);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  width: 110px;
  transition: width 0.3s;
}
.search-input:focus { width: 160px; }
.search-input::placeholder { color: rgba(255,255,255,0.3); }
.search-count {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  padding: 2px 7px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
}
.search-clear {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.2s;
}
.search-clear:hover { color: rgba(255,255,255,0.8); }

/* ======================== LEFT PANEL ======================== */
.left-panel {
  position: fixed;
  top: 60px; left: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 200;
}

/* Language Switcher */
.lang-switcher { display: flex; flex-direction: column; gap: 3px; }
.lang-btn {
  width: 36px; height: 28px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: rgba(255,255,255,0.4);
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem; font-weight: 500; letter-spacing: 0.05em;
  cursor: pointer; transition: all 0.25s;
}
.lang-btn:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.lang-btn.active { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.25); }

/* View Switcher */
.view-switcher { display: flex; flex-direction: column; gap: 3px; }
.view-btn {
  width: 36px; height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: rgba(255,255,255,0.35);
  cursor: pointer; transition: all 0.25s;
  display: flex; align-items: center; justify-content: center;
}
.view-btn:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.view-btn.active { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.25); }
.view-btn svg { width: 16px; height: 16px; }

/* ======================== FILTER BAR ======================== */
.filter-bar {
  position: fixed;
  top: 50px; left: 0; right: 0;
  z-index: 190;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 25px 8px 75px;
  background: linear-gradient(180deg, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.6) 80%, transparent 100%);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-tag {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-tag:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
}
.filter-tag.active {
  background: var(--tag-color, rgba(255,255,255,0.15));
  border-color: var(--tag-color, rgba(255,255,255,0.3));
  color: white;
}
.filter-tag[data-type="all"].active {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}
.filter-tag-count {
  font-size: 0.55rem;
  opacity: 0.6;
}

/* ======================== 3D VIEWPORT ======================== */
.viewport {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  perspective: 800px;
  perspective-origin: calc(50% + 30px) 85%;
  overflow: hidden;
}
.scene {
  position: absolute;
  bottom: 18%; left: calc(50% + 30px);
  width: 0; height: 0;
  transform-style: preserve-3d;
}

/* Floor */
.floor-segment { position: absolute; width: 1200px; left: -600px; height: 50px; transform-style: preserve-3d; pointer-events: none; }
.floor-segment-surface {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.02) 15%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 85%, transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.track-tick { position: absolute; width: 60px; height: 2px; left: -30px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent); }
.center-dot { position: absolute; width: 3px; height: 3px; left: -1.5px; border-radius: 50%; background: rgba(255,255,255,0.4); box-shadow: 0 0 4px rgba(255,255,255,0.15); }
.timeline-node { position: absolute; width: 10px; height: 10px; left: -5px; border-radius: 50%; background: rgba(255,255,255,0.5); border: 2px solid rgba(255,255,255,0.2); box-shadow: 0 0 12px rgba(255,255,255,0.15); }
.glow-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; }
.ambient-particle { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.6); box-shadow: 0 0 6px rgba(255,255,255,0.2); pointer-events: none; }

/* Day labels */
.day-label { position: absolute; font-family: 'Inter', sans-serif; font-weight: 200; color: rgba(255,255,255,0.15); pointer-events: none; white-space: nowrap; letter-spacing: -0.02em; }
.day-label-right { text-align: left; }
.day-label-left { text-align: right; }
.month-label { font-weight: 400; text-transform: uppercase; }
.year-label { font-weight: 300; color: rgba(255,255,255,0.1); }

/* 3D Cards */
.event-card {
  position: absolute;
  background: linear-gradient(180deg, #1e1e1e 0%, #1a1a1a 100%);
  border-radius: 6px; overflow: hidden; cursor: pointer;
  transform-style: preserve-3d;
  box-shadow: 0 10px 40px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.4);
  backface-visibility: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.event-card:hover { border-color: rgba(255,255,255,0.25); box-shadow: 0 15px 50px rgba(0,0,0,0.8), 0 0 25px rgba(255,255,255,0.06), inset 0 0 30px rgba(255,255,255,0.03); }
.event-card.featured { z-index: 50; border-color: rgba(255,255,255,0.12); }
.card-accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; z-index: 2; }
.card-type { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; padding: 7px 12px; color: white; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; }
.card-image { width: 100%; background: linear-gradient(145deg, #2a2a2a, #1a1a1a); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-image-placeholder { width: 60%; height: 60%; border-radius: 50%; background: linear-gradient(145deg, #3a3a3a, #252525); opacity: 0.6; }
.card-video-thumb { position: relative; }
.card-play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 36px; height: 36px; background: rgba(0,0,0,0.55); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 13px; pointer-events: none; border: 2px solid rgba(255,255,255,0.35); }
.card-time-badge { background: rgba(0,0,0,0.35); padding: 2px 8px; border-radius: 4px; font-size: 0.65rem; font-weight: 500; color: rgba(255,255,255,0.85); margin-left: auto; }
.card-content { padding: 12px 14px; }
.card-date { font-size: 0.7rem; color: rgba(255,255,255,0.35); margin-bottom: 8px; }
.card-description { font-size: 0.8rem; font-weight: 300; color: rgba(255,255,255,0.6); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-no-media { padding-left: 18px; }
.card-no-media .card-description { -webkit-line-clamp: 7; font-size: 0.82rem; color: rgba(255,255,255,0.65); }
.connector { position: absolute; height: 2px; transform-origin: right center; }
.connector-v { position: absolute; width: 2px; transform-origin: top center; }

/* Fades */
.fade-top { position: absolute; top: 0; left: 0; right: 0; height: 150px; background: linear-gradient(180deg, #0a0a0a 0%, transparent 100%); pointer-events: none; z-index: 50; }
.fade-bottom { position: absolute; bottom: 0; left: 0; right: 0; height: 80px; background: linear-gradient(0deg, #1a1a1a 0%, transparent 100%); pointer-events: none; z-index: 50; }

/* Scroll hint */
.scroll-hint { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; transition: opacity 0.4s; }
.scroll-text { font-size: 0.65rem; color: rgba(255,255,255,0.35); letter-spacing: 0.12em; text-transform: uppercase; }
.scroll-arrow { width: 18px; height: 18px; border-left: 2px solid rgba(255,255,255,0.3); border-top: 2px solid rgba(255,255,255,0.3); transform: rotate(45deg); animation: scrollUp 1.5s ease-in-out infinite; }
@keyframes scrollUp {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.5; }
  50% { transform: rotate(45deg) translateY(-6px); opacity: 1; }
}

/* ======================== FLAT VIEW (shared) ======================== */
.flat-view {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 55px 20px 40px 75px;
  -webkit-overflow-scrolling: touch;
}
.flat-view::-webkit-scrollbar { width: 6px; }
.flat-view::-webkit-scrollbar-track { background: transparent; }
.flat-view::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

/* Flat view with filter bar needs extra top padding */
.flat-view--feed,
.flat-view--grid,
.flat-view--calendar { padding-top: 100px; }

/* No results */
.no-results {
  text-align: center;
  padding: 80px 20px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.35);
  font-weight: 300;
}

/* ======================== FADE-IN ANIMATION ======================== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ======================== STATISTICS WIDGET ======================== */
.stats-widget {
  max-width: 820px;
  margin: 0 auto 32px;
  background: linear-gradient(135deg, rgba(139,26,26,0.15) 0%, rgba(26,26,26,0.95) 50%, rgba(74,106,138,0.1) 100%);
  border: 1px solid rgba(139,26,26,0.25);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.stats-widget::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8b1a1a, transparent);
}
.stats-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.stats-title {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.03em;
}
.stats-date {
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255,255,255,0.4);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stats-item {
  text-align: center;
  padding: 8px 0;
}
.stats-item--main {
  grid-column: 1 / -1;
  padding: 12px 0 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stats-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stats-item--main .stats-number {
  font-size: 2.5rem;
  color: #c44;
  text-shadow: 0 0 30px rgba(204,68,68,0.2);
}
.stats-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ======================== FEED VIEW ======================== */
.feed {
  max-width: 820px;
  margin: 0 auto;
}

.feed-date-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 24px 0 14px;
}
.feed-date-divider:first-child { margin-top: 0; }
.feed-date-divider::before,
.feed-date-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,0.08);
}
.feed-date-text {
  font-size: 0.75rem; font-weight: 500; color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}

.feed-post {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.feed-post:hover { border-color: rgba(255,255,255,0.14); }

.feed-post-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
}
.feed-post-type {
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 4px; color: white;
}
.feed-post-time { font-size: 0.75rem; color: rgba(255,255,255,0.4); }

.feed-media { width: 100%; }
.feed-img { width: 100%; height: auto; display: block; transition: opacity 0.2s; }
.feed-img:hover { opacity: 0.9; }
.feed-video { width: 100%; max-height: 400px; display: block; background: #000; }

.feed-post-body {
  padding: 20px 28px 24px;
  font-size: 0.95rem; font-weight: 300; color: rgba(255,255,255,0.75);
  line-height: 1.8;
}
.feed-post-body b { font-weight: 600; color: rgba(255,255,255,0.9); }
.feed-post-body u { text-underline-offset: 3px; }
.feed-post-body a { color: #6ba3d6; text-decoration: none; border-bottom: 1px solid rgba(107,163,214,0.3); }
.feed-post-body a:hover { color: #8bbce8; }
.feed-post-body blockquote {
  border-left: 3px solid rgba(255,255,255,0.15);
  padding: 10px 14px; margin: 12px 0;
  background: rgba(255,255,255,0.02);
  border-radius: 0 6px 6px 0;
  font-style: italic; color: rgba(255,255,255,0.6);
}
.feed-post-body .mention { color: #6ba3d6; }

/* ======================== GRID VIEW ======================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.grid-card {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.grid-card:hover { border-color: rgba(255,255,255,0.18); transform: translateY(-2px); }

.grid-thumb { width: 100%; height: 160px; overflow: hidden; position: relative; }
.grid-thumb img { width: 100%; height: 100%; object-fit: cover; }
.grid-thumb-video { position: relative; }
.grid-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 40px; height: 40px; background: rgba(0,0,0,0.6); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; border: 2px solid rgba(255,255,255,0.3);
}

.grid-card-body { padding: 12px 14px; }
.grid-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.grid-card-type {
  font-size: 0.55rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px; color: white;
}
.grid-card-date { font-size: 0.7rem; color: rgba(255,255,255,0.35); }
.grid-card-text {
  font-size: 0.82rem; font-weight: 300; color: rgba(255,255,255,0.6);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* ======================== CALENDAR VIEW ======================== */
.calendar {
  max-width: 800px;
  margin: 0 auto;
}

.cal-day {
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.015);
}

.cal-day-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cal-day-date { font-size: 0.85rem; font-weight: 500; color: rgba(255,255,255,0.8); }
.cal-day-weekday { font-size: 0.75rem; color: rgba(255,255,255,0.35); }
.cal-day-count {
  margin-left: auto;
  font-size: 0.65rem; font-weight: 600; color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px; border-radius: 10px;
}

.cal-day-events { padding: 4px 0; }

.cal-event {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.cal-event:last-child { border-bottom: none; }
.cal-event:hover { background: rgba(255,255,255,0.03); }

.cal-event-time { font-size: 0.75rem; font-weight: 500; color: rgba(255,255,255,0.4); min-width: 42px; }
.cal-event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cal-event-type { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; min-width: 90px; flex-shrink: 0; }
.cal-event-text {
  font-size: 0.8rem; font-weight: 300; color: rgba(255,255,255,0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}
.cal-event-thumb {
  width: 36px; height: 36px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.08);
}

/* ======================== MODAL ======================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(10px);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-content {
  max-width: 550px; width: 90%; max-height: 85vh;
  background: #1e1e1e; border-radius: 12px;
  overflow-y: auto; overflow-x: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
}
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.modal-type {
  padding: 16px 20px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; color: white;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-image { width: 100%; background: linear-gradient(145deg, #2a2a2a, #1a1a1a); display: flex; align-items: center; justify-content: center; }
.modal-img { width: 100%; height: auto; display: block; transition: opacity 0.2s; }
.modal-img:hover { opacity: 0.92; }
.modal-video-container { width: 100%; background: #000; }
.modal-video { width: 100%; max-height: 350px; display: block; background: #000; }
.modal-body { padding: 24px; }
.modal-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-time { font-size: 0.9rem; font-weight: 500; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.modal-date { font-size: 0.85rem; color: rgba(255,255,255,0.4); }
.modal-text { font-size: 0.95rem; font-weight: 300; color: rgba(255,255,255,0.75); line-height: 1.7; }
.modal-text b { font-weight: 600; color: rgba(255,255,255,0.9); }
.modal-text u { text-decoration: underline; text-underline-offset: 3px; color: rgba(255,255,255,0.85); }
.modal-text a { color: #6ba3d6; text-decoration: none; border-bottom: 1px solid rgba(107,163,214,0.3); transition: border-color 0.2s, color 0.2s; }
.modal-text a:hover { color: #8bbce8; border-bottom-color: rgba(139,188,232,0.6); }
.modal-text blockquote { border-left: 3px solid rgba(255,255,255,0.2); padding: 12px 16px; margin: 12px 0; background: rgba(255,255,255,0.03); border-radius: 0 6px 6px 0; color: rgba(255,255,255,0.65); font-style: italic; }
.modal-text .mention { color: #6ba3d6; font-weight: 400; }

.modal-close {
  position: static;
  width: auto; height: auto;
  background: transparent; border: none; border-radius: 0;
  color: rgba(255,255,255,0.6); font-size: 1.4rem;
  cursor: pointer; transition: color 0.2s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: auto;
}
.modal-close:hover { color: white; }

/* Share button */
.modal-share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.55);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.modal-share-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.2);
}
.modal-share-btn svg { flex-shrink: 0; }

/* Modal navigation */
.modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.15);
}
.modal-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.modal-nav-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.22);
}
.modal-nav-btn.disabled {
  opacity: 0.25;
  pointer-events: none;
}
.modal-nav-btn svg { flex-shrink: 0; }
.modal-nav-counter {
  font-size: 0.68rem;
  font-weight: 400;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.05em;
}

/* ======================== LIGHTBOX ======================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  cursor: zoom-out;
}
.lightbox.active {
  opacity: 1;
  pointer-events: all;
}
.lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
}

/* ======================== YOUTUBE MODAL ======================== */
.youtube-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(8px);
}
.youtube-modal.active {
  opacity: 1;
  pointer-events: all;
}
.youtube-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.youtube-modal-close:hover { background: rgba(255,255,255,0.2); }
.youtube-modal-body {
  width: 90vw;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.youtube-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ======================== TOAST ======================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ======================== RESPONSIVE ======================== */

/* Tablet */
@media (max-width: 768px) {
  .search-input { width: 100px; }
  .search-input:focus { width: 140px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .cal-event-type { display: none; }
  .flat-view { padding-left: 65px; }
  .filter-bar { padding-left: 65px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-item--main { grid-column: 1 / -1; }
}

/* Mobile */
@media (max-width: 540px) {
  /* Header: single row, compact */
  .header {
    height: 44px;
    padding: 0 12px;
    gap: 8px;
  }
  .site-title { font-size: 0.75rem; flex-shrink: 0; }
  .header-right { gap: 8px; }
  .current-date { display: none; }
  .header-tg-label { display: none; }
  .header-tg-btn { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 8px; }
  .header-share-btn { width: 36px; height: 36px; border-radius: 8px; }
  .search-box { width: 36px; height: 36px; padding: 0; justify-content: center; align-items: center; border-radius: 8px; overflow: hidden; }
  .search-input { display: none; }
  .search-box:focus-within { width: auto; padding: 0 10px; }
  .search-box:focus-within .search-input { display: block; width: 100px; }
  .search-input { width: 0; padding: 0; }
  .search-input:focus { width: 100px; padding: 4px 0; }
  .search-icon { cursor: pointer; }

  /* Left panel → bottom bar */
  .left-panel {
    position: fixed;
    top: auto; bottom: 0; left: 0; right: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(0deg, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.8) 80%, transparent 100%);
    z-index: 200;
  }
  .lang-switcher { flex-direction: row; gap: 3px; }
  .view-switcher { flex-direction: row; gap: 3px; }
  .lang-btn { width: 32px; height: 26px; font-size: 0.6rem; }
  .view-btn { width: 32px; height: 28px; }

  /* 3D viewport offset for bottom bar */
  .scene { bottom: 22%; left: calc(50% + 5px); }
  .viewport { perspective-origin: calc(50% + 5px) 85%; }

  /* Scroll hint above bottom bar */
  .scroll-hint { bottom: 65px; }

  /* Flat views: no left panel offset */
  .flat-view { padding: 55px 12px 70px 12px; }
  .flat-view--feed,
  .flat-view--grid,
  .flat-view--calendar { padding-top: 90px; }

  /* Filter bar */
  .filter-bar {
    top: 44px;
    padding: 6px 12px;
    gap: 5px;
  }
  .filter-tag { padding: 4px 9px; font-size: 0.58rem; }

  /* Feed */
  .feed { max-width: 100%; }
  .feed-post-body { padding: 14px 16px 18px; font-size: 0.88rem; line-height: 1.7; }
  .feed-post-header { padding: 10px 14px; }

  /* Grid */
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .grid-thumb { height: 120px; }

  /* Calendar */
  .calendar { max-width: 100%; }
  .cal-event { padding: 8px 12px; gap: 8px; }
  .cal-event-type { display: none; }
  .cal-event-time { font-size: 0.7rem; min-width: 36px; }
  .cal-day-header { padding: 10px 12px; }

  /* Stats */
  .stats-widget { padding: 16px; margin-bottom: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stats-item--main { grid-column: 1 / -1; }
  .stats-number { font-size: 1.2rem; }
  .stats-item--main .stats-number { font-size: 2rem; }
  .stats-title { font-size: 0.85rem; }

  /* Modal */
  .modal-content { width: 96%; max-height: 90vh; border-radius: 10px; }
  .modal-body { padding: 16px; }
  .modal-meta-row { flex-direction: column; gap: 10px; }
  .modal-nav { padding: 10px 14px; }
  .modal-nav-btn { padding: 6px 10px; font-size: 0.65rem; }
  .modal-nav-counter { font-size: 0.6rem; }

  /* Toast above bottom bar */
  .toast { bottom: 70px; }

  /* Fade bottom taller for bottom bar */
  .fade-bottom { height: 100px; }
}
