/* Music Stats Page Styles */

.home-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(183, 148, 246, 0.15);
  border: 1px solid rgba(183, 148, 246, 0.3);
  border-radius: 8px;
  color: #b794f6;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  font-size: 0.95rem;
  z-index: 100;
}

.home-btn:hover {
  background: rgba(183, 148, 246, 0.25);
  border-color: #b794f6;
  transform: translateY(-2px);
}

.music-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 80px 2rem 2rem;
  min-height: 100vh;
}

.music-header {
  text-align: center;
  margin-bottom: 60px;
}

.music-header h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.music-header h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #b794f6, transparent);
}

.title-underline {
  display: none;
}

.subtitle {
  font-size: 1.2rem;
  color: #aaa;
  margin-bottom: 20px;
}

.sync-button {
  background: linear-gradient(135deg, #7c3aed, #b794f6);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.sync-button:hover {
  background: linear-gradient(135deg, #8b5cf6, #c4b5fd);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.sync-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Stats Container */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: rgba(30, 30, 46, 0.5);
  border-radius: 15px;
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  background: rgba(30, 30, 46, 0.7);
  border-color: rgba(139, 92, 246, 0.4);
}

.stat-icon {
  font-size: 2.5rem;
  color: #b794f6;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(183, 148, 246, 0.15);
  border-radius: 12px;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #b794f6;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Period Selector */
.period-selector {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.period-btn {
  background: rgba(30, 30, 46, 0.5);
  color: #aaa;
  border: 1px solid rgba(139, 92, 246, 0.2);
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.period-btn:hover {
  background: rgba(30, 30, 46, 0.7);
  color: #fff;
  border-color: rgba(139, 92, 246, 0.4);
}

.period-btn.active {
  background: linear-gradient(135deg, #7c3aed, #b794f6);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* Period Stats */
.period-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.period-stat-card {
  background: rgba(30, 30, 46, 0.5);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  border: 1px solid rgba(139, 92, 246, 0.2);
  transition: all 0.3s ease;
}

.period-stat-card:hover {
  background: rgba(30, 30, 46, 0.7);
  border-color: rgba(139, 92, 246, 0.4);
}

.period-stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #b794f6;
  margin-bottom: 8px;
}

.period-stat-label {
  font-size: 0.9rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Top Tracks Section */
.top-tracks-section {
  margin-top: 40px;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 25px;
  text-align: center;
}

.tracks-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.track-card {
  background: rgba(30, 30, 46, 0.5);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  transition: all 0.3s ease;
}

.track-card:hover {
  background: rgba(30, 30, 46, 0.7);
  transform: translateX(5px);
  border-color: rgba(139, 92, 246, 0.4);
}

.track-rank {
  font-size: 1.5rem;
  font-weight: 700;
  color: #b794f6;
  min-width: 40px;
  text-align: center;
}

.track-album-art {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.track-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.track-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 0.95rem;
  color: #b794f6;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-album {
  font-size: 0.85rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  min-width: 120px;
}

.track-plays,
.track-time {
  font-size: 0.9rem;
  color: #aaa;
}

.track-plays i,
.track-time i {
  color: #b794f6;
  margin-right: 5px;
}

/* Loading and Error States */
.loading-spinner,
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #aaa;
}

.loading-spinner i {
  font-size: 3rem;
  margin-bottom: 20px;
  color: #b794f6;
}

.error-message {
  color: #ff6b6b;
}

.error-message i {
  font-size: 3rem;
  margin-bottom: 20px;
}

.no-data {
  text-align: center;
  color: #aaa;
  padding: 40px;
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .music-main {
    padding: 70px 1rem 2rem;
  }

  .home-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .music-header {
    margin-bottom: 40px;
  }

  .music-header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .sync-button {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

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

  .stat-card {
    padding: 20px;
  }

  .stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .period-selector {
    gap: 10px;
  }

  .period-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .period-stats {
    gap: 15px;
  }

  .period-stat-card {
    padding: 20px;
  }

  .period-stat-value {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .track-card {
    padding: 12px;
    gap: 12px;
  }

  .track-rank {
    font-size: 1.2rem;
    min-width: 35px;
  }

  .track-album-art {
    width: 55px;
    height: 55px;
  }

  .track-name {
    font-size: 1rem;
  }

  .track-artist {
    font-size: 0.85rem;
  }

  .track-album {
    font-size: 0.75rem;
  }

  .track-stats {
    min-width: 100px;
    gap: 6px;
  }

  .track-plays,
  .track-time {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .music-main {
    padding: 60px 0.75rem 1.5rem;
  }

  .home-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    gap: 0.3rem;
  }

  .music-header {
    margin-bottom: 30px;
  }

  .music-header h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 0.9rem;
    padding: 0 10px;
  }

  .sync-button {
    padding: 8px 20px;
    font-size: 0.85rem;
  }

  .stats-container {
    gap: 12px;
  }

  .stat-card {
    padding: 15px;
    gap: 15px;
  }

  .stat-icon {
    font-size: 1.75rem;
    width: 45px;
    height: 45px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .period-selector {
    gap: 8px;
  }

  .period-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .period-stats {
    gap: 12px;
  }

  .period-stat-card {
    padding: 15px;
  }

  .period-stat-value {
    font-size: 1.75rem;
  }

  .period-stat-label {
    font-size: 0.8rem;
  }

  .section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }

  .track-card {
    padding: 10px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .track-rank {
    font-size: 1rem;
    min-width: 30px;
  }

  .track-album-art {
    width: 50px;
    height: 50px;
  }

  .track-info {
    flex: 1;
    min-width: calc(100% - 100px);
  }

  .track-name {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }

  .track-artist {
    font-size: 0.8rem;
    margin-bottom: 2px;
  }

  .track-album {
    font-size: 0.7rem;
  }

  .track-stats {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    text-align: center;
    min-width: auto;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
  }

  .track-plays,
  .track-time {
    font-size: 0.75rem;
  }
}
