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

body {
  font-family: "Arial", sans-serif;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  min-height: 100vh;
  color: #fff;
  padding: 2rem 0;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

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

.back-link {
  position: absolute;
  left: 0;
  top: 0;
  color: #4ecdc4;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
}

.back-link:hover {
  transform: translateX(-5px);
  color: #ff6b6b;
}

.header h1 {
  font-size: 2.5rem;
  color: #ff6b6b;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.5rem;
}

.header p {
  color: #ccc;
  font-size: 1.1rem;
  opacity: 0.8;
}

.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-input,
.filter-select {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #4ecdc4;
  background: rgba(255, 255, 255, 0.15);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.filter-select option {
  background: #16213e;
  color: #fff;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.room-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.room-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(78, 205, 196, 0.2);
  border-color: rgba(78, 205, 196, 0.3);
}

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

.room-card h3 {
  font-size: 1.3rem;
  color: #4ecdc4;
  margin: 0;
}

.room-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
}

.room-badge.public {
  background: rgba(78, 205, 196, 0.3);
  color: #4ecdc4;
  border: 1px solid rgba(78, 205, 196, 0.5);
}

.room-badge.private {
  background: rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.5);
}

.room-info {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.room-info p {
  color: #d0d0d0;
  font-size: 0.95rem;
  margin: 0.3rem 0;
}

.room-info strong {
  color: #e0e0e0;
}

.btn-join-room {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.btn-join-room:hover:not(:disabled) {
  background: linear-gradient(45deg, #44a08d, #4ecdc4);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.btn-join-room:disabled {
  background: rgba(100, 100, 100, 0.5);
  cursor: not-allowed;
  opacity: 0.6;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.empty-state p {
  color: #ccc;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Added loading skeleton styles */
.loading-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.skeleton-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  height: 200px;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    background: rgba(255, 255, 255, 0.08);
  }
  50% {
    background: rgba(255, 255, 255, 0.12);
  }
  100% {
    background: rgba(255, 255, 255, 0.08);
  }
}

/* Fade-out and fade-in for smoother UX */
.skeleton-card.fade-out {
  animation: fadeOut 0.35s forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

.room-card.fade-in {
  animation: fadeIn 0.35s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-create-room {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: linear-gradient(45deg, #ff6b6b, #ee5a52);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-create-room:hover {
  background: linear-gradient(45deg, #ee5a52, #ff6b6b);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .back-link {
    position: static;
    display: block;
    margin-bottom: 1rem;
  }

  .filters {
    flex-direction: column;
  }

  .search-input,
  .filter-select {
    min-width: unset;
  }

  .rooms-grid {
    grid-template-columns: 1fr;
  }
}
