/**
 * Design Enhancements CSS
 * Phase 2 improvements: Toast notifications, enhanced cards, stats, etc.
 */

/* ==================== TOAST NOTIFICATIONS ==================== */

.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

.notification {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 12px var(--shadow-heavy);
  pointer-events: all;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  min-width: 300px;
  max-width: 100%;
}

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

.notification.hide {
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease-in;
}

/* Notification Icon */
.notification-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  color: white;
}

/* Notification Content */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-message {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Close Button */
.notification-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notification-close:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Notification Types */
.notification-success {
  border-left-color: var(--success);
}

.notification-success .notification-icon {
  background-color: var(--success);
}

.notification-error {
  border-left-color: var(--error);
}

.notification-error .notification-icon {
  background-color: var(--error);
}

.notification-warning {
  border-left-color: var(--warning);
}

.notification-warning .notification-icon {
  background-color: var(--warning);
}

.notification-info {
  border-left-color: var(--info);
}

.notification-info .notification-icon {
  background-color: var(--info);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .notification-container {
    left: 10px;
    right: 10px;
    top: 10px;
    max-width: none;
  }

  .notification {
    min-width: auto;
  }

  .notification-message {
    font-size: 0.9rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .notification {
    transition: opacity 0.3s ease;
    transform: none;
  }

  .notification.show {
    transform: none;
  }

  .notification.hide {
    transform: none;
  }
}

/* ==================== ENHANCED PLAYER CARDS ==================== */

.player-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px var(--shadow-heavy), 0 0 0 1px var(--accent);
}

/* Pulsing online indicator enhancement */
.status-badge.online {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ==================== LOADING SKELETON SCREENS ==================== */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-text {
  flex: 1;
}

.skeleton-line {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-line.medium {
  width: 80%;
}

.skeleton-line.long {
  width: 100%;
}

/* ==================== STATS DASHBOARD ==================== */

.stats-dashboard {
  background: linear-gradient(135deg, #2e2e2e 0%, #1a1a1a 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 0 auto 2rem auto;
  max-width: 850px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stats-dashboard-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 1.25rem 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-value.highlight {
  color: var(--accent);
}

.stat-value.success {
  color: var(--success);
}

.stat-subtext {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

/* Stat value animation */
.stat-value.animating {
  animation: countUp 0.5s ease-out;
}

@keyframes countUp {
  from {
    opacity: 0.5;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== SEARCH & FILTER ==================== */

.search-filter-bar {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-wrapper {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-hover);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 1.1rem;
  pointer-events: none;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-button {
  padding: 0.5rem 1rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.filter-button:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.filter-button.active {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

.sort-select {
  padding: 0.5rem 1rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-hover);
}

/* No results message */
.no-results {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results-text {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.no-results-subtext {
  font-size: 0.95rem;
  color: var(--text-tertiary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .search-filter-bar {
    padding: 1rem;
  }

  .search-input-wrapper {
    min-width: 100%;
  }

  .filter-buttons,
  .sort-select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-dashboard {
    padding: 1rem;
  }
}
