/* General Styles */
:root {
  --primary: #ff4655;
  --primary-dark: #e03a48;
  --dark: #0f1923;
  --dark-light: #1a242f;
  --gray: #303b45;
  --light: #ece8e1;
  --light-gray: #8b9aaa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--dark);
  color: var(--light);
  line-height: 1.6;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1, h2, h3, h4 {
  color: var(--primary);
  font-weight: 700;
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: var(--light-gray);
}

/* Form Styles */
.search-form {
  background-color: var(--dark-light);
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  margin: 0 auto 30px;
  max-width: 600px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--light);
}

.form-group input,
.form-group select {
  padding: 12px;
  border: 2px solid var(--gray);
  border-radius: 4px;
  background-color: var(--gray);
  color: var(--light);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 70, 85, 0.3);
}

#submit {
  grid-column: span 2;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#submit:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 70, 85, 0.3);
}

#submit:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Loading Indicator */
.loading-container {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  margin: 20px 0;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--gray);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

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

/* Stats Container */
.stats-container {
  background-color: var(--dark-light);
  padding: 25px;
  border-radius: 8px;
  margin: 20px auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: none;
}

.stats-container h2 {
  text-align: left;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.stats-container p {
  margin: 12px 0;
  font-size: 1.1rem;
}

/* Games Section */
.section-header {
  background-color: var(--dark-light);
  padding: 15px 25px;
  border-radius: 8px;
  margin: 30px 0 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header:hover {
  background-color: var(--gray);
}

.section-header h3 {
  margin: 0;
  text-align: left;
}

.toggle-icon {
  font-size: 1.5rem;
  font-weight: bold;
}

.games-container {
  display: none;
  flex-direction: column;
  gap: 20px;
}

/* Game Card */
.game-card {
  background-color: var(--dark-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.game-header {
  padding: 15px 25px;
  background-color: var(--gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.game-header h4 {
  margin: 0;
  color: var(--light);
}

.game-header .game-meta {
  display: flex;
  gap: 15px;
  color: var(--light-gray);
  font-size: 0.9rem;
}

.game-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.game-content.expanded {
  padding: 20px;
  max-height: 5000px;
}

.game-map {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.game-map img {
  width: 150px;
  height: auto;
  border-radius: 4px;
}

.game-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.game-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.team {
  background-color: var(--gray);
  border-radius: 8px;
  padding: 15px;
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.team-blue .team-header {
  color: #5e9eff;
}

.team-red .team-header {
  color: #ff5e5e;
}

.player-card {
  background-color: var(--dark);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-info {
  flex-grow: 1;
}

.player-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.player-stats {
  font-size: 0.9rem;
  color: var(--light-gray);
}

.agent-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.rounds-section {
  margin-top: 30px;
}

.round-accordion {
  margin-bottom: 15px;
}

.round-header {
  background-color: var(--gray);
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.round-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.round-content.expanded {
  padding: 15px;
  max-height: 5000px;
}

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

.stat-card {
  background-color: var(--dark);
  border-radius: 6px;
  padding: 12px;
}

.kill-event {
  background-color: var(--gray);
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
}

.weapon-image {
  width: 60px;
  height: auto;
  margin-top: 10px;
}

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

  #submit {
    grid-column: span 1;
  }

  .game-details,
  .game-teams {
    grid-template-columns: 1fr;
  }

  .game-map {
    flex-direction: column;
    align-items: flex-start;
  }
}