/* Main styles */
:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --background-color: #06cf82;
  --card-background: #bfac3d;
  --text-color: #333333;
  --accent-color: #913903;
  --header-color: #913903;
}

/* Override Bootstrap styles with higher specificity */
html body {
  font-family: 'Roboto', Arial, sans-serif !important;
  background-color: var(--background-color) !important;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  color: var(--text-color);
}

.container {
  background-color: var(--background-color) !important;
}

h1 {
  color: var(--secondary-color);
  text-align: center;
  margin-bottom: 30px;
  font-weight: 700;
}

/* Main layout */
.results-layout {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.sidebar {
  flex: 0 0 280px;
  max-width: 280px;
  padding-bottom: 20px;
}

.main-content {
  flex: 1;
}

/* Search and filter controls */
.controls-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 15px;
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
}

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

.search-box input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.filter-group {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  width: 100%;
}

.filter-label {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--secondary-color);
  font-size: 0.95em;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

.filter-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 4px;
  padding: 5px 8px;
}

.filter-item:hover {
  background-color: rgba(0,0,0,0.05);
}

/* Sorting controls */
.sort-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.sort-select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  font-size: 0.9em;
  color: var(--secondary-color);
  cursor: pointer;
  height: 36px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Age filter styles */
.age-filter-container {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.age-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.age-input-container label {
  font-size: 0.9em;
  color: var(--secondary-color);
  font-weight: 500;
  min-width: 35px;
}

.age-input-container input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9em;
}

.filter-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-item label {
  cursor: pointer;
  font-size: 0.9em;
  flex: 1;
  margin: 0;
  user-select: none;
}

/* Landing page styles */
.landing-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  text-align: center;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

/* Filter flow styles */
.filter-flow-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

/* Scrollbar styling for filter items */
.filter-items::-webkit-scrollbar {
  width: 6px;
}

.filter-items::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.filter-items::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.filter-items::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Player cards */
.players-container {
  display: flex;
  flex-wrap: wrap;
  margin: -10px;
  padding-bottom: 50px;
}

.card-column {
  flex: 0 0 50%;
  max-width: 50%;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  justify-content: center; /* Center card in column */
}

.player-card {
  width: 300px;
  height: 520px;
  perspective: 1000px;
  position: relative;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  transform: rotateY(0deg);
  
  /* Move visual card styles here */
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  border: 2px solid var(--secondary-color);
  background-color: var(--card-background);
}

.player-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  backface-visibility: hidden;
}
.card-front,
.card-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 15px;
  box-sizing: border-box;
  overflow: hidden;
}
.card-front {
  z-index: 2;
}
.card-back {
  z-index: 1;
}

.card-back {
  transform: rotateY(180deg);
}


.player-card:hover .card-inner {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.player-card.flipping {
  pointer-events: none; /* Disable clicks during animation */
}

/* Card back content styling */
.card-back-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 8px 0;
}

.card-back-header {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 15px;
  text-align: center;
}

.back-section {
  width: 100%;
  margin-bottom: 10px;
  text-align: left;
}

.back-section-title {
  font-weight: bold;
  color: var(--header-color);
  font-size: 0.8em;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.back-section-content {
  font-size: 0.85em;
  line-height: 1.3;
  color: var(--text-color);
}

.back-stats {
  margin-top: auto;
}

.back-stats-grid {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  margin-top: 8px;
}

.back-stat {
  text-align: center;
  flex: 1;
}

.back-stat-value {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--primary-color);
}

.back-stat-label {
  font-size: 0.8em;
  color: var(--text-color);
  margin-top: 2px;
}

/* Notable matches styling */
.notable-match {
  margin-bottom: 8px;
  padding: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  border-left: 3px solid var(--header-color);
}

.notable-match:last-child {
  margin-bottom: 0;
}

.notable-match strong {
  color: var(--header-color);
  font-size: 0.85em;
}

.notable-match em {
  color: var(--text-color);
  font-size: 0.8em;
  font-style: italic;
}

/* Video highlights styling */
.video-highlight {
  margin-bottom: 4px;
}

