:root {
  --black: #040404;
  --panel-bg: #080808;
  --bone: #fffdf9;
  --bone-70: rgba(255, 253, 249, 0.7);
  --bone-40: rgba(255, 253, 249, 0.4);
  --accent: #d4a853;
  --accent-hover: #e5b962;
  --accent-glow: rgba(212, 168, 83, 0.3);
  --border-light: rgba(255, 253, 249, 0.08);
  --border-active: rgba(212, 168, 83, 0.4);
  --glass-bg: rgba(255, 253, 249, 0.025);
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
}

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

body {
  background-color: var(--black);
  color: var(--bone);
  font-family: var(--font-sans);
  overflow-x: hidden;
  height: 100vh;
}

/* APP LAYOUT GRID */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  width: 100vw;
}

/* SIDEBAR */
.sidebar {
  background-color: #030303;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.85rem;
  z-index: 10;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1f180d 0%, #0c0a06 100%);
  border: 1px solid var(--border-active);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--accent-glow);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-symbol {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.brand-status {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bone-40);
  letter-spacing: 0.15em;
  margin-bottom: 0.85rem;
  display: block;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  color: var(--bone-70);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background-color: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.pill-badge {
  margin-left: auto;
  font-size: 0.65rem;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* ROOMS SWITCHER */
.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.room-btn {
  background: transparent;
  border: none;
  color: var(--bone-70);
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.room-btn:hover {
  background: rgba(255,253,249,0.03);
  color: var(--bone);
}

.room-btn.active {
  background: linear-gradient(90deg, rgba(212,168,83,0.12) 0%, transparent 100%);
  color: var(--accent);
  font-weight: 600;
}

/* SIDEBAR FOOTER PROFILE */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.user-card:hover {
  background: var(--glass-bg);
}

.avatar-wrapper {
  position: relative;
}

.avatar, .avatar-small {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e1b15;
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
}

.avatar-small {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #06d6a0;
  border: 2px solid var(--panel-bg);
  border-radius: 50%;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.7rem;
  color: var(--accent);
}

/* MAIN CONTENT */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background: radial-gradient(circle at 80% 10%, rgba(212,168,83,0.04) 0%, transparent 50%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(4,4,4,0.75);
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  width: 400px;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--bone);
  font-size: 0.88rem;
  width: 100%;
  outline: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.action-btn {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  color: var(--bone);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary-glow {
  background: linear-gradient(135deg, var(--accent) 0%, #b88a35 100%);
  color: var(--black);
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 0 15px var(--accent-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary-glow:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(212,168,83,0.5);
}

/* ROOM VIEWPORT */
.room-viewport {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

.room-header-banner {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.room-header-banner h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--bone);
  margin-bottom: 0.4rem;
}

.room-header-banner p {
  color: var(--bone-70);
  font-size: 0.95rem;
}

/* POST CREATE BOX */
.post-create-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 2.5rem;
}

.post-create-box input {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--bone);
  flex: 1;
  outline: none;
  cursor: pointer;
}

.btn-accent {
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* FEED CARDS */
.feed-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.post-card:hover {
  border-color: rgba(212,168,83,0.25);
}

.post-card.pinned {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(212,168,83,0.04) 0%, var(--panel-bg) 100%);
  box-shadow: 0 0 30px rgba(212,168,83,0.06);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

.pin-badge {
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: auto;
}

.post-body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--bone);
}

.post-body p {
  color: var(--bone-70);
  line-height: 1.6;
  margin-bottom: 1rem;
  white-space: pre-line;
}

.post-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--bone-40);
}

.like-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-glass-card {
  background: #0d0b08;
  border: 1px solid var(--accent);
  width: 100%;
  max-width: 460px;
  border-radius: 16px;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 0 50px rgba(212,168,83,0.2);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--bone-40);
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-symbol.large {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.modal-header p {
  font-size: 0.85rem;
  color: var(--bone-40);
  margin-top: 0.25rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--black);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 1.5rem;
}

.auth-tab {
  background: none;
  border: none;
  padding: 0.6rem;
  color: var(--bone-40);
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--panel-bg);
  color: var(--accent);
  border: 1px solid var(--border-active);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group label {
  font-size: 0.8rem;
  color: var(--bone-70);
  margin-bottom: 0.4rem;
  display: block;
}

.input-group input {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--border-light);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  color: var(--bone);
  outline: none;
}

.input-group input:focus {
  border-color: var(--accent);
}

.btn-gold-submit {
  background: linear-gradient(135deg, var(--accent) 0%, #b88a35 100%);
  color: var(--black);
  border: none;
  padding: 0.9rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--bone-40);
}

/* VIP LUXURY TOAST NOTIFICATIONS */
#toast-container {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-pill {
  pointer-events: auto;
  background: rgba(8, 8, 8, 0.96);
  border: 1px solid #D4A853;
  color: #f3f3f3;
  padding: 1rem 1.75rem;
  border-radius: 100px;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(212, 168, 83, 0.25);
  backdrop-filter: blur(16px);
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(25px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* MOBILE DRAWER BACKDROP */
.drawer-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 850 !important;
}
.drawer-backdrop.hidden {
  display: none !important;
}

/* MOBILE RESPONSIVE VIEWPORT (< 768px) */
.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: flex !important;
  }

  .app-layout {
    grid-template-columns: 1fr;
    width: 100vw;
  }
  
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 285px;
    background: #060606;
    box-shadow: 20px 0 80px rgba(0,0,0,0.95);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 900 !important;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .topbar {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .search-wrapper {
    width: 140px;
    padding: 0.4rem 0.6rem;
  }

  .search-input::placeholder {
    color: transparent;
  }

  .room-viewport {
    padding: 1rem;
  }

  .room-header-banner h2 {
    font-size: 1.4rem;
  }

  .post-card {
    padding: 1rem;
  }
}
