@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* green theme
--text: rgb(232, 240, 239);
--background: rgb(12, 20, 19);
--primary: rgb(169, 208, 201);
--secondary: rgb(59, 118, 108);
--accent: rgb(97, 183, 169);
*/

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

body {
  font-family: 'DM Sans', sans-serif;
  background: rgb(12, 20, 19);
  color: rgb(232, 240, 239);
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.container {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  position: relative;
}


/* MUSIC PLAYER SECTION */
.music-player {
  flex-grow: 1;
  transition: width 0.3s ease;
  height: 100vh;
  display: flex;
  flex-direction: column;

  /* For animated background */
  position: relative;
  overflow: hidden;
  background-color: rgb(12, 20, 19); 
  color: white;
  --color-a: rgb(59, 118, 108);
  --color-b: rgb(97, 183, 169);
  --color-c: rgb(169, 208, 201);
  
}

.music-player::before,
.music-player::after {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, var(--color-a), var(--color-b), var(--color-c));
  opacity: 0.15;
  filter: blur(100px);
  border-radius: 50%;
  transform-origin: center;
  z-index: 0;
  pointer-events: none;
}

.music-player::before {
  top: -40%;
  left: -30%;
  animation: blob 8s infinite ease-in-out;
}

.music-player::after {
  top: -10%;
  left: 20%;
  animation: blob 12s infinite ease-in-out reverse;
}

@keyframes blob {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 80px) scale(1.2); }
  100% { transform: translate(0, 0) scale(1); }
}


/* SEARCH BAR */
.search-bar-main{
  padding: 20px;
  background: transparent;
}

.search-bar-panel {
  padding: 20px;
  background: rgb(12, 20, 19);
}

#searchInputMain{
  width: 20%;
  padding: 12px 20px;
  border: 2px solid #f0f0f0;
  border-radius: 25px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
  background: rgb(12, 20, 19);
  color: rgb(232, 240, 239);
}

#searchInputPanel {
  width: 110%;
  margin-top: 5px;
  padding: 12px 20px;
  border: 2px solid #f0f0f0;
  border-radius: 25px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
  background: rgb(12, 20, 19);
  color: rgb(232, 240, 239);
}

#searchInputMain:focus, #searchInputPanel:focus {
  border-color: rgb(97, 183, 169);
  background: rgb(12, 20, 19);
  color: rgb(232, 240, 239);
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

#backToMPButton {
  background: transparent;
  border: none;
}


/* MUSIC CONTROL UI */
.music-control-ui {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background-color: transparent;
  z-index: 1;
}

.album-art-container {
  width: 280px;
  height: 280px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: opacity 0.3s ease;
}

.album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-art.hidden {
  opacity: 0;
  pointer-events: none;
}

.album-art-container:empty::after {
  content: "🎵";
  font-size: 60px;
  color: #ccc;
}


/* AUDIO PLAYER */
.audio-player {
  display: none;
}


/* PROGRESS BAR */
.progress-container {
  width: 100%;
  max-width: 400px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 20px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: white;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3); 
  border-radius: 4px;
  transition: width 0.3s ease;
}


/* SONG INFO */
.song-name {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgb(232, 240, 239);
}

.artist-name {
  font-size: 18px;
  color: #666;
  margin-bottom: 30px;
}

/* CONTROLS */
.song-control {
  display: flex;
  align-items: center;
  gap: 20px;
}

.change-button, .play-button {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.play-button {
  background: transparent;
  padding: 15px 30px;
}

.change-button {
  background: transparent;
  padding: 15px 30px;
}


/* SIDE PANELS */
.search-panel, .full-view {
  width: 50%;
  height: 100vh;
  background: rgb(12, 20, 19);
  border-left: 1px solid #eee;
  overflow-y: auto;
  transition: transform 0.3s ease;
  top: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.search-panel-header {
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding-right: 20px;
  background: rgb(12, 20, 19);
}

.search-panel .search-bar {
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.scrollable-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.top-artist-card {
  width: 45em; 
  border-radius: 6em 1em;
  background-color: rgb(12, 20, 19); 
  border:solid;
  border-color: rgb(97, 183, 169);
  border-width:1px;
  display: flex;
  overflow: hidden; 
  height: 290px;
  margin: 20px auto; 
}

.artist-image-with-fade {
  flex: 0 0 40%; 
  background-size: cover; 
  background-position: center center; 
  background-repeat: no-repeat;
}

.top-artist-name {
  flex: 1;
  padding: 0px;
  margin-left: 6em; 
  display: flex;
  flex-direction: column;
  justify-content: center; 
  align-items: flex-start; 
}

.top-artist {
  font-size: 2em;
  font-weight: bold;
  color: white;
  text-align: start;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); 
}

/* SEARCH RESULTS STYLING */
.search-results h3 {
  color: rgb(232, 240, 239);
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid rgba(232, 240, 239, 0.2);
  padding-bottom: 15px;
}

.artist-card, .track-card, .album-card {
  padding: 15px;
  margin-bottom: 10px;
  background: rgba(59, 118, 108, 0.1);
  color: rgb(232, 240, 239); 
  height:auto;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(169, 208, 201, 0.3);
}

.artist-card:hover, .track-card:hover, .album-card:hover {
  background: rgba(97, 183, 169, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  border-color: rgb(97, 183, 169)
}

.artist-img{
  height:40px;
}

.show-more-btn {
  background: transparent;
  color: rgb(169, 208, 201);
  border: 1px solid rgb(169, 208, 201);
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 15px;
  font-size: 14px;
  transition: all 0.3s ease;
  align-self: flex-start; 
}

.show-more-btn:hover {
  background: rgba(169, 208, 201, 0.1);
  transform: translateY(-1px);
}

#artistsSection,
#songsSection,
#albumsSection {
  margin-bottom: 40px;
}


/* FULL VIEW STYLING */
#backToSummaryBtn {
  background: rgb(12, 20, 19);
  text-align: left;
  border:none;
  color: rgb(232, 240, 239);
  cursor: pointer;
  margin: 20px;
  transition: all 0.3s ease;
}

.songsList, .artistsList, .albumsList {
  margin-bottom: 10px;
}


/* ALBUM TRACKS STYLING */
.album-header {
  padding: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  background: rgb(12, 20, 19);
}

.album-header h3 {
  margin: 10px 0 5px 0;
  font-size: 40px;
  color:rgb(232, 240, 239);
}

.album-header p {
  font-size: 15px;
  margin: 5px 0;
  color:rgb(232, 240, 239);
}

.back-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 15px;
  font-size: 14px;
  display:flex;
  align-items: center;
  justify-items:center;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: #e9ecef;
}

.tracks-container {
  padding: 20px;
}

.track-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(59, 118, 108, 0.1);
  color: rgb(232, 240, 239); 
  border: 1px solid rgba(169, 208, 201, 0.3);
}

.track-item:hover {
  transform: translateY(-1px);
  background: rgba(97, 183, 169, 0.2);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  border-color: rgb(97, 183, 169);
}

.track-number {
  font-weight: 600;
  color: rgb(232, 240, 239); 
  width: 30px;
  text-align: center;
  font-size: 14px;
}

.track-info {
  flex: 1;
  margin-left: 15px;
}

.track-name {
  font-weight: 500;
  margin-bottom: 3px;
  color: rgb(232, 240, 239); 
}

.track-artist {
  font-size: 13px;
  color: rgb(232, 240, 239); 
}

.play-btn {
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.track-item:hover .play-btn {
  opacity: 1;
}

.clickable-album {
  cursor: pointer;
  transition: all 0.3s ease;
}

.clickable-album:hover {
  transform: translateY(-1px);
  background: rgba(97, 183, 169, 0.2);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  border-color: rgb(97, 183, 169);
}

/* YOUTUBE PLAYER (HIDDEN) */
#youtubePlayer {
  display: none;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    position: relative;
  }

  .music-player {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
  }

  .search-panel, .full-view {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-left: none;
    z-index: 20; 
  }

  /* Adjust search bars for mobile */
  #searchInputMain {
    width: 90%;
  }

  #searchInputPanel {
    width: 100%;
    margin-top: 0;
  }
  
  /* Adjust player UI for smaller screens */
  .music-control-ui {
    padding: 20px;
    justify-content: center;
  }

  .album-art-container {
    width: 220px;
    height: 220px;
    margin-bottom: 20px;
  }

  .song-name {
    font-size: 20px;
  }

  .artist-name {
    font-size: 16px;
  }
  
  .progress-container {
    max-width: 90%;
  }

  /* Make top artist card stack vertically */
  .top-artist-card {
    width: 100%; 
    height: auto;
    flex-direction: column;
    border-radius: 1.5em;
  }

  .artist-image-with-fade {
    flex: none;
    width: 100%;
    height: 180px;
  }

  .top-artist-name {
    margin-left: 0;
    padding: 20px;
    align-items: center;
  }
  
  .top-artist {
    text-align: center;
  }
}

/* For very small screens */
@media (max-width: 380px) {
    .album-art-container {
        width: 180px;
        height: 180px;
    }
    .song-name {
        font-size: 18px;
    }
    .artist-name {
        font-size: 14px;
    }
    .song-control {
        gap: 15px;
    }
}
