/* === TOP NAVIGATION === */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  position: relative;
  z-index: 10000;
}

.nav-left { display: flex; align-items: center; gap: 10px; }
.nav-center { display: flex; align-items: center; flex: 1; justify-content: center; }
.nav-right { display: flex; align-items: center; gap: 10px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 12px 22px;
  min-width: 400px;
}
.search-bar .nav-icon-img { width: 20px; height: 20px; opacity: 0.6; }
.search-input {
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-main);
  width: 100%;
}
.search-input::placeholder { color: var(--text-muted); }

/* Search Dropdown — Pinterest Cards */
.search-bar { position: relative; z-index: 9999; transition: all 0.3s ease; }
.search-bar.search-active {
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.05);
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 460px;
  background: rgba(18, 18, 24, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  max-height: 500px;
  overflow-y: auto;
  display: none;
  z-index: 99999;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255,255,255,0.1);
  padding: 8px;
  backdrop-filter: blur(40px);
}
.search-dropdown.active {
  display: block;
  animation: searchDropIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes searchDropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes searchCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Groups */
.search-group { margin-bottom: 4px; }
.search-group:last-child { margin-bottom: 0; }

.search-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.3);
}
.search-group-label[data-type="post"] { color: rgba(16, 185, 129, 0.6); }
.search-group-label[data-type="community"] { color: rgba(59, 130, 246, 0.6); }
.search-group-label[data-type="event"] { color: rgba(245, 158, 11, 0.6); }
.search-group-label[data-type="announcement"] { color: rgba(139, 92, 246, 0.6); }

.search-group-icon { font-size: 13px; }
.search-group-count {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.3);
}

/* Card items */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin: 3px 0;
  cursor: pointer;
  border-radius: 14px;
  border-left: 3px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  animation: searchCardIn 0.3s ease-out backwards;
  position: relative;
}

/* Type-based left border colors */
.search-result-item[data-type="post"] { border-left-color: rgba(16, 185, 129, 0.4); }
.search-result-item[data-type="community"] { border-left-color: rgba(59, 130, 246, 0.4); }
.search-result-item[data-type="event"] { border-left-color: rgba(245, 158, 11, 0.4); }
.search-result-item[data-type="announcement"] { border-left-color: rgba(139, 92, 246, 0.4); }

/* Hover — lift + glow */
.search-result-item:hover,
.search-result-item.highlighted {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.04);
}
.search-result-item[data-type="post"]:hover,
.search-result-item[data-type="post"].highlighted {
  background: rgba(16, 185, 129, 0.08);
  border-left-color: #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.1);
}
.search-result-item[data-type="community"]:hover,
.search-result-item[data-type="community"].highlighted {
  background: rgba(59, 130, 246, 0.08);
  border-left-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
}
.search-result-item[data-type="event"]:hover,
.search-result-item[data-type="event"].highlighted {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.1);
}
.search-result-item[data-type="announcement"]:hover,
.search-result-item[data-type="announcement"].highlighted {
  background: rgba(139, 92, 246, 0.08);
  border-left-color: #8b5cf6;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.1);
}

