/* ActionCable Real-time Notifications */

/* Player Notifications (for invitations, etc.) */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px;
  min-width: 300px;
  max-width: 400px;
  z-index: 10000;
  transform: translateX(420px);
  transition: transform 0.3s ease-in-out;
  border-left: 4px solid #007bff;
}

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

.notification--invitation {
  border-left-color: #28a745;
  background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.notification--success {
  border-left-color: #28a745;
}

.notification--warning {
  border-left-color: #ffc107;
}

.notification--error {
  border-left-color: #dc3545;
}

.notification--info {
  border-left-color: #17a2b8;
}

.notification-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.notification-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.notification-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0;
  margin-left: 12px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:hover {
  color: #666;
}

/* Game Notifications (for in-game updates) */
.game-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease-in-out;
  pointer-events: none;
}

.game-notification--show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.game-notification--success {
  background: rgba(40, 167, 69, 0.9);
}

.game-notification--info {
  background: rgba(23, 162, 184, 0.9);
}

.game-notification--warning {
  background: rgba(255, 193, 7, 0.9);
  color: #333;
}

.game-notification-content {
  text-align: center;
}

.game-notification-message {
  font-weight: 500;
}

/* Connection Status Indicator */
.connection-status {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 10001;
  transition: all 0.3s ease-in-out;
}

.connection-status--connected {
  background: rgba(40, 167, 69, 0.9);
  color: white;
}

.connection-status--disconnected {
  background: rgba(220, 53, 69, 0.9);
  color: white;
}

.connection-status--hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-40px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .notification {
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
    transform: translateY(-120px);
  }
  
  .notification--show {
    transform: translateY(0);
  }
  
  .game-notification {
    left: 20px;
    right: 20px;
    transform: translate(0, -50%) scale(0.8);
  }
  
  .game-notification--show {
    transform: translate(0, -50%) scale(1);
  }
}

/* Animation for stacked notifications */
.notification:nth-child(n+2) {
  top: calc(20px + (80px * var(--notification-index, 0)));
}

/* Custom notification types for Matatu game */
.notification--turn {
  border-left-color: #6f42c1;
  background: linear-gradient(135deg, #fbf9ff 0%, #f0ebff 100%);
}

.notification--card-played {
  border-left-color: #fd7e14;
  background: linear-gradient(135deg, #fffbf7 0%, #fff2e6 100%);
}

.notification--game-finished {
  border-left-color: #e83e8c;
  background: linear-gradient(135deg, #fffafe 0%, #fdf2f8 100%);
}