/* Star Wars Character Battle Styles */

/* CSS Variables for Star Wars Theme */
:root {
  --sw-yellow: #FFE81F;
  --sw-black: #000000;
  --sw-blue: #0066CC;
  --sw-red: #FF0000;
  --sw-gray: #333333;
  --sw-light-gray: #666666;
  --sw-background: #0a0a0a;
  --sw-card-background: #1a1a1a;
  --sw-border: #333333;
  --sw-text-light: #ffffff;
  --sw-text-muted: #cccccc;
  --sw-gradient: linear-gradient(135deg, #FFE81F 0%, #FF6B00 100%);
  --sw-shadow: 0 4px 20px rgba(255, 232, 31, 0.3);
  --sw-hover-shadow: 0 8px 30px rgba(255, 232, 31, 0.5);
}

/* Base Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--sw-background);
  color: var(--sw-text-light);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255, 232, 31, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 102, 204, 0.1) 0%, transparent 50%);
}

/* Layout Containers */
.battle-container,
.results-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* Header Styles */
.battle-header,
.results-header {
  text-align: center;
  margin-bottom: 40px;
}

.battle-title,
.results-title {
  font-size: 3rem;
  font-weight: bold;
  color: var(--sw-yellow);
  text-shadow: 0 0 20px rgba(255, 232, 31, 0.8);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.battle-instruction {
  font-size: 1.2rem;
  color: var(--sw-text-muted);
  margin-bottom: 30px;
}

/* Footer Styles */
.battle-footer {
  text-align: center;
  margin-top: 40px;
  padding: 30px 0;
  border-top: 1px solid var(--sw-border);
}

/* Vote Counter */
.vote-counter {
  margin-bottom: 20px;
}

.vote-count {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--sw-yellow);
  display: block;
  margin-bottom: 10px;
}

.progress-bar {
  width: 300px;
  height: 8px;
  background: var(--sw-gray);
  border-radius: 4px;
  margin: 0 auto;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-fill {
  height: 100%;
  background: var(--sw-gradient);
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(255, 232, 31, 0.6);
}

/* Character Battle Layout */
.characters-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  align-items: center;
  margin-top: 40px;
}

.character-card {
  background: var(--sw-card-background);
  border: 2px solid var(--sw-border);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sw-shadow);
}

.character-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--sw-hover-shadow);
  border-color: var(--sw-yellow);
}

.character-card.vote-selected {
  border-color: var(--sw-yellow);
  box-shadow: 0 0 30px rgba(255, 232, 31, 0.8);
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Character Images */
.character-image-container {
  width: 250px;
  height: 350px;
  margin: 0 auto 20px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sw-gray);
  position: relative;
}

.character-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
  opacity: 1; /* Make images visible by default */
}

.character-image.loading {
  opacity: 0.7;
}

.character-image.loaded {
  opacity: 1;
}

.character-image.error {
  opacity: 0.8;
}

/* Character Info */
.character-name {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--sw-yellow);
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 232, 31, 0.5);
}

.character-details {
  margin-bottom: 25px;
}

.character-details p {
  margin: 8px 0;
  font-size: 1rem;
  color: var(--sw-text-muted);
}

.character-details strong {
  color: var(--sw-text-light);
}

/* VS Divider */
.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
}

.vs-text {
  font-size: 4rem;
  font-weight: bold;
  color: var(--sw-yellow);
  text-shadow: 0 0 20px rgba(255, 232, 31, 0.8);
  transform: rotate(-15deg);
}

/* Vote Buttons */
.vote-button {
  background: var(--sw-gradient);
  color: var(--sw-black);
  border: none;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(255, 232, 31, 0.3);
  position: relative;
  overflow: hidden;
}

.vote-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 232, 31, 0.5);
}

.vote-button:active {
  transform: translateY(0);
}

.vote-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Loading States */
.loading-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--sw-text-muted);
  font-size: 1.2rem;
}

.characters-container.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Results Page Styles */
.winner-section {
  text-align: center;
  margin: 40px 0;
  padding: 40px;
  background: var(--sw-card-background);
  border-radius: 15px;
  border: 2px solid var(--sw-yellow);
  box-shadow: var(--sw-shadow);
}