/* Icons — colored by type */
.search-result-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 20px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.search-result-item[data-type="post"] .search-result-icon {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.search-result-item[data-type="community"] .search-result-icon {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.search-result-item[data-type="event"] .search-result-icon {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.15);
}
.search-result-item[data-type="announcement"] .search-result-icon {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

/* Hover icon glow */
.search-result-item[data-type="post"]:hover .search-result-icon { box-shadow: 0 0 12px rgba(16, 185, 129, 0.2); }
.search-result-item[data-type="community"]:hover .search-result-icon { box-shadow: 0 0 12px rgba(59, 130, 246, 0.2); }
.search-result-item[data-type="event"]:hover .search-result-icon { box-shadow: 0 0 12px rgba(245, 158, 11, 0.2); }
.search-result-item[data-type="announcement"]:hover .search-result-icon { box-shadow: 0 0 12px rgba(139, 92, 246, 0.2); }

.search-result-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-result-text { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.search-result-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-arrow {
  color: rgba(255, 255, 255, 0.15);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  flex-shrink: 0;
  opacity: 0;
}
.search-result-item:hover .search-result-arrow {
  opacity: 1;
  transform: translateX(2px);
}
.search-result-item[data-type="post"]:hover .search-result-arrow { color: #10b981; }
.search-result-item[data-type="community"]:hover .search-result-arrow { color: #3b82f6; }
.search-result-item[data-type="event"]:hover .search-result-arrow { color: #f59e0b; }
.search-result-item[data-type="announcement"]:hover .search-result-arrow { color: #8b5cf6; }

/* Highlight matched text — colored by type */
.search-highlight {
  border-radius: 3px;
  padding: 1px 3px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.search-result-item[data-type="post"] .search-highlight { background: rgba(16,185,129,0.2); color: #34d399; }
.search-result-item[data-type="community"] .search-highlight { background: rgba(59,130,246,0.2); color: #60a5fa; }
.search-result-item[data-type="event"] .search-highlight { background: rgba(245,158,11,0.2); color: #fbbf24; }
.search-result-item[data-type="announcement"] .search-highlight { background: rgba(139,92,246,0.2); color: #a78bfa; }

.search-no-results {
  padding: 36px 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.search-no-results-icon { font-size: 32px; opacity: 0.3; }

/* Mobile search dropdown */
.mobile-search-dropdown {
  position: relative;
  top: 0;
  margin: 8px 12px 0;
  border-radius: 20px;
  width: auto;
}

/* ===== Light theme ===== */
[data-theme="light"] .search-dropdown {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0,0,0,0.1);
}
[data-theme="light"] .search-group-label { color: rgba(0, 0, 0, 0.35); }
[data-theme="light"] .search-group-label[data-type="post"] { color: rgba(16, 185, 129, 0.7); }
[data-theme="light"] .search-group-label[data-type="community"] { color: rgba(59, 130, 246, 0.7); }
[data-theme="light"] .search-group-label[data-type="event"] { color: rgba(245, 158, 11, 0.7); }
[data-theme="light"] .search-group-label[data-type="announcement"] { color: rgba(139, 92, 246, 0.7); }
[data-theme="light"] .search-group-count { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.35); }
[data-theme="light"] .search-result-item:hover,
[data-theme="light"] .search-result-item.highlighted { background: rgba(0,0,0,0.03); }
[data-theme="light"] .search-result-item[data-type="post"]:hover { background: rgba(16,185,129,0.06); }
[data-theme="light"] .search-result-item[data-type="community"]:hover { background: rgba(59,130,246,0.06); }
[data-theme="light"] .search-result-item[data-type="event"]:hover { background: rgba(245,158,11,0.06); }
[data-theme="light"] .search-result-item[data-type="announcement"]:hover { background: rgba(139,92,246,0.06); }
[data-theme="light"] .search-result-icon { border-color: transparent; }
[data-theme="light"] .search-result-item[data-type="post"] .search-result-icon { background: rgba(16,185,129,0.08); }
[data-theme="light"] .search-result-item[data-type="community"] .search-result-icon { background: rgba(59,130,246,0.08); }
[data-theme="light"] .search-result-item[data-type="event"] .search-result-icon { background: rgba(245,158,11,0.08); }
[data-theme="light"] .search-result-item[data-type="announcement"] .search-result-icon { background: rgba(139,92,246,0.08); }
[data-theme="light"] .search-result-title { color: rgba(0, 0, 0, 0.85); }
[data-theme="light"] .search-result-subtitle { color: rgba(0, 0, 0, 0.4); }
[data-theme="light"] .search-result-avatar { border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .search-highlight { color: #000; }
[data-theme="light"] .search-result-item[data-type="post"] .search-highlight { background: rgba(16,185,129,0.15); color: #059669; }
[data-theme="light"] .search-result-item[data-type="community"] .search-highlight { background: rgba(59,130,246,0.15); color: #2563eb; }
[data-theme="light"] .search-result-item[data-type="event"] .search-highlight { background: rgba(245,158,11,0.15); color: #d97706; }
[data-theme="light"] .search-result-item[data-type="announcement"] .search-highlight { background: rgba(139,92,246,0.15); color: #7c3aed; }

/* Mobile light theme: keep dark bg + white text since mobile uses glass bg */
@media (max-width: 768px) {
  [data-theme="light"] .search-dropdown {
    background: rgba(15, 15, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  }
  [data-theme="light"] .search-group-label { color: rgba(255, 255, 255, 0.3); }
  [data-theme="light"] .search-group-label[data-type="post"] { color: rgba(16, 185, 129, 0.6); }
  [data-theme="light"] .search-group-label[data-type="community"] { color: rgba(59, 130, 246, 0.6); }
  [data-theme="light"] .search-group-label[data-type="event"] { color: rgba(245, 158, 11, 0.6); }
  [data-theme="light"] .search-group-label[data-type="announcement"] { color: rgba(139, 92, 246, 0.6); }
  [data-theme="light"] .search-group-count { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.35); }
  [data-theme="light"] .search-result-item:hover,
  [data-theme="light"] .search-result-item.highlighted { background: rgba(255,255,255,0.04); }
  [data-theme="light"] .search-result-item[data-type="post"]:hover { background: rgba(16,185,129,0.08); }
  [data-theme="light"] .search-result-item[data-type="community"]:hover { background: rgba(59,130,246,0.08); }
  [data-theme="light"] .search-result-item[data-type="event"]:hover { background: rgba(245,158,11,0.08); }
  [data-theme="light"] .search-result-item[data-type="announcement"]:hover { background: rgba(139,92,246,0.08); }
  [data-theme="light"] .search-result-title { color: #fff; }
  [data-theme="light"] .search-result-subtitle { color: rgba(255, 255, 255, 0.35); }
  [data-theme="light"] .search-result-avatar { border-color: rgba(255,255,255,0.1); }
  [data-theme="light"] .search-highlight { color: #fff; }
  [data-theme="light"] .search-result-item[data-type="post"] .search-highlight { background: rgba(16,185,129,0.2); color: #34d399; }
  [data-theme="light"] .search-result-item[data-type="community"] .search-highlight { background: rgba(59,130,246,0.2); color: #60a5fa; }
  [data-theme="light"] .search-result-item[data-type="event"] .search-highlight { background: rgba(245,158,11,0.2); color: #fbbf24; }
  [data-theme="light"] .search-result-item[data-type="announcement"] .search-highlight { background: rgba(139,92,246,0.2); color: #a78bfa; }
  [data-theme="light"] .search-result-icon { border-color: rgba(255,255,255,0.1); }
  [data-theme="light"] .search-result-item[data-type="post"] .search-result-icon { background: rgba(16,185,129,0.1); }
  [data-theme="light"] .search-result-item[data-type="community"] .search-result-icon { background: rgba(59,130,246,0.1); }
  [data-theme="light"] .search-result-item[data-type="event"] .search-result-icon { background: rgba(245,158,11,0.1); }
  [data-theme="light"] .search-result-item[data-type="announcement"] .search-result-icon { background: rgba(139,92,246,0.1); }
}

/* Scrollbar for dropdown */
.search-dropdown::-webkit-scrollbar { width: 4px; }
.search-dropdown::-webkit-scrollbar-track { background: transparent; }
.search-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.search-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Nav Tabs */
.nav-tabs-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
}
.nav-tabs { display: flex; gap: 6px; position: relative; }
.nav-tabs-slider {
  position: absolute;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  z-index: 0;
}
.nav-tab {
  display: flex;
  align-items: center;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 18px;
  font-family: var(--font-main);
  color: var(--text-secondary);
  transition: color 0.3s ease;
  border: none;
  background: none;
  position: relative;
  z-index: 1;
}
.nav-tab:hover {
  color: var(--text-primary);
}
.nav-tab:active {
  transform: scale(0.95);
}
.nav-tab.active {
  color: var(--text-primary);
}
.nav-bell {
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 44px;
  height: 44px;
}
.tab-icon { display: none; }

/* Icon Button */
.icon-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  border: 1px solid transparent;
}
.icon-btn:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-border);
}
.nav-icon-img { width: 22px; height: 22px; }

/* Notification Button */
.notification-btn { position: relative; }
.notification-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--online-color);
  border-radius: 50%;
}

/* Notifications Dropdown */
.notifications-dropdown {
  position: absolute;
  top: 72px;
  right: 24px;
  width: 360px;
  max-height: 440px;
  overflow: hidden;
  padding: 0;
  z-index: 10001;
  animation: slideDown 0.25s ease;
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
  display: flex;
  flex-direction: column;
}
.notifications-dropdown .notifications-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 17px;
  font-weight: 400;
  color: #fff;
  font-family: var(--font-main);
}
.notifications-dropdown .notifications-list {
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1;
  max-height: 360px;
}
.notifications-dropdown .notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  transition: background 0.2s;
  cursor: default;
}
.notifications-dropdown .notif-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.notifications-dropdown .notif-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.notifications-dropdown .notif-content {
  flex: 1;
  min-width: 0;
}
.notifications-dropdown .notif-text {
  font-size: 14px;
  font-family: var(--font-small);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.45;
}
.notifications-dropdown .notif-time {
  font-size: 12px;
  font-family: var(--font-small);
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
}
.notifications-dropdown .notif-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  font-family: var(--font-small);
}
.notifications-dropdown .notif-empty-icon {
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.4;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Profile Mini */
.profile-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  background:
    var(--bg-primary) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.35), rgba(255,255,255,0.08)) border-box;
  border: 1.5px solid transparent;
}
.profile-mini:hover {
  background:
    var(--btn-bg-hover) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.15)) border-box;
}
.avatar-mini { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.user-name-mini { font-size: 16px; font-family: var(--font-main); font-weight: 400; }
.user-role-mini { font-size: 13px; font-family: var(--font-small); color: var(--text-muted); }
.profile-info-mini { display: flex; flex-direction: column; gap: 2px; }
.profile-dropdown-arrow { font-size: 14px; color: var(--text-secondary); margin-left: 4px; }

/* === CONTENT AREA === */
.content-area {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* === LEFT SIDEBAR === */
.left-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 14px;
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-left: none;
  overflow-y: auto;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 18px;
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  border: 1px solid transparent;
}
.sidebar-link:hover {
  background: var(--btn-bg-hover);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: var(--nav-tab-active-bg);
  color: var(--text-primary);
  border-color: var(--btn-border);
}
.sidebar-icon { width: 26px; height: 26px; }
.sidebar-link.active .sidebar-icon { opacity: 1; }
.sidebar-bottom { display: flex; flex-direction: column; gap: 6px; }

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 6px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
}

/* Section Header */
.section-header {
  padding: 16px 20px;
  margin-bottom: 6px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  border-radius: 18px !important;
}
.section-header h1 {
  font-size: 26px;
  margin-bottom: 6px;
  color: #fff;
}
.section-header p {
  font-size: 15px;
  font-family: var(--font-small);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.55;
}

/* ============================================= */
/* === GUEST WARNING - Character + speech bubble  */
/* ============================================= */
/* When the guest-warning is visible (JS sets inline display:flex),
   make the page a flex column that fills available space.
   Two selectors cover "display:flex" and "display: flex" (with space). */
.page.active:has(.guest-warning[style*="display:flex"]),
.page.active:has(.guest-warning[style*="display: flex"]) {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin: 0 -20px -20px -20px;
  padding: 0 20px;
}
.guest-warning {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: visible;
  margin: 0 -20px -20px -20px;
}
.guest-warning-content {
  position: absolute;
  left: 40px;
  bottom: 0;
  right: 20px;
  top: 0;
  display: flex;
  align-items: flex-end;
  background: none !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* Character — big, left-aligned, flush bottom */
.guest-warning-img {
  width: clamp(440px, 48vw, 780px);
  max-height: 100%;
  height: auto;
  object-fit: contain;
  object-position: left bottom;
  display: block;
  flex-shrink: 1;
  z-index: 2;
}
/* Speech bubble — right of character's hand */
.guest-overlay {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 22px 26px;
  text-align: center;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.3);
  border-radius: 22px;
  z-index: 3;
  width: 260px;
  flex-shrink: 0;
  margin-left: -101px;
  margin-bottom: 26%;
  position: relative;
}
/* Raise bubble higher on Chat & Announcements (taller content area) */
#page-chat .guest-overlay,
#page-announcements .guest-overlay {
  margin-bottom: 22%;
}

/* Speech bubble tail */
.guest-overlay::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 30px;
  width: 36px;
  height: 20px;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  clip-path: polygon(0% 0%, 100% 0%, 10% 100%);
}
.guest-overlay::before {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 29px;
  width: 38px;
  height: 22px;
  background: rgba(255, 255, 255, 0.25);
  clip-path: polygon(0% 0%, 100% 0%, 10% 100%);
  z-index: -1;
}
.guest-overlay p {
  font-family: var(--font-small);
  font-size: 15px;
  color: #ffffff;
  line-height: 1.5;
  margin-bottom: 18px;
}
.guest-overlay .guest-login-btn {
  display: block;
  width: 100%;
  padding: 12px 32px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-family: var(--font-small);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-align: center;
}
.guest-overlay .guest-login-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow);
}

/* Comments Popup — inline, modern */
.comments-popup {
  position: fixed;
  z-index: 5000;
  width: 340px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  background: rgba(18, 18, 30, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.comments-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.comments-popup-header span {
  font-size: 16px;
  color: #fff;
}
.comments-popup-close {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.comments-popup-close:hover { color: #fff; }
.comments-popup-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.comments-popup-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  font-family: var(--font-small);
  padding: 24px 0;
}
.comment-item {
  display: flex;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 10px;
  transition: background 0.2s;
}
.comment-item:hover { background: rgba(255, 255, 255, 0.04); }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-name { font-size: 12px; color: #fff; font-weight: 400; margin-bottom: 2px; }
.comment-text { font-size: 13px; font-family: var(--font-small); color: rgba(255, 255, 255, 0.65); line-height: 1.4; }
.comment-time { font-size: 10px; color: rgba(255, 255, 255, 0.3); margin-top: 3px; font-family: var(--font-small); }
.comments-popup-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.comments-popup-field {
  flex: 1;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  font-family: var(--font-small);
  transition: border-color 0.2s;
}
.comments-popup-field:focus { border-color: rgba(255, 255, 255, 0.2); }
.comments-popup-field::placeholder { color: rgba(255, 255, 255, 0.3); }
.comments-popup-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.comments-popup-send:hover { background: var(--accent-hover); transform: scale(1.05); }
.comments-popup-send svg { width: 16px; height: 16px; }

/* Light theme — comments popup */
[data-theme="light"] .comments-popup {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .comments-popup-header span { color: var(--text-primary); }
[data-theme="light"] .comments-popup-header { border-color: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .comments-popup-close { color: rgba(0, 0, 0, 0.3); }
[data-theme="light"] .comments-popup-close:hover { color: var(--text-primary); }
[data-theme="light"] .comment-name { color: var(--text-primary); }
[data-theme="light"] .comment-text { color: rgba(0, 0, 0, 0.6); }
[data-theme="light"] .comment-time { color: rgba(0, 0, 0, 0.3); }
[data-theme="light"] .comment-item:hover { background: rgba(0, 0, 0, 0.03); }
[data-theme="light"] .comments-popup-field {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}
[data-theme="light"] .comments-popup-field::placeholder { color: rgba(0, 0, 0, 0.35); }
[data-theme="light"] .comments-popup-input { border-color: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .comments-popup-empty { color: rgba(0, 0, 0, 0.3); }

/* Mobile comments popup — bottom sheet */
.comments-popup-mobile {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-height: none !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 10000 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  padding: 0 !important;
}
.comments-popup-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.comments-popup-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 70vh;
  background: rgba(22, 22, 35, 0.97);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.comments-popup-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  margin: 8px auto 0;
  flex-shrink: 0;
}
.comments-popup-mobile .comments-popup-list {
  max-height: none;
  flex: 1;
  min-height: 120px;
}
[data-theme="light"] .comments-popup-sheet {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .comments-popup-handle {
  background: rgba(0, 0, 0, 0.15);
}

/* Primary Button */
.primary-btn {
  padding: 10px 24px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-small);
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.primary-btn:hover { background: var(--accent-hover); box-shadow: 0 0 20px var(--accent-glow); }

/* ============================================= */
/* Light theme — transparent panels + gradient borders */
/* ============================================= */

/* --- Gradient border mixin via background trick --- */
/* background: <fill> padding-box, <gradient> border-box; border: 1px solid transparent; */

/* Main panel */
[data-theme="light"] .main-panel {
  background:
    rgba(255, 255, 255, 0.10) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.85), rgba(255,255,255,0.4)) border-box;
  border: 1.5px solid transparent;
  border-radius: 32px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

/* Main content area */
[data-theme="light"] .main-content {
  background:
    rgba(255, 255, 255, 0.05) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.3)) border-box;
  border: 1px solid transparent;
}

/* Top nav */
[data-theme="light"] .top-nav {
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* Left sidebar */
[data-theme="light"] .left-sidebar {
  background: rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
}

/* Search bar */
[data-theme="light"] .search-bar {
  background:
    rgba(255, 255, 255, 0.12) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.15)) border-box;
  border: 1px solid transparent;
}
[data-theme="light"] .search-input {
  color: #fff !important;
}
[data-theme="light"] .search-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Glass panels */
[data-theme="light"] .glass-panel {
  background:
    rgba(255, 255, 255, 0.10) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.12)) border-box;
  border: 1px solid transparent;
}

/* Right sidebar sections */
[data-theme="light"] .right-events,
[data-theme="light"] .right-announcements,
[data-theme="light"] .right-friends {
  background:
    rgba(255, 255, 255, 0.10) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0.12)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
}

/* Cards */
[data-theme="light"] .post-card {
  background: none;
  border: none;
}
[data-theme="light"] .news-card,
[data-theme="light"] .event-card {
  background:
    rgba(255, 255, 255, 0.10) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.12)) border-box;
  border: 1px solid transparent;
}

/* Community icons grid */
[data-theme="light"] .feed-community-icon {
  border: none;
  border-radius: var(--radius-lg);
}

/* --- Admin panel --- */
[data-theme="light"] .admin-sidebar {
  background: rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
}
[data-theme="light"] .admin-content {
  background:
    rgba(255, 255, 255, 0.08) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.10)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
}
[data-theme="light"] .admin-list-item {
  background:
    rgba(255, 255, 255, 0.12) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.15)) border-box;
  border: 1px solid transparent;
}
[data-theme="light"] .admin-input,
[data-theme="light"] .admin-select,
[data-theme="light"] .admin-textarea {
  background:
    rgba(255, 255, 255, 0.15) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.15)) border-box;
  border: 1px solid transparent;
  color: #fff !important;
}
[data-theme="light"] .admin-input::placeholder,
[data-theme="light"] .admin-textarea::placeholder {
  color: rgba(255, 255, 255, 0.55) !important;
}
[data-theme="light"] .admin-tab {
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-theme="light"] .admin-section h3 {
  color: #fff !important;
}
[data-theme="light"] .admin-list-item-title {
  color: #fff !important;
}
[data-theme="light"] .admin-list-item-meta {
  color: rgba(255, 255, 255, 0.6) !important;
}
[data-theme="light"] .admin-delete-btn {
  color: #fff !important;
}
[data-theme="light"] .admin-file-label {
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-theme="light"] .admin-checkbox {
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-theme="light"] .admin-role-select {
  background:
    rgba(255, 255, 255, 0.18) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.15)) border-box;
  border: 1px solid transparent;
  color: #fff !important;
}
[data-theme="light"] .admin-tab.active {
  background:
    rgba(255, 255, 255, 0.15) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.12)) border-box;
  border: 1px solid transparent;
  color: #fff !important;
}

