/* Chillstation — Social Rooms, Live Chat & Auth Styling */

/* Auth Modal Styles */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 99px;
  border: 1px solid var(--bd);
}
.auth-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--mut);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-tab-btn.active {
  background: var(--acc);
  color: #14221a;
  font-weight: 600;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  text-align: left;
}
.auth-field label {
  font-size: 12px;
  color: var(--mut);
  font-weight: 500;
}
.palette-picker {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.palette-color {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.palette-color:hover {
  transform: scale(1.15);
}
.palette-color.selected {
  border-color: #fff;
  transform: scale(1.18);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

/* User Badge in Top Bar */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bd);
  border-radius: 99px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}
.user-badge:hover {
  background: rgba(255, 255, 255, 0.15);
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #111;
  font-weight: 700;
  font-size: 12px;
  flex: none;
}

/* Rooms Directory View */
.rooms-hero {
  text-align: center;
  margin-bottom: 28px;
}
.rooms-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 0 0 8px;
  font-weight: 400;
  letter-spacing: -0.03em;
}
.rooms-hero p {
  color: var(--mut);
  margin: 0;
  font-size: 15px;
}
.rooms-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.join-code-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bd);
  border-radius: 99px;
  padding: 4px 6px 4px 14px;
}
.join-code-box input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--fg);
  font-size: 13px;
  width: 140px;
}
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.room-card {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.room-card:hover {
  transform: translateY(-2px);
  border-color: var(--acc);
}
.room-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.room-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}
.room-online-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94e0b8;
  background: rgba(148, 224, 184, 0.12);
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 500;
}
.room-card-meta {
  font-size: 12px;
  color: var(--mut);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.room-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* In-Room Realtime Chat & Participants Drawer */
.room-chat-drawer {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  background: rgba(18, 26, 22, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid var(--bd);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.5);
  z-index: 20;
  display: flex;
  flex-direction: column;
  transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.room-chat-drawer.open {
  right: 0;
}
.chat-drawer-head {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.chat-drawer-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-members-strip {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: none;
}
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  font-size: 11px;
  color: var(--fg);
  white-space: nowrap;
}
.member-chip.is-owner {
  border: 1px solid rgba(168, 191, 163, 0.4);
}
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
}
.chat-msg-body {
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  max-width: 82%;
  word-break: break-word;
}
.chat-msg.is-self {
  flex-direction: row-reverse;
}
.chat-msg.is-self .chat-msg-body {
  background: rgba(168, 191, 163, 0.18);
  border: 1px solid rgba(168, 191, 163, 0.28);
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
}
.chat-msg-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--mut);
  margin-bottom: 3px;
}
.chat-msg-header strong {
  color: var(--fg);
}
.chat-msg.system {
  justify-content: center;
  text-align: center;
}
.chat-msg.system .system-text {
  font-size: 11px;
  color: var(--mut);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 12px;
  border-radius: 99px;
  font-style: italic;
}
.chat-input-bar {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  gap: 8px;
  background: rgba(14, 20, 17, 0.95);
}
.chat-input-bar input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bd);
  border-radius: 99px;
  padding: 9px 14px;
  color: var(--fg);
  font-size: 13px;
  outline: none;
}
.chat-input-bar input:focus {
  border-color: var(--acc);
}

/* Active Room Banner in Focus Room */
.active-room-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(168, 191, 163, 0.14);
  border: 1px solid rgba(168, 191, 163, 0.28);
  border-radius: 99px;
  color: var(--fg);
  font-size: 12px;
  margin-bottom: 12px;
}
.room-share-btn {
  background: transparent;
  border: 0;
  color: var(--acc);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}
.room-share-btn:hover {
  text-decoration: underline;
}
.unread-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #f0948d;
  border-radius: 50%;
  box-shadow: 0 0 8px #f0948d;
}

/* Mobile Topbar & Responsive Refinements */
@media (max-width: 700px) {
  .top {
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }
  .brand b {
    display: none !important;
  }
  .brand {
    min-width: 0 !important;
    flex-shrink: 0;
  }
  .rt {
    min-width: 0 !important;
    gap: 3px !important;
    flex-shrink: 0;
  }
  #user-slot .user-name {
    display: none !important;
  }
  #btn-open-auth {
    padding: 5px 9px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }
  .top .tabs {
    gap: 6px !important;
    flex: 1 1 auto;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .top .tabs::-webkit-scrollbar {
    display: none;
  }
  .tabs button {
    padding: 5px 6px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }
  .room-chat-drawer {
    width: 100% !important;
    max-width: 100% !important;
  }
}
