/**
 * JAI Games - Lobby Styling
 * Beautiful, responsive lobby interface with animations
 */

/* Lobby Container */
.lobby-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 60px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.lobby-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #e91e63, #9b59b6, #3498db);
  animation: gradientSlide 3s linear infinite;
}

/* Lobby Header */
.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.lobby-title {
  font-size: 32px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fff 0%, #e91e63 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lobby-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.online {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
}

/* Quick Match Section */
.quick-match-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.quick-match-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.quick-match-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(233, 30, 99, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(155, 89, 182, 0.3);
}

.quick-match-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-match-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.quick-match-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.quick-match-buttons {
  display: flex;
  gap: 8px;
}

.btn-quick {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn-quick.primary {
  background: linear-gradient(135deg, #e91e63 0%, #9b59b6 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.btn-quick.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.5);
}

.btn-quick.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.btn-quick.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Active Games Section */
.active-games-section {
  margin-bottom: 40px;
}

.active-games-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-refresh {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.active-games-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.lobby-game-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
}

.lobby-game-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(155, 89, 182, 0.3);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.game-info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.game-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.game-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.game-host {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.game-status {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.game-status.waiting {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.game-status.in_progress {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.game-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.game-actions {
  display: flex;
  gap: 8px;
}

.btn-join,
.btn-spectate {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
  filter: grayscale(1);
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

/* Chat Section */
.lobby-chat-section {
  margin-top: 40px;
}

.lobby-chat-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 400px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #9b59b6;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.chat-message:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chat-message.system {
  border-left-color: #3498db;
  background: rgba(52, 152, 219, 0.1);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.chat-username {
  font-size: 13px;
  font-weight: 700;
  color: #e91e63;
}

.chat-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.chat-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-input-container {
  display: flex;
  gap: 10px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(155, 89, 182, 0.6);
  box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.2);
}

.btn-chat-send {
  padding: 12px 24px;
  background: linear-gradient(135deg, #e91e63 0%, #9b59b6 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-chat-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(233, 30, 99, 0.4);
}

/* Online Counter */
.online-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.online-dot {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

.online-count {
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.online-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Notifications */
.lobby-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lobby-notification.show {
  transform: translateX(0);
}

.lobby-notification.success {
  border-left: 4px solid #22c55e;
}

.lobby-notification.error {
  border-left: 4px solid #ef4444;
}

.lobby-notification.info {
  border-left: 4px solid #3498db;
}

.lobby-notification.warning {
  border-left: 4px solid #f59e0b;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-icon {
  font-size: 20px;
  font-weight: 700;
}

.notification-message {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.2);
  }
}

@keyframes gradientSlide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e91e63, #9b59b6);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(233, 30, 99, 0.3);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff2c75, #b066d4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .lobby-container {
    padding: 25px;
  }

  .lobby-title {
    font-size: 24px;
  }

  .quick-match-grid {
    grid-template-columns: 1fr;
  }

  .active-games-list {
    grid-template-columns: 1fr;
  }

  .game-details {
    grid-template-columns: repeat(2, 1fr);
  }

  .lobby-chat-container {
    height: 300px;
  }

  .lobby-notification {
    right: 10px;
    left: 10px;
    min-width: auto;
  }

  .online-counter {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .lobby-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-match-buttons {
    flex-direction: column;
  }

  .game-actions {
    flex-direction: column;
  }

  .chat-input-container {
    flex-direction: column;
  }

  .btn-chat-send {
    width: 100%;
  }
}
