/* League of Legends Draft Assistant - Main Stylesheet */
/* Dark theme inspired by LoL client */

:root {
  --bg-primary: #010a13;
  --bg-secondary: #0a1428;
  --bg-tertiary: #1e2328;
  --bg-card: #1a1a2e;
  --gold-primary: #c89b3c;
  --gold-light: #f0e6d2;
  --gold-dark: #785a28;
  --blue-team: #0397ab;
  --blue-team-bg: rgba(3, 151, 171, 0.15);
  --blue-team-border: rgba(3, 151, 171, 0.6);
  --red-team: #e84057;
  --red-team-bg: rgba(232, 64, 87, 0.15);
  --red-team-border: rgba(232, 64, 87, 0.6);
  --text-primary: #f0e6d2;
  --text-secondary: #a09b8c;
  --text-dim: #5b5a56;
  --border-color: #1e2328;
  --border-gold: #463714;
  --hover-bg: rgba(200, 155, 60, 0.1);
  --ban-color: #ff4444;
  --pick-color: #00cc66;
  --smart-pick-color: #7b2fff;
  --font-main: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo h1 {
  font-size: 1.2rem;
  color: var(--gold-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gold-primary);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switcher {
  display: flex;
  gap: 4px;
}

.lang-btn {
  padding: 4px 10px;
  border: 1px solid var(--border-gold);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
  text-transform: uppercase;
}

.lang-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.lang-btn.active {
  background: var(--gold-primary);
  color: var(--bg-primary);
  border-color: var(--gold-primary);
  font-weight: 600;
}

.btn-reset {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--red-team);
  color: var(--red-team);
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-reset:hover {
  background: var(--red-team);
  color: white;
}

/* Main Layout */
.main-container {
  display: flex;
  flex: 1;
  gap: 0;
  padding: 0;
  max-height: calc(100vh - 57px);
}

/* Team Panels */
.team-panel {
  width: 220px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 8px;
}

.team-panel.blue {
  background: var(--blue-team-bg);
  border-right: 1px solid var(--blue-team-border);
}

.team-panel.red {
  background: var(--red-team-bg);
  border-left: 1px solid var(--red-team-border);
}

.team-header {
  text-align: center;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.team-panel.blue .team-header {
  color: var(--blue-team);
}

.team-panel.red .team-header {
  color: var(--red-team);
}

/* Ban Slots */
.ban-section {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ban-slot {
  width: 36px;
  height: 36px;
  border: 1px solid var(--ban-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  background: rgba(255, 68, 68, 0.1);
}

.ban-slot:hover {
  border-color: #ff6666;
  transform: scale(1.05);
}

.ban-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(50%) brightness(0.7);
}

.ban-slot.filled::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,0,0,0.4) 40%, rgba(255,0,0,0.4) 60%, transparent 60%);
}

.ban-slot.active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
  animation: pulse-ban 1.5s infinite;
}

/* Pick Slots */
.pick-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.pick-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  min-height: 52px;
  background: rgba(0,0,0,0.3);
}

.team-panel.blue .pick-slot {
  border-color: rgba(3, 151, 171, 0.3);
}

.team-panel.red .pick-slot {
  border-color: rgba(232, 64, 87, 0.3);
}

.pick-slot:hover {
  background: var(--hover-bg);
  border-color: var(--gold-primary);
}

.pick-slot.active {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(200, 155, 60, 0.4);
  animation: pulse-pick 1.5s infinite;
}

.pick-slot.filled {
  border-color: var(--gold-dark);
}

.pick-slot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border-gold);
}

.pick-slot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pick-slot-info {
  flex: 1;
  min-width: 0;
}

