/* =========================================
   5. ROOM COLLECTIONS (CARDS)
   ========================================= */

.rooms-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.section-header {
  margin-bottom: 1.5rem;
}

.rooms-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  /* Fix: This prevents cards from stretching to the bottom of the page */
  align-items: start; 
  flex: 1;
}

/* --- ROOM CARD --- */

.room-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem; /* Reduced slightly for a tighter look */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  
  /* Fix: Set a proportional height so they don't look giant */
  min-height: 220px;
  max-height: 280px; 
}

.room-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.room-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.room-card-content {
  flex: 1; /* Pushes the action button to the bottom */
}

/* --- DROPDOWN MENU --- */

.room-options {
  position: relative;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  color: var(--text-dim);
}

.room-options:hover {
  background: var(--input-bg);
  color: var(--text-main);
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 110%;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 100;
  overflow: hidden;
  min-width: 150px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu button {
  width: 100%;
  padding: 10px 15px;
  background: none;
  border: none;
  color: var(--text-main);
  text-align: left;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.dropdown-menu button:hover {
  background: var(--accent);
  color: white;
}

.dropdown-menu button.danger-text {
  color: var(--danger);
}

.dropdown-menu button.danger-text:hover {
  background: var(--danger);
  color: white !important;
}

/* --- LINKS PREVIEW --- */

.links-list span {
  display: inline-block;
  background: var(--bg-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* --- EMPTY / LOCKED STATE --- */

.rooms-list .empty-auth-state {
  grid-column: 1 / -1; 
  width: 100%;
  height: 100%;
  min-height: 500px;
  background: transparent; /* Makes it feel less "heavy" than a solid card */
  border: 2px dashed var(--border);
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem;
  margin-top: 0;
}

.empty-auth-state i {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.empty-auth-state h2 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.empty-auth-state p {
  color: var(--text-dim);
  max-width: 400px;
  font-size: 1rem;
  line-height: 1.5;
}