/* ===========================
   CSS Reset & Base Typography
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #e0e0e0;
  background-color: #121212;
  min-width: 320px;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #ffffff;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #bb86fc;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #e0b0ff;
}

address {
  font-style: normal;
  color: #aaaaaa;
}

ul {
  list-style: none;
}

/* ===========================
   Focus Styles for Keyboard Users
   =========================== */
:focus-visible {
  outline: 2px solid #bb86fc;
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid #bb86fc;
  outline-offset: 2px;
  border-radius: 2px;
}

.hamburger:focus-visible {
  outline: 2px solid #bb86fc;
  outline-offset: 4px;
  border-radius: 4px;
}

.playlist-link:focus-visible {
  outline: 2px solid #bb86fc;
  outline-offset: 2px;
}

/* ===========================
   Sticky Navigation
   =========================== */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #1a1a2e;
  border-bottom: 1px solid #2a2a4a;
  padding: 0 1rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-logo:hover {
  color: #bb86fc;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links li a {
  color: #cccccc;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.nav-links li a:hover {
  color: #bb86fc;
}

/* Hamburger Menu Button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #e0e0e0;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===========================
   Section Layout
   =========================== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* About Section — visually distinct */
.about-section {
  background-color: #1a1a2e;
  max-width: 100%;
  border-bottom: 1px solid #2a2a4a;
}

.about-section > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.about-section h2 {
  color: #bb86fc;
}

.about-section p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #d0d0d0;
  max-width: 720px;
}

.about-section address {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background-color: rgba(187, 134, 252, 0.08);
  border-left: 3px solid #bb86fc;
  border-radius: 0 4px 4px 0;
  display: inline-block;
}

/* ===========================
   Ranking Lists (Charts & Artists)
   =========================== */
#charts-container,
#artists-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background-color: #1e1e30;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.ranking-item:hover {
  background-color: #2a2a4a;
}

.ranking-rank {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  min-width: 2rem;
  text-align: center;
}

.ranking-info {
  flex: 1;
}

.ranking-title {
  font-weight: 600;
  color: #ffffff;
}

.ranking-artist {
  font-size: 0.875rem;
  color: #aaaaaa;
}

/* ===========================
   Movement Indicators
   =========================== */
.movement-up {
  color: #4caf50;
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 1.5rem;
  text-align: center;
}

.movement-down {
  color: #f44336;
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 1.5rem;
  text-align: center;
}

.movement-same {
  color: #b0b0b0;
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 1.5rem;
  text-align: center;
}

/* ===========================
   Playlist Section
   =========================== */
.playlist-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.playlist-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  background-color: #1e1e30;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  color: #e0e0e0;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.playlist-link:hover {
  background-color: #2a2a4a;
  border-color: #bb86fc;
  transform: translateY(-2px);
  color: #ffffff;
}

.spotify-link:hover {
  border-color: #1db954;
}

.youtube-link:hover {
  border-color: #ff0000;
}

.playlist-icon {
  font-size: 1.5rem;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background-color: #1a1a2e;
  border-top: 1px solid #2a2a4a;
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer p {
  color: #aaaaaa;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.site-footer address {
  font-size: 0.85rem;
  color: #a0a0a0;
}

/* ===========================
   Responsive Design
   Breakpoint: 768px
   =========================== */

/* Mobile styles (< 768px) */
@media (max-width: 767px) {
  /* Show hamburger menu */
  .hamburger {
    display: flex;
  }

  /* Hide nav links by default on mobile */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: #1a1a2e;
    border-bottom: 1px solid #2a2a4a;
    padding: 1rem 0;
    gap: 0;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links li a {
    display: block;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
  }

  .nav-links li a:hover {
    background-color: rgba(187, 134, 252, 0.1);
  }

  /* Single-column layout for all sections */
  .section {
    padding: 2rem 1rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  /* Playlist cards stack vertically */
  .playlist-links {
    flex-direction: column;
  }

  .playlist-link {
    width: 100%;
    justify-content: center;
  }

  /* Ranking items compact on mobile */
  .ranking-item {
    padding: 0.6rem 0.75rem;
    gap: 0.75rem;
  }

  .ranking-rank {
    font-size: 1.1rem;
    min-width: 1.75rem;
  }
}

/* Desktop styles (≥ 768px) */
@media (min-width: 768px) {
  /* Hamburger always hidden on desktop */
  .hamburger {
    display: none;
  }

  /* Nav links always visible on desktop */
  .nav-links {
    display: flex;
  }

  /* Multi-column layout for ranking sections */
  #charts-container,
  #artists-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  /* Playlist links side by side */
  .playlist-links {
    flex-direction: row;
  }
}

/* Large screens (≥ 1200px) */
@media (min-width: 1200px) {
  .section {
    padding: 4rem 2rem;
  }

  h2 {
    font-size: 2rem;
  }
}