.winner-title {
  font-size: 2.5rem;
  color: var(--sw-yellow);
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(255, 232, 31, 0.8);
}

.winner-card {
  background: var(--sw-gradient);
  color: var(--sw-black);
  padding: 30px;
  border-radius: 15px;
  margin: 20px auto;
  max-width: 400px;
  box-shadow: 0 8px 25px rgba(255, 232, 31, 0.4);
}

.winner-name {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.winner-score {
  font-size: 1.3rem;
  font-weight: bold;
}

/* Tie Winner Styles */
.tie-explanation {
  text-align: center;
  margin-bottom: 30px;
}

.tie-explanation p {
  font-size: 1.2rem;
  color: var(--sw-text-muted);
  margin: 0;
}

.winners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.tie-winner {
  background: linear-gradient(135deg, var(--sw-card-background) 0%, rgba(255, 232, 31, 0.1) 100%);
  border: 2px solid var(--sw-yellow);
  box-shadow: 0 0 20px rgba(255, 232, 31, 0.4);
}

.tie-winner:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 232, 31, 0.6);
}

.tie-winner .winner-name {
  color: var(--sw-yellow);
  text-shadow: 0 0 10px rgba(255, 232, 31, 0.6);
}

/* Statistics Section */
.statistics-section,
.history-section {
  margin: 40px 0;
  padding: 30px;
  background: var(--sw-card-background);
  border-radius: 15px;
  border: 1px solid var(--sw-border);
}

.statistics-section h3,
.history-section h3 {
  color: var(--sw-yellow);
  font-size: 1.8rem;
  margin-bottom: 20px;
  text-align: center;
}

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

.stat-item {
  background: var(--sw-gray);
  padding: 15px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-name {
  font-weight: bold;
  color: var(--sw-text-light);
}

.stat-wins {
  color: var(--sw-yellow);
  font-weight: bold;
}

/* History Section */
.history-list {
  space-y: 10px;
}

.history-item {
  background: var(--sw-gray);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.battle-number {
  font-weight: bold;
  color: var(--sw-yellow);
  min-width: 100px;
}

.battle-result {
  flex: 1;
  text-align: center;
}

.winner-name {
  color: var(--sw-yellow);
  font-weight: bold;
}

.vs-text {
  color: var(--sw-text-muted);
  margin: 0 10px;
}

.loser-name {
  color: var(--sw-text-muted);
}

/* Action Buttons */
.actions-section {
  text-align: center;
  margin: 40px 0;
}

.play-again-button {
  background: var(--sw-gradient);
  color: var(--sw-black);
  border: none;
  padding: 20px 40px;
  font-size: 1.3rem;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 6px 20px rgba(255, 232, 31, 0.4);
  margin-bottom: 30px;
}

.play-again-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 232, 31, 0.6);
}

/* Share Section */
.share-section {
  margin-top: 30px;
}

.share-text {
  color: var(--sw-text-muted);
  margin-bottom: 15px;
}

.share-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.share-button {
  background: var(--sw-card-background);
  color: var(--sw-text-light);
  border: 2px solid var(--sw-border);
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-button:hover {
  border-color: var(--sw-yellow);
  color: var(--sw-yellow);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .battle-title,
  .results-title {
    font-size: 2rem;
  }

  .characters-container {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  .vs-divider {
    height: 60px;
  }

  .vs-text {
    font-size: 2.5rem;
  }

  .character-image-container {
    width: 200px;
    height: 280px;
  }

  .character-card {
    padding: 20px;
  }

  .vote-button {
    padding: 12px 25px;
    font-size: 1rem;
  }

  .progress-bar {
    width: 250px;
  }

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

  .winners-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .history-item {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .battle-number {
    min-width: auto;
  }

  .share-buttons {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .battle-container,
  .results-container {
    padding: 15px;
  }

  .character-image-container {
    width: 150px;
    height: 210px;
  }

  .character-name {
    font-size: 1.5rem;
  }

  .winner-card {
    padding: 20px;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in {
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Turbo Frame Loading */
turbo-frame[busy] {
  opacity: 0.7;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