.pick-slot-position {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pick-slot-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pick-slot-empty {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.75rem;
}

.pick-slot-actions {
  display: flex;
  gap: 4px;
}

.btn-slot-action {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-smart {
  background: var(--smart-pick-color);
  color: white;
}

.btn-smart:hover {
  background: #9b4fff;
}

.btn-clear {
  background: rgba(255,255,255,0.1);
  color: var(--text-secondary);
}

.btn-clear:hover {
  background: var(--red-team);
  color: white;
}

/* Center Panel - Champion Grid */
.center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

/* Position Filter */
.filter-bar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 5px 14px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
  border-radius: 3px;
  text-transform: uppercase;
}

.filter-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.filter-btn.active {
  background: var(--gold-primary);
  color: var(--bg-primary);
  border-color: var(--gold-primary);
  font-weight: 600;
}

.search-box {
  margin-left: auto;
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  background: rgba(0,0,0,0.3);
  color: var(--text-primary);
  font-size: 0.8rem;
  border-radius: 3px;
  width: 180px;
  transition: var(--transition);
}

.search-box:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.search-box::placeholder {
  color: var(--text-dim);
}

/* Champion Grid */
.champion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 4px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.champion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.champion-card:hover {
  border-color: var(--gold-primary);
  background: var(--hover-bg);
  transform: translateY(-2px);
}

.champion-card.disabled {
  opacity: 0.3;
  pointer-events: none;
  filter: grayscale(100%);
}

.champion-card.selected-blue {
  border-color: var(--blue-team);
  background: var(--blue-team-bg);
}

.champion-card.selected-red {
  border-color: var(--red-team);
  background: var(--red-team-bg);
}

.champion-card.banned {
  opacity: 0.25;
  pointer-events: none;
}

.champion-card.banned::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 18px;
  background: linear-gradient(135deg, transparent 42%, rgba(255,0,0,0.6) 42%, rgba(255,0,0,0.6) 58%, transparent 58%);
  border-radius: 50%;
}

.champion-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-gold);
  transition: var(--transition);
}

.champion-card:hover .champion-avatar {
  border-color: var(--gold-primary);
}

.champion-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.champion-name {
  font-size: 0.6rem;
  text-align: center;
  margin-top: 3px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* Smart Pick Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--gold-primary);
  border-radius: 8px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-title {
  font-size: 1.2rem;
  color: var(--gold-primary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.recommendation-card {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.rec-champion {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.rec-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold-primary);
}

.rec-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-info h3 {
  font-size: 1rem;
  color: var(--text-primary);
}

.rec-info .rec-position {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.rec-scores {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.score-label {
  color: var(--text-secondary);
}

.score-value {
  color: var(--gold-primary);
  font-weight: 600;
}

.score-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  margin: 0 12px;
  border-radius: 2px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: var(--gold-primary);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.score-total {
  border-top: 1px solid var(--border-gold);
  padding-top: 8px;
  margin-top: 8px;
  font-weight: 700;
  color: var(--gold-light);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-modal {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

.btn-confirm {
  background: var(--gold-primary);
  color: var(--bg-primary);
}

.btn-confirm:hover {
  background: var(--gold-light);
}

.btn-reroll {
  background: var(--smart-pick-color);
  color: white;
}

.btn-reroll:hover {
  background: #9b4fff;
}

.btn-cancel-modal {
  background: transparent;
  border: 1px solid var(--text-dim);
  color: var(--text-secondary);
}

.btn-cancel-modal:hover {
  border-color: var(--red-team);
  color: var(--red-team);
}

/* Footer */
.footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-gold);
  background: var(--bg-secondary);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--gold-primary);
}

.footer-disclaimer {
  font-size: 0.65rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.4;
}

.footer-contact {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Animations */
@keyframes pulse-ban {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 68, 68, 0.4); }
  50% { box-shadow: 0 0 16px rgba(255, 68, 68, 0.8); }
}

@keyframes pulse-pick {
  0%, 100% { box-shadow: 0 0 8px rgba(200, 155, 60, 0.3); }
  50% { box-shadow: 0 0 16px rgba(200, 155, 60, 0.7); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-gold);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* Responsive */
@media (max-width: 1024px) {
  .team-panel {
    width: 180px;
    min-width: 180px;
  }
  
  .champion-grid {
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  }
}

@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
    max-height: none;
  }
  
  .team-panel {
    width: 100%;
    min-width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .team-panel.blue {
    border-right: none;
    border-bottom: 1px solid var(--blue-team-border);
  }
  
  .team-panel.red {
    border-left: none;
    border-top: 1px solid var(--red-team-border);
  }
  
  .pick-section {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .pick-slot {
    width: auto;
    min-width: 140px;
  }
  
  .center-panel {
    border: none;
    min-height: 50vh;
  }
  
  .champion-grid {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  }
  
  .header {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* Tier badge */
.tier-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.5rem;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 700;
}

.tier-T0 { background: #ff4444; color: white; }
.tier-T1 { background: #ff8c00; color: white; }
.tier-T2 { background: #4a90d9; color: white; }
.tier-T3 { background: #666; color: #ccc; }

/* Position icons in pick slots */
.position-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
