/* =================================================================
   RandArena - Modern Arena Champion Selector
   Style U.GG cohérent avec le site
   ================================================================= */

/* Variables CSS - U.GG Theme */
:root {
  /* U.GG Color Palette */
  --ugg-bg-primary: #1c1c1f;
  --ugg-bg-secondary: #28282c;
  --ugg-bg-tertiary: #16161a;
  --ugg-card-bg: #28282c;
  --ugg-card-hover: #313135;

  /* Primary Colors */
  --ugg-blue: #5383e8;
  --ugg-blue-light: #7ca1f3;
  --ugg-cyan: #00bfd6;
  --ugg-gold: #f0b232;
  --ugg-green: #10b981;

  /* Text Colors */
  --ugg-text-primary: #e4e4e7;
  --ugg-text-secondary: #a1a1aa;
  --ugg-text-tertiary: #71717a;

  /* Borders & Dividers */
  --ugg-border: #3f3f46;
  --ugg-border-light: #52525b;

  /* Shadows */
  --ugg-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --ugg-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* Base Layout */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--ugg-bg-primary);
  color: var(--ugg-text-primary);
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ugg-blue) 0%, var(--ugg-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--ugg-text-secondary);
  font-weight: 500;
}

/* Player Section */
.player-section {
  background: var(--ugg-card-bg);
  backdrop-filter: blur(20px);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--ugg-border);
  box-shadow: var(--ugg-shadow);
}

.player-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.player-details {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.player-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--ugg-blue);
  background: var(--ugg-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--ugg-blue);
}

.player-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ugg-text-primary);
  margin-bottom: 0.25rem;
}

.player-status {
  font-size: 0.9rem;
  color: var(--ugg-text-tertiary);
}

/* Auth Form */
.auth-form {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ugg-border);
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

.form-label {
  display: block;
  color: var(--ugg-text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--ugg-bg-tertiary);
  border: 1px solid var(--ugg-border);
  border-radius: 4px;
  color: var(--ugg-text-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--ugg-blue);
  background: var(--ugg-bg-secondary);
  box-shadow: 0 0 0 3px rgba(83, 131, 232, 0.1);
}

.form-input::placeholder {
  color: var(--ugg-text-tertiary);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.btn-primary {
  background: var(--ugg-blue);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--ugg-blue-light);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--ugg-text-secondary);
  border: 1px solid var(--ugg-border);
}

.btn-secondary:hover {
  background: var(--ugg-card-hover);
  border-color: var(--ugg-border-light);
  color: var(--ugg-text-primary);
}

.btn-scan {
  background: var(--ugg-green);
  color: white;
  border: none;
}

.btn-scan:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Main Grid Layout */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  margin-top: 2rem;
}

/* Champions Section */
.champions-section {
  background: var(--ugg-card-bg);
  backdrop-filter: blur(20px);
  border-radius: 8px;
  padding: 2rem;
  border: 1px solid var(--ugg-border);
  box-shadow: var(--ugg-shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ugg-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Filters */
.filters-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--ugg-bg-tertiary);
  border: 1px solid var(--ugg-border);
  border-radius: 4px;
  color: var(--ugg-text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--ugg-card-hover);
  border-color: var(--ugg-border-light);
  color: var(--ugg-text-primary);
}

.filter-btn.active {
  background: var(--ugg-blue);
  border-color: var(--ugg-blue);
  color: white;
}

.search-box {
  flex: 1;
  min-width: 200px;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--ugg-bg-tertiary);
  border: 1px solid var(--ugg-border);
  border-radius: 4px;
  color: var(--ugg-text-primary);
  font-size: 0.875rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--ugg-blue);
  background-color: var(--ugg-bg-secondary);
  box-shadow: 0 0 0 3px rgba(83, 131, 232, 0.1);
}

/* Champions Grid */
.champions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  max-height: 600px;
  overflow-y: auto;
  padding: 0.5rem;
}

.champions-grid::-webkit-scrollbar {
  width: 6px;
}