[data-theme="light"] #page-admin .section-header h1 {
  color: #fff !important;
}

/* --- Inputs --- */
[data-theme="light"] .contacts-search-input,
[data-theme="light"] .chat-input {
  background:
    rgba(255, 255, 255, 0.12) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.45), rgba(255,255,255,0.12)) border-box;
  border: 1px solid transparent;
}

/* --- Chat --- */
[data-theme="light"] .chat-contacts {
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}
[data-theme="light"] .chat-window {
  background:
    rgba(255, 255, 255, 0.06) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.45), rgba(255,255,255,0.10)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
}
[data-theme="light"] .contact-item.active {
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: var(--radius-lg);
}

/* --- Profile inputs --- */
[data-theme="light"] .profile-input {
  background:
    rgba(255, 255, 255, 0.15) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.15)) border-box;
  border: 1px solid transparent;
}

/* --- Notifications --- */
[data-theme="light"] .notifications-dropdown {
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* --- Toast --- */
[data-theme="light"] .toast {
  background:
    rgba(255, 255, 255, 0.20) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.15)) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Post badge */
[data-theme="light"] .post-community-badge {
  background: rgba(108, 99, 255, 0.15);
  color: #5B52EE;
}

/* Guest overlay */
[data-theme="light"] .guest-overlay {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 8px 32px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .guest-overlay p {
  color: #1a1a2e;
}
[data-theme="light"] .guest-overlay::after {
  background: rgba(255, 255, 255, 0.20);
}
[data-theme="light"] .guest-overlay::before {
  background: rgba(255, 255, 255, 0.35);
}

/* Nav tab active - slider handles active state */
[data-theme="light"] .nav-tab.active {
  background: none;
  border: none;
}
[data-theme="light"] .nav-tab {
  color: rgba(0, 0, 0, 0.5);
}
[data-theme="light"] .nav-tab.active {
  color: rgba(0, 0, 0, 0.85);
}
[data-theme="light"] .nav-tabs-wrapper {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.15);
}
[data-theme="light"] .nav-tabs-slider {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .profile-mini {
  background:
    rgba(255, 255, 255, 0.7) padding-box,
    linear-gradient(135deg, rgba(0,0,0,0.2), rgba(0,0,0,0.06)) border-box;
}
[data-theme="light"] .profile-mini:hover {
  background:
    rgba(255, 255, 255, 0.85) padding-box,
    linear-gradient(135deg, rgba(0,0,0,0.3), rgba(0,0,0,0.1)) border-box;
}
[data-theme="light"] .user-name-mini {
  color: #fff !important;
}
[data-theme="light"] .user-role-mini {
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-theme="light"] .profile-dropdown-arrow {
  color: #fff !important;
}
[data-theme="light"] #theme-toggle .nav-icon-img {
  filter: invert(1);
}

/* Sidebar link active */
[data-theme="light"] .sidebar-link.active {
  background:
    rgba(255, 255, 255, 0.15) padding-box,
    linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.12)) border-box;
  border: 1px solid transparent;
}

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.20);
}
