:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gold-gradient: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
  --dark-blue: #1a1d29;
  --soft-white: #f8f9fa;
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --accent-blue: #4a90e2;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
  --border-radius: 15px;
}

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

body {
  font-family: "Open Sans", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Header Section */
.hero-section {
  text-align: center;
  padding: 80px 20px;
  background: linear-gradient(135deg,
      rgba(26, 29, 41, 0.9) 0%,
      rgba(44, 62, 80, 0.9) 100%);
  position: relative;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="%23ffffff" opacity="0.1"><polygon points="0,0 1000,100 1000,0"/></svg>');
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

h1 {
  font-family: "Montserrat", sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 20px;
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.subtitle {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
  margin-bottom: 30px;
}

.last-updated {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 15px 25px;
  border-radius: 50px;
  display: inline-block;
  color: white;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.date-highlight {
  color: #ffd700;
  font-weight: 600;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: -50px auto 0;
  position: relative;
  z-index: 3;
  padding: 0 20px;
}

/* Ranking Table */
.ranking-section {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 60px;
  overflow: hidden;
}

.section-header {
  background: var(--primary-gradient);
  color: white;
  text-align: center;
  padding: 40px 30px;
}

.section-header h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.table-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.table-header th {
  padding: 25px 20px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 3px solid var(--accent-blue);
}

.ranking-table tbody tr {
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ranking-table tbody tr:hover {
  background: linear-gradient(135deg, #f8f9ff 0%, #fff5f5 100%);
  transform: translateX(5px);
}

.ranking-table td {
  padding: 20px;
  text-align: center;
  font-weight: 500;
  vertical-align: middle;
}

/* Champion Row */
.champion-row {
  background: linear-gradient(135deg, #fff9e6 0%, #ffe6cc 100%);
  border-left: 5px solid gold;
  position: relative;
}

.champion-row td {
  font-weight: 700;
  color: #b8860b;
}

.position-cell {
  font-family: "Montserrat", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.champion-position {
  background: var(--gold-gradient);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.flag-img {
  width: 35px;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.flag-img:hover {
  transform: scale(1.1);
}

.player-name {
  font-family: "Montserrat", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.stats-cell {
  font-family: "Montserrat", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-blue);
}

/* Books Section */
.books-section {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 60px;
}

.books-header {
  background: var(--secondary-gradient);
  color: white;
  text-align: center;
  padding: 30px;
}

.books-header h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 40px;
}

.book-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.book-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.book-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(102, 126, 234, 0.1) 0%,
      rgba(118, 75, 162, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.book-image {
  width: 100%;
  height: 350px;
  object-fit: contain;
  background: #f8f9fa;
  transition: transform 0.3s ease;
}

.book-card:hover .book-image {
  transform: scale(1.05);
}

.book-info {
  padding: 20px;
  position: relative;
  z-index: 2;
}

.book-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 70%;
  max-height: 80%;
  border-radius: var(--border-radius);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--border-radius);
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #ffd700;
}

/* Footer */
.footer {
  background: var(--dark-blue);
  color: white;
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.footer h4 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #ffd700;
}

.footer p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
  opacity: 0.9;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #ffd700;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Loading Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for accessibility */
.book-card:focus,
.close-modal:focus {
  outline: 3px solid #ffd700;
  outline-offset: 2px;
}

/* Scroll Animations - REMOVED for mobile stability */
/* .scroll-reveal { opacity: 0; } - Removed to prevent invisible content */

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1.1rem;
  }

  .section-header h2 {
    font-size: 1.8rem;
    padding: 0 10px;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 30px 15px;
  }

  /* New Mobile Fixes */
  .hero-section {
    padding: 60px 15px;
  }

  .container {
    padding: 0 10px;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ranking-table {
    min-width: 600px;
    font-size: 0.85rem;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 12px 8px;
    white-space: nowrap;
  }

  .flag-img {
    width: 25px;
  }

  .champion-position {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 15px;
  }

  .modal-content {
    max-width: 95%;
    max-height: 90%;
  }
}

/* Mobile specific overrides (max-width: 480px) - Must be outside the 768px block */
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .books-grid {
    grid-template-columns: 1fr;
    padding: 20px 10px;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 10px 5px;
    font-size: 0.8rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .hero-section {
    padding: 60px 15px;
  }

  .container {
    padding: 0 10px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-gradient: #000000;
    --secondary-gradient: #000000;
    --text-primary: #000000;
    --text-secondary: #444444;
  }
}

/* Print styles */
@media print {

  .modal,
  .close-modal,
  .footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .hero-section {
    background: white;
    color: black;
  }
}

/* Article/Content styles for new pages */
.content-section {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 40px;
  padding: 40px;
}

.content-section h2 {
    font-family: "Montserrat", sans-serif;
    color: var(--dark-blue);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-blue);
}

.content-section h3 {
    font-family: "Montserrat", sans-serif;
    color: var(--dark-blue);
    margin: 25px 0 15px;
}

.content-section p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.content-section ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.content-section li {
    margin-bottom: 10px;
    line-height: 1.6;
}
