/* Challenge System Styles */

/* Challenge Button */
#challengeBtn {
  background: linear-gradient(135deg, #ff9500, #ff6b35);
  border: none;
  color: white;
  transition: all 0.3s ease;
}

#challengeBtn:hover {
  background: linear-gradient(135deg, #ff6b35, #ff9500);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 149, 0, 0.5);
}

/* Challenge Modal */
.challenge-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.challenge-modal {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid #ff9500;
  border-radius: 15px;
  max-width: 700px;
  width: 95%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255, 149, 0, 0.3);
}

.challenge-header {
  background: linear-gradient(135deg, #ff9500, #ff6b35);
  color: #1a1a2e;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.challenge-header h3 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.challenge-header p {
  margin: 0.5rem 0 0 0;
  opacity: 0.9;
  font-size: 1.1rem;
}

.challenge-content {
  padding: 2rem;
  max-height: 70vh;
  overflow-y: auto;
  display: grid;
  gap: 2rem;
}

.challenge-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 10px;
  padding: 1.5rem;
}

.challenge-section h4 {
  color: #ff9500;
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 149, 0, 0.3);
  padding-bottom: 0.5rem;
}

/* Tables List */
.tables-list {
  display: grid;
  gap: 1rem;
}

.table-item {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 149, 0, 0.3);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.table-item:hover {
  background: rgba(255, 149, 0, 0.1);
  border-color: #ff9500;
  transform: translateY(-2px);
}

.table-item.selected {
  background: rgba(255, 149, 0, 0.2);
  border-color: #ff9500;
  box-shadow: 0 0 15px rgba(255, 149, 0, 0.3);
}

.table-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.table-name {
  color: #ff9500;
  font-weight: bold;
  font-size: 1.1rem;
}

.player-count {
  color: #888;
  font-size: 0.9rem;
}

.table-players {
  color: #fff;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.player-name {
  color: #00ff88;
  margin-right: 0.5rem;
}

.challenge-btn {
  background: linear-gradient(135deg, #ff9500, #ff6b35);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1.2rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.challenge-btn:hover {
  background: linear-gradient(135deg, #ff6b35, #ff9500);
  transform: scale(1.05);
}

/* Game Selection */
.game-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.game-option-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 149, 0, 0.3);
  border-radius: 8px;
  color: #fff;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.game-option-btn:hover {
  background: rgba(255, 149, 0, 0.1);
  border-color: #ff9500;
  transform: scale(1.02);
}

.game-option-btn.selected {
  background: rgba(255, 149, 0, 0.2);
  border-color: #ff9500;
  color: #ff9500;
  box-shadow: 0 0 15px rgba(255, 149, 0, 0.3);
}

/* Send Challenge Button */
.send-challenge-btn {
  background: linear-gradient(135deg, #00ff88, #00cc6f);
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  padding: 1.2rem 2rem;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.send-challenge-btn:hover {
  background: linear-gradient(135deg, #00cc6f, #00ff88);
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

/* Active Challenges */
.active-challenges {
  display: grid;
  gap: 1rem;
}

.challenge-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 149, 0, 0.3);
  border-radius: 8px;
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.challenge-item.pending {
  border-color: rgba(255, 193, 7, 0.5);
  background: rgba(255, 193, 7, 0.05);
}

.challenge-item.active {
  border-color: rgba(0, 255, 136, 0.5);
  background: rgba(0, 255, 136, 0.05);
}

.challenge-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.game-type {
  color: #ff9500;
  font-weight: bold;
  font-size: 1.1rem;
}

.opponent {
  color: #fff;
  font-size: 0.95rem;
}

.status {
  color: #888;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.challenge-time {
  color: #888;
  font-size: 0.9rem;
}

/* Challenge Notification */
.challenge-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 3px solid #ff9500;
  border-radius: 15px;
  padding: 2rem;
  z-index: 10001;
  box-shadow: 0 0 50px rgba(255, 149, 0, 0.5);
  animation: challengePulse 2s ease-in-out infinite;
  max-width: 400px;
  width: 90%;
}

.notification-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.notification-header h4 {
  color: #ff9500;
  margin: 0;
  font-size: 1.5rem;
  text-shadow: 0 0 10px rgba(255, 149, 0, 0.5);
}

.notification-content {
  text-align: center;
  color: #fff;
}

.notification-content p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.notification-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.accept-btn {
  background: linear-gradient(135deg, #00ff88, #00cc6f);
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
}

.accept-btn:hover {
  background: linear-gradient(135deg, #00cc6f, #00ff88);
  transform: scale(1.05);
}

.decline-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
}

.decline-btn:hover {
  background: linear-gradient(135deg, #ee5a24, #ff6b6b);
  transform: scale(1.05);
}

/* Empty States */
.no-tables,
.no-challenges {
  text-align: center;
  color: #888;
  padding: 2rem;
  font-style: italic;
  font-size: 1.1rem;
}

/* Animations */
@keyframes challengePulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(255, 149, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 50px rgba(255, 149, 0, 0.8);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .challenge-modal {
    width: 98%;
    margin: 1rem;
  }

  .challenge-content {
    padding: 1rem;
    gap: 1.5rem;
  }

  .challenge-section {
    padding: 1rem;
  }

  .game-selection {
    grid-template-columns: 1fr;
  }

  .table-item {
    grid-template-columns: 1fr;
    text-align: center;
  }

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