/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #1a1b26;
  color: #c0caf5;
  overflow-x: hidden;
}

.min-h-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* PWA Install Button */
.install-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.install-btn {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #c0caf5;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.install-btn:hover {
  background-color: #7aa2f7;
  color: #1a1b26;
  transform: translateY(-2px);
}

.install-btn img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* Logo */
.logo-container {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  width: 100%;
  animation: fadeIn 1s ease-out;
}

.site-logo {
  width: 300px;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  object-fit: cover;
}

.site-logo:hover {
  transform: scale(1.05);
}

/* Player Main Container */
.player-container {
  display: flex;
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  gap: 2rem;
  padding: 2rem;
  width: 100%;
  max-width: 1200px;
  flex-direction: column;
}

.player-section,
.playlist-section {
  flex: 1;
}

/* Player Section Details */
.cover-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.cover-art {
  width: 100%;
  max-width: 400px;
  height: auto;
  aspect-ratio: 1/1;
  border-radius: 0.5rem;
  object-fit: cover;
}

.song-info {
  text-align: center;
  margin-bottom: 1rem;
}

.song-info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
}

.album-info {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 5px;
}

/* Progress Bar */
.time-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
}

#progress {
  width: 0%;
  height: 100%;
  background-color: #7aa2f7;
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* Controls */
.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.controls button {
  background: none;
  border: none;
  color: #c0caf5;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.controls button:hover {
  color: #7aa2f7;
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 20px;
}

#volume {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  outline: none;
}

#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #7aa2f7;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

#volume::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Playlist Section */
.playlist-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}

.playlist-container::-webkit-scrollbar {
  width: 6px;
}

.playlist-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.playlist-container::-webkit-scrollbar-thumb {
  background: #7aa2f7;
  border-radius: 3px;
}

.playlist-container::-webkit-scrollbar-thumb:hover {
  background: #5d7ac0;
}

.playlist-item {
  display: flex;
  align-items: flex-start;
  padding: 10px;
  gap: 1rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
  margin-bottom: 5px;
  border: 1px solid transparent;
}

.playlist-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.playlist-item.active {
  background-color: rgba(122, 162, 247, 0.1);
  border-color: #7aa2f7;
}

.playlist-item img {
  width: 80px;
  height: 80px;
  border-radius: 0.25rem;
  object-fit: cover;
  flex-shrink: 0;
}

.playlist-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-row {
  font-size: 0.85rem;
  display: flex;
  align-items: baseline;
}

.info-row .label {
  font-weight: bold;
  color: #7aa2f7;
  margin-right: 5px;
  width: 60px;
  flex-shrink: 0;
}

.playlist-item-title {
  font-weight: bold;
  color: white;
}

/* ==========================================================================
   ANIMATIONS & UTILITIES
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.hidden {
  display: none !important;
}

.playlist-stats {
  font-style: italic;
  font-weight: normal;
  font-size: 0.8em;
}

#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  cursor: pointer;
}

#overlay i {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (MOBILE FIRST)
   ========================================================================== */

/* Show Install Button only on mobile */
@media (min-width: 769px) {
  .install-container {
    display: none !important;
  }
}

/* Mobile Small (<= 320px) */
@media (max-width: 320px) {
  .player-container {
    padding: 0.5rem;
    gap: 1rem;
  }
  .site-logo {
    width: 100px;
    border-radius: 15px;
  }
  .cover-art {
    max-width: 200px;
  }
  .playlist-item img {
    width: 50px;
    height: 50px;
  }
  .info-row {
    font-size: 0.75rem;
  }
  .info-row .label {
    width: 50px;
  }
  .volume-control {
    display: none;
  }
  .playlist-section h3 {
    font-size: 0.8rem;
  }
  .playlist-stats {
    font-size: 0.6em;
  }
}

/* Mobile (321px - 576px) */
@media (min-width: 321px) and (max-width: 576px) {
  .player-container {
    padding: 1rem;
  }
  .site-logo {
    width: 300px;
  }
  .cover-art {
    max-width: 300px;
  }
  .playlist-section h3 {
    font-size: 0.9rem;
  }
  .playlist-stats {
    font-size: 0.7em;
  }
}

/* Mobile/Tablets Medium (577px - 767px) */
@media (min-width: 577px) and (max-width: 767px) {
  .player-container {
    max-width: 90%;
  }
}

/* Tablets & Desktop (>= 768px) - Switch to Row Layout */
@media (min-width: 768px) {
  .player-container {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* Tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  /* Inherits row layout */
}

/* Desktop Small (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .player-container {
    max-width: 950px;
  }
}

/* ==========================================================================
   NEW FEATURES (Share & Volume)
   ========================================================================== */

/* Volume Percentage */
.volume-percentage {
  color: #c0caf5;
  font-size: 0.85rem;
  min-width: 40px;
  text-align: right;
}

/* Share Button */
.share-container {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.share-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #c0caf5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #7aa2f7;
}

.share-btn i {
  color: #7aa2f7;
}

@media (max-width: 480px) {
  .share-container {
    justify-content: center;
  }
  .volume-control {
    gap: 5px;
  }
}

/* ==========================================================================
   FOOTER & MODAL (LGPD)
   ========================================================================== */
.player-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: #a9b1d6;
  width: 100%;
  padding-bottom: 2rem;
}

.player-footer a {
  color: #7aa2f7;
  text-decoration: none;
  transition: opacity 0.2s;
}

.player-footer a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.player-footer p {
  margin-bottom: 8px;
}

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

.modal-content {
  background-color: #1a1b26;
  margin: 5vh auto;
  padding: 35px;
  border: 1px solid rgba(122, 162, 247, 0.2);
  width: 90%;
  max-width: 650px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  position: relative;
  color: #c0caf5;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.close-modal {
  color: #c0caf5;
  float: right;
  font-size: 32px;
  font-weight: normal;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 15px;
  line-height: 1;
}

.close-modal:hover {
  color: #7aa2f7;
}

.modal-content h2 {
  margin-bottom: 25px;
  color: #7aa2f7;
  font-size: 1.5rem;
  padding-right: 40px;
  border-bottom: 1px solid rgba(122, 162, 247, 0.1);
  padding-bottom: 15px;
}

.modal-body h3 {
  font-size: 1.1rem;
  margin: 25px 0 10px 0;
  color: #bb9af7;
}

.modal-body p {
  line-height: 1.7;
  margin-bottom: 15px;
  font-size: 0.95rem;
  text-align: left;
}

@media (max-width: 576px) {
  .modal-content {
    margin: 2vh auto;
    padding: 25px;
    width: 95%;
  }
  .modal-content h2 {
    font-size: 1.25rem;
  }
}