.champions-grid::-webkit-scrollbar-track {
  background: var(--ugg-bg-tertiary);
  border-radius: 3px;
}

.champions-grid::-webkit-scrollbar-thumb {
  background: var(--ugg-border);
  border-radius: 3px;
}

.champions-grid::-webkit-scrollbar-thumb:hover {
  background: var(--ugg-border-light);
}

.champion-card {
  background: var(--ugg-bg-tertiary);
  border: 1px solid var(--ugg-border);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.champion-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent, rgba(83, 131, 232, 0.1));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.champion-card:hover {
  transform: translateY(-4px);
  border-color: var(--ugg-blue);
  background: var(--ugg-card-hover);
}

.champion-card:hover::before {
  opacity: 1;
}

.champion-card.top1 {
  background: linear-gradient(135deg, rgba(240, 178, 50, 0.15), rgba(240, 178, 50, 0.05));
  border-color: rgba(240, 178, 50, 0.4);
}

.champion-card.top1::after {
  content: '👑';
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  font-size: 1rem;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.champion-card.hidden {
  display: none;
}

.champion-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  margin-bottom: 0.5rem;
  transition: transform 0.2s ease;
}

.champion-card:hover .champion-img {
  transform: scale(1.05);
}

.champion-name {
  font-size: 0.8125rem;
  color: var(--ugg-text-primary);
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

/* Selector Section */
.selector-section {
  background: var(--ugg-card-bg);
  backdrop-filter: blur(20px);
  border-radius: 8px;
  padding: 2rem;
  border: 1px solid var(--ugg-border);
  box-shadow: var(--ugg-shadow);
  position: sticky;
  top: 80px;
}

.random-display {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--ugg-bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--ugg-border);
}

.selected-champion-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid var(--ugg-blue);
  margin: 0 auto 1rem;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.selected-champion-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ugg-text-primary);
  margin-bottom: 0.5rem;
}

.champion-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.champion-status.top1 {
  background: rgba(240, 178, 50, 0.15);
  color: var(--ugg-gold);
  border: 1px solid rgba(240, 178, 50, 0.3);
}

.champion-status.new {
  background: rgba(16, 185, 129, 0.15);
  color: var(--ugg-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--ugg-bg-tertiary);
  border: 1px solid var(--ugg-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-group:hover {
  background: var(--ugg-card-hover);
  border-color: var(--ugg-border-light);
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--ugg-blue);
}

.checkbox-group label {
  flex: 1;
  color: var(--ugg-text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
}

/* Stats Section */
.stats-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ugg-border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--ugg-bg-tertiary);
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--ugg-border);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ugg-blue);
  margin-bottom: 0.25rem;
}

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

/* Top1 Champions Grid */
.top1-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.top1-champion-card {
  text-align: center;
  padding: 0.5rem;
  background: rgba(240, 178, 50, 0.1);
  border: 1px solid rgba(240, 178, 50, 0.3);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.top1-champion-card:hover {
  transform: translateY(-2px);
  border-color: var(--ugg-gold);
  background: rgba(240, 178, 50, 0.15);
}

.top1-champion-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  margin-bottom: 0.5rem;
  border: 2px solid var(--ugg-gold);
}

.top1-champion-name {
  font-size: 0.75rem;
  color: var(--ugg-text-primary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.top1-count {
  font-size: 0.7rem;
  color: var(--ugg-gold);
  font-weight: 700;
}

/* Alert Messages */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--ugg-green);
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.alert-info {
  background: rgba(83, 131, 232, 0.15);
  border: 1px solid rgba(83, 131, 232, 0.3);
  color: var(--ugg-blue);
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--ugg-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .selector-section {
    position: static;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .player-info-header {
    flex-direction: column;
    text-align: center;
  }

  .form-row {
    flex-direction: column;
  }

  .form-group {
    width: 100%;
  }

  .champions-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
  }

  .selected-champion-img {
    width: 140px;
    height: 140px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
