/* ==========================================================================
   SaNSeY — Modern Responsive Stylesheet
   Themes: Sepia (default), Dark, Light
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root,
[data-theme="sepia"],
[data-theme="sepia-dark"] {
  /* 1. Сепия Тёмная (По умолчанию) */
  --bg-primary: #1f1b18;
  --bg-secondary: #2b2520;
  --bg-card: #28221d;
  --bg-card-hover: #322b25;
  --bg-header: rgba(31, 27, 24, 0.88);
  --border-color: #3d352e;
  --border-subtle: #332b25;
  --text-main: #f3ede2;
  --text-secondary: #c9bfa8;
  --text-muted: #968a73;
  --accent: #e59866;
  --accent-hover: #f0b27a;
  --accent-glow: rgba(229, 152, 102, 0.2);
  --accent-secondary: #85c1e9;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --header-h: 68px;
  --sidebar-w: 270px;
  --newsfeed-w: 290px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="sepia-light"] {
  /* 2. Сепия Светлая (Книжная теплая бумага) */
  --bg-primary: #f4ecd8;
  --bg-secondary: #eae0c8;
  --bg-card: #fcf8ee;
  --bg-card-hover: #f7f0df;
  --bg-header: rgba(244, 236, 216, 0.92);
  --border-color: #d6c8b0;
  --border-subtle: #e2d6c0;
  --text-main: #382c1e;
  --text-secondary: #5c4b37;
  --text-muted: #8c7860;
  --accent: #c06c3a;
  --accent-hover: #a85728;
  --accent-glow: rgba(192, 108, 58, 0.18);
  --accent-secondary: #7058a6;
  --card-shadow: 0 4px 16px rgba(90, 70, 45, 0.08);
}

[data-theme="dark"] {
  /* 3. Тёмная (Obsidian Night) */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #162032;
  --bg-card-hover: #1e2c44;
  --bg-header: rgba(10, 14, 23, 0.88);
  --border-color: #1f2d42;
  --border-subtle: #172233;
  --text-main: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-glow: rgba(56, 189, 248, 0.22);
  --accent-secondary: #a78bfa;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  /* 4. Светлая (Pure Crisp Light) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-header: rgba(248, 250, 252, 0.9);
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --accent-secondary: #7c3aed;
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- HEADER --- */
.header {
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-inner {
  max-width: 1440px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.header-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 0 16px var(--accent-glow);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.header-brand:hover .header-logo {
  transform: scale(1.08) rotate(-4deg);
}

.header-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.header-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s;
}

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

/* Lang & Theme Switchers */
.lang-switcher, .theme-switcher {
  display: flex;
  background: var(--bg-secondary);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  gap: 2px;
}

.lang-btn, .theme-btn {
  background: none;
  border: none;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover, .theme-btn:hover {
  color: var(--text-main);
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.theme-btn.active {
  background: var(--border-color);
  color: var(--accent);
}

/* Admin floating indicator */
.admin-badge-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
  transition: transform 0.2s;
}

.admin-badge-btn:hover {
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 24px;
  cursor: pointer;
}

/* --- MAIN CONTENT AREA (3 Columns) --- */
.content-area {
  display: flex;
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  gap: 24px;
}

/* 1. Left Sidebar (Projects & Nav) */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-left: 4px;
}

#sidebar-projects-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.project-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.project-info {
  flex: 1;
  min-width: 0;
}

.project-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.project-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-top: 3px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 10px 0;
}

/* 2. Center Content (Main Stream) */
.center-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.hero-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin-bottom: 12px;
}

.hero-toggle-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.hero-header-bar:hover .hero-toggle-hint {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.hero-toggle-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 0;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.hero-body {
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
  overflow: hidden;
  max-height: 600px;
  opacity: 1;
}

.hero-section.collapsed {
  padding-top: 14px;
  padding-bottom: 14px;
}

.hero-section.collapsed .hero-header-bar {
  margin-bottom: 0;
}

.hero-section.collapsed .hero-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.hero-section.collapsed .hero-toggle-arrow {
  transform: rotate(180deg);
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-top: 8px;
  margin-bottom: 14px;
  color: var(--text-main);
}

.hero-description {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.65;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.section-header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-color), transparent);
}

/* About Box */
.about-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--card-shadow);
}

.about-content {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.about-content p {
  margin-bottom: 14px;
}
.about-content p:last-child {
  margin-bottom: 0;
}

/* Events / News Cards */
.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 18px;
  transition: all 0.25s ease;
  box-shadow: var(--card-shadow);
}

.event-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

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

.event-date {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.event-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
}

.event-tag.release, .event-tag.launch { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.event-tag.update { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.event-tag.article, .event-tag.collection { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.event-tag.announcement { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.event-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.event-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.event-card a {
  color: var(--accent);
  text-decoration: underline;
}

.event-cover-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 14px;
}

/* 3. Right Newsfeed */
.newsfeed {
  width: var(--newsfeed-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.newsfeed-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
  padding-left: 4px;
}

#newsfeed-list, .newsfeed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px 18px;
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.news-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.news-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.news-item:hover::before {
  opacity: 1;
}

.news-item-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 6px;
}

.news-item-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.4;
}

.news-item-text div {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.news-placeholder {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.news-placeholder a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* --- FOOTER --- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}
.footer a:hover {
  color: var(--accent);
}

.footer-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-color);
}

/* --- MODAL DIALOGS --- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content.about-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

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

.modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--accent);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  color: var(--text-main);
  line-height: 1.7;
}

.btn-about-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-about-trigger:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* --- RESPONSIVE BREAKPOINTS (Mobile & Tablet) --- */
@media (max-width: 1080px) {
  .newsfeed {
    display: none;
  }
}

@media (max-width: 820px) {
  .content-area {
    flex-direction: column;
    padding: 16px;
  }

  .sidebar {
    width: 100%;
  }

  .mobile-menu-btn {
    display: block;
  }

  .header-nav {
    display: none;
  }

  .header-nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    gap: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  }

  .hero-title {
    font-size: 24px;
  }

  .about-section div[style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 500px) {
  .about-section div[style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr !important;
  }
}