.video-highlight:last-child {
  margin-bottom: 0;
}

.video-highlight a {
  color: var(--header-color);
  text-decoration: none;
  font-size: 0.85em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.video-highlight a:hover {
  text-decoration: underline;
  color: var(--accent-color);
}

.video-highlight a::before {
  content: "▶";
  font-size: 0.8em;
}

/* News mentions styling */
.news-mention {
  margin-bottom: 4px;
}

.news-mention:last-child {
  margin-bottom: 0;
}

.news-mention a {
  color: var(--header-color);
  text-decoration: none;
  font-size: 0.85em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.news-mention a:hover {
  text-decoration: underline;
  color: var(--accent-color);
}

.news-mention a::before {
  content: "";
  font-size: 0.8em;
}

/* Player image styles */
.player-image-container {
  width: 100%;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 10px;
}

.player-image {
  width: 150px;
  height: 150px;
  border-radius: 8px; /* Slightly rounded corners instead of circle */
  object-fit: cover;
  border: 3px solid var(--secondary-color);
}

.player-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--secondary-color);
  width: 100%;
  text-align: center;
}

.player-name-link {
  color: var(--secondary-color);
  text-decoration: none;
  position: relative;
  transition: color 0.2s;
}

.player-name-link:hover {
  color: #1a252f;
}

.player-name-link::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--secondary-color);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s;
}

.player-name-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Key info container - for the most important player details */
.key-info-container {
  width: 100%;
  font-size: 1rem;
  text-align: left;
  padding: 10px 15px;
  margin: 10px 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.key-info {
  margin-bottom: 6px;
  color: var(--secondary-color);
  font-weight: 500;
}

.key-info-label {
  font-weight: 700;
  margin-right: 5px;
}

/* Player stats section */
.player-stats {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin: 10px 0;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.stat {
  flex: 1;
  text-align: center;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--secondary-color);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--secondary-color);
  opacity: 0.8;
}

/* Player info container - for additional details */
.player-info-container {
  width: 100%;
  font-size: 0.85rem;
  text-align: left;
  padding: 0 10px;
  overflow-y: auto;
  max-height: 80px; /* Reduced height since we now have key info section */
  opacity: 0.8; /* Make it slightly less prominent */
  margin-bottom: 10px;
}

.player-info {
  margin-bottom: 5px;
  color: var(--secondary-color);
}

.player-info-label {
  font-weight: 600;
}

/* Responsive design */
@media (max-width: 992px) {
  .card-column {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 768px) {
  .card-column {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .controls-container {
    flex-direction: column;
  }
  
  .search-box {
    margin-right: 0;
    margin-bottom: 15px;
  }
}

/* Loading and error states */
.loading {
  text-align: center;
  padding: 40px;
  font-size: 1.2rem;
  color: #777;
}

.error {
  background-color: #06cf82;
  color: var(--accent-color);
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: center;
}

/* Status container */
.status-container {
  text-align: center;
  padding: 10px 15px;
  margin: 20px auto;
  background-color: var(--card-background);
  border-radius: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 10px;
  z-index: 100;
  max-width: 300px;
  font-weight: 500;
  color: var(--secondary-color);
}

/* Loading trigger for infinite scroll */
.loading-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  margin: 20px auto;
  background-color: var(--card-background);
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  gap: 10px;
  max-width: 300px;
  color: var(--secondary-color);
}

/* Spinner animation */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(44, 62, 80, 0.3);
  border-radius: 50%;
  border-top-color: var(--secondary-color);
  animation: spin 1s linear infinite;
}

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

/* No results message */
.no-results {
  text-align: center;
  padding: 30px;
  margin: 20px auto;
  background-color: var(--card-background);
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 500px;
  color: var(--secondary-color);
  font-size: 1.1rem;
}

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: var(--card-background);
  color: var(--secondary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
  border: 2px solid var(--secondary-color);
}

.scroll-to-top.visible {
  opacity: 1;
}

.scroll-to-top:hover {
  background-color: rgba(191, 172, 61, 0.8);
}
