/* Room Card Container */
.room-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

/* Card Background with Gradient */
.room-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  transition: all 0.3s ease;
}

/* Dark Overlay for Better Text Readability */
.room-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(17, 24, 39, 0.98) 0%, rgba(17, 24, 39, 0.85) 40%, rgba(17, 24, 39, 0.6) 70%, rgba(17, 24, 39, 0.3) 100%);
  z-index: 1;
}

/* Card Image */
.room-card-image {
  z-index: 0;
}

.room-card-img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.6);
}

/* Card Content */
.room-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

/* Card Title */
.room-card-title {
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: #fff;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 
               0 4px 16px rgba(0, 0, 0, 0.6),
               0 1px 3px rgba(0, 0, 0, 0.9);
  transition: all 0.3s ease;
}

/* Card Description */
.room-card-description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8),
               0 1px 3px rgba(0, 0, 0, 0.9);
  opacity: 0.9;
  transition: all 0.3s ease;
}

/* Card Footer */
.room-card-footer {
  margin-top: auto;
}

/* Hover Overlay Effect */
.room-card-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

/* Hover Effects */
.group:hover .room-card {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3), 
              0 0 0 1px rgba(139, 92, 246, 0.4);
}

.group:hover .room-card-bg {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
  border-color: rgba(139, 92, 246, 0.4);
}

.group:hover .room-card-img {
  transform: scale(1.1);
  filter: brightness(0.75);
}

.group:hover .room-card-hover-overlay {
  opacity: 1;
}

.group:hover .room-card-title {
  color: #a78bfa;
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.group:hover .room-card-description {
  opacity: 1;
  color: rgba(255, 255, 255, 0.9);
}

/* Active Room Badge Styling */
.room-card-footer span {
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.2);
  transition: all 0.3s ease;
}

.group:hover .room-card-footer span {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .room-card-content {
    padding: 1rem;
  }
  
  .room-card-title {
    font-size: 1.125rem;
    line-height: 1.5rem;
  }
  
  .room-card-description {
    font-size: 0.813rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }
}

/* Animation for Loading State */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.room-card.loading {
  background: linear-gradient(
    90deg,
    rgba(17, 24, 39, 0.8) 0%,
    rgba(139, 92, 246, 0.1) 50%,
    rgba(17, 24, 39, 0.8) 100%
  );
  background-size: 2000px 100%;
  animation: shimmer 2s infinite;
}

/* Focus State for Accessibility */
.group:focus-visible .room-card {
  outline: 2px solid #8b5cf6;
  outline-offset: 4px;
}
