:root {
  --red: #da251d;
  --dark-red: #a31b15;
  --gold: #ffd700;
  --beige: #f4e4bc;
  --dark: #2b2b2b;
  --text: #333;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Roboto Condensed", sans-serif;
  background-color: var(--beige);
  color: var(--text);
  margin: 0;
  padding: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23dccfae' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  background-color: var(--beige);
}

/* HEADER */
.propaganda-header {
  position: relative;
  text-align: center;
  border-bottom: 5px solid var(--red);
}

.banner-container {
  position: relative;
  height: 340px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(163, 27, 21, 0.7); /* Red tint */
  z-index: 2;
  mix-blend-mode: multiply;
}

.profile-section {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
}

.avatar-frame {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 0 0 4px var(--red), 0 5px 15px rgba(0, 0, 0, 0.5);
  background: var(--beige);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bio {
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--dark-red);
  margin-top: 15px;
}

/* SOCIAL LINKS */
.social-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  justify-content: center;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--red);
  color: var(--gold);
  border: 2px solid var(--gold);
  border-radius: 50%;
  transition: all 0.3s;
}

.social-icon:hover {
  background: var(--gold);
  color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.social-icon svg {
  width: 20px;
  height: 20px;
}

.comrade-name {
  font-family: "Oswald", sans-serif;
  font-size: 2.5rem;
  margin: 0;
  letter-spacing: 2px;
}

.slogan {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 5px 0 0 0;
  background: var(--red);
  color: var(--gold);
  padding: 0px 10px;
  display: inline-block;
}

/* SEARCH */
.search-section {
  padding: 30px 20px;
  background: var(--dark-red);
  display: flex;
  justify-content: center;
}

.input-wrapper {
  display: flex;
  width: 100%;
  max-width: 600px;
  box-shadow: 5px 5px 0 var(--dark);
}

#search-input {
  flex: 1;
  padding: 15px;
  font-size: 1.2rem;
  border: 3px solid var(--dark);
  background: var(--beige);
  font-family: "Roboto Condensed", sans-serif;
  text-transform: uppercase;
  color: var(--dark-red);
  font-weight: bold;
  outline: none;
  width: inherit;
}

#search-btn {
  padding: 0 25px;
  border: 3px solid var(--dark);
  border-left: none;
  background: var(--gold);
  color: var(--red);
  font-family: "Oswald", sans-serif;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

#search-btn:hover {
  background: #fff;
}

/* CONTENT */
.content-section {
  padding: 40px 20px;
}

.section-header {
  text-align: center;
  color: var(--red);
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  position: relative; /* For absolute positioning of toggle btn */
}

.section-title {
  font-family: "Oswald", sans-serif;
  font-size: 2rem;
  margin: 0;
  text-transform: uppercase;
  border-bottom: 3px solid var(--red);
  padding-bottom: 5px;
}

.star {
  font-size: 1.5rem;
  color: var(--gold);
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  min-height: 760px;
}

.song-card {
  background: #fff;
  border: 3px solid var(--red);
  padding: 15px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.1);
  max-height: 240px;
}

.song-card:hover {
  transform: translateY(-5px);
  box-shadow: 8px 8px 0 var(--dark-red);
}

.song-card h3 {
  margin: 0 0 5px 0;
  font-size: 1.3rem;
  color: var(--dark-red);
  font-family: "Oswald", sans-serif;
  line-height: 1.2;
}

.song-artist {
  font-size: 0.9rem;
  font-weight: bold;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 15px;
  display: block;
}

.song-stats {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--dark);
  margin-bottom: 15px;
  border-top: 1px dashed var(--red);
  padding-top: 10px;
}
.download-note {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--dark);
  margin: 10px 0;
  padding-top: 10px;
}

.download-icon {
  margin-right: 5px;
}

.download-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--red);
  color: var(--gold);
  border: none;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 1.1rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}

.download-btn:hover {
  background: var(--dark-red);
}

.no-result {
  text-align: center;
  font-size: 1.5rem;
  color: var(--dark-red);
  font-weight: bold;
  padding: 40px;
}

/* DONATE */
.donate-section {
  padding: 40px 20px;
  background-color: #eee5ce;
  border-top: 5px solid var(--red);
}

.donate-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 40px;
  max-width: 800px;
  margin: 0 auto;
  border: 4px double var(--red);
  padding: 30px;
  background: #fff;
}

.qr-frame {
  width: 180px;
  min-width: 180px;
  height: 180px;
  min-height: 180px;
  border: 2px solid var(--gold);
  padding: 10px;
  background: var(--red);
}

.qr-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.donate-info {
  text-align: left;
}

.donate-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--dark-red);
  margin-top: 0;
}

.bank-info {
  background: var(--beige);
  padding: 15px;
  border: 2px dashed var(--red);
  font-family: monospace;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #333;
}

/* FOOTER */
.footer {
  background: var(--red);
  color: var(--gold);
  text-align: center;
  padding: 20px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* RESPONSIVE */
.mobile-hidden {
  display: none;
}

@media (max-width: 768px) {
  .comrade-name {
    font-size: 1.8rem;
  }

  .donate-card {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .donate-info {
    text-align: center;
  }

  .slogan {
    font-size: 1rem;
    margin: 0 10px;
    padding: 5px;
  }
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  gap: 10px;
}

.page-btn {
  padding: 8px 15px;
  background: var(--beige);
  border: 2px solid var(--red);
  color: var(--red);
  font-family: "Oswald", sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: var(--red);
  color: var(--gold);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #ccc;
  color: #ccc;
}

.page-info {
  font-family: "Oswald", sans-serif;
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--dark-red);
}

/* DONATE ACTIONS */
.donate-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 8px 15px;
  background: var(--red);
  color: var(--gold);
  border: none;
  font-family: "Oswald", sans-serif;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  border: 2px solid var(--gold);
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--dark-red);
  transform: translateY(-2px);
}

.click-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--gold);
  background: var(--red);
  margin-top: -4px;
  padding: 2px;
  font-family: "Oswald", sans-serif;
}

.qr-frame:hover {
  transform: scale(1.02);
  transition: transform 0.2s;
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(163, 27, 21, 0.9);
  animation: fadeIn 0.3s;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--beige);
  border: 5px solid var(--gold);
  width: 90%;
  max-width: 500px;
  padding: 20px;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  animation: slideDown 0.3s;
  text-align: center;
}

.close-modal {
  color: var(--red);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: var(--dark-red);
}

.modal-title {
  color: var(--red);
  font-family: "Oswald", sans-serif;
  margin-top: 0;
  border-bottom: 2px solid var(--red);
  padding-bottom: 10px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.modal-qr-frame {
  width: 250px;
  height: 250px;
  border: 3px solid var(--gold);
  padding: 10px;
  background: var(--red);
}

.modal-qr-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@media (max-width: 600px) {
  .donate-actions {
    justify-content: center;
  }
}

/* AUDIO PLAYER */
.audio-wrapper {
  margin: 10px 0;
  width: 100%;
}

.audio-wrapper audio {
  width: 100%;
  height: 35px;
  border-radius: 0;
  outline: none;
}
/* Attempting to style standard audio player in webkit browsers to match theme slightly */
.audio-wrapper audio::-webkit-media-controls-panel {
  background-color: var(--beige);
}

.card-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 215, 0, 0.9); /* Gold background */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-weight: bold;
  color: #da251d; /* Red text */
  font-family: "Oswald", sans-serif;
  font-size: 1.2rem;
  text-transform: uppercase;
  animation: fadeIn 0.3s;
  border: 4px solid #da251d;
}

.grid-loading {
  height: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-family: "Oswald", sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.5);
  border: 2px dashed var(--red);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--gold);
  border-top: 5px solid var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* VIEW TOGGLE BTN */
.header-actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 10px;
}

.view-toggle-btn {
  background: var(--gold);
  color: var(--red);
  border: 2px solid var(--red);
  font-family: "Oswald", sans-serif;
  font-weight: bold;
  cursor: pointer;
  padding: 5px 15px;
  font-size: 1rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.view-toggle-btn:hover {
  background: var(--red);
  color: var(--gold);
}

/* LIST VIEW STYLES */
.song-grid.list-view {
  display: flex !important;
  flex-direction: column;
  gap: 15px;
}

.song-grid.list-view .song-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 20px;
  max-height: none !important;
  height: auto !important;
  padding: 15px 20px;
  width: 100%;
}

.song-grid.list-view .song-info-group {
  width: 280px; /* Fixed width as requested */
  min-width: 200px;
  flex: 0 0 auto;
  overflow: hidden; /* Contain floats/overflows */
}

.song-grid.list-view .song-card h3 {
  font-size: 1.2rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-grid.list-view .song-artist {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-grid.list-view .audio-wrapper {
  margin: 0;
  flex: 1;
  width: auto;
}

.song-grid.list-view .song-actions-group {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 200px;
  justify-content: flex-end;
}

.song-grid.list-view .song-stats {
  border: none;
  border-top: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.song-grid.list-view .download-btn {
  width: auto;
  padding: 8px 20px;
  font-size: 1rem;
}

/* Responsive List View */
@media (max-width: 768px) {
  .song-grid.list-view .song-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 15px;
  }

  .song-grid.list-view .song-info-group {
    min-width: 0;
    width: 100%;
  }

  .song-grid.list-view .audio-wrapper {
    width: 100%;
  }

  .song-grid.list-view .song-actions-group {
    width: 100%;
    justify-content: center;
  }

  /* Reset Header on Mobile */
  .section-header {
    flex-direction: column;
    gap: 10px;
  }

  .header-actions {
    position: static;
    transform: none;
    width: 100%;
    flex-direction: column;
    gap: 10px;
    order: 2;
  }

  .view-toggle-btn {
    width: 100%;
  }
}
/* FIXED PLAYER */
.fixed-player {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--red);
  color: var(--gold);
  padding: 10px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  border-top: 3px solid var(--gold);
}

.player-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.player-info {
  flex: 1;
  min-width: 150px;
}

.player-info h3 {
  margin: 0;
  font-size: 1rem;
  font-family: "Oswald", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-info span {
  font-size: 0.8rem;
  opacity: 0.8;
}

.player-controls {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 15px;
  align-items: center;
}

.player-controls button {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  padding: 5px;
}

.player-controls button:hover {
  transform: scale(1.2);
  color: #fff;
}

.player-controls .play-btn {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
}

.progress-container {
  flex: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: monospace;
  font-size: 0.9rem;
}

#progress-bar {
  flex: 1;
  cursor: pointer;
  accent-color: var(--gold);
}

/* New Buttons in Song Card */
.play-action-btn,
.add-playlist-btn {
  border: 1px solid var(--red);
  background: white;
  color: var(--red);
  padding: 5px 10px;
  cursor: pointer;
  font-family: "Oswald", sans-serif;
  margin-right: 5px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.play-action-btn:hover,
.add-playlist-btn:hover {
  background: var(--red);
  color: var(--gold);
}

/* Active styles for player buttons */
.active-ctrl {
  color: #fff !important;
  text-shadow: 0 0 5px var(--gold);
}

@media (max-width: 768px) {
  .player-content {
    flex-wrap: wrap;
    padding-bottom: 20px; /* Safe area */
  }

  .player-info {
    width: 100%;
    text-align: center;
    order: 1;
  }

  .progress-container {
    width: 100%;
    order: 2;
  }

  .player-controls {
    width: 100%;
    order: 3;
    margin-top: 5px;
  }

  /* Add padding to body so content isn't hidden behind player */
  body {
    padding-bottom: 200px;
  }

  .playlist-modal {
    width: 100%;
    right: 0;
    bottom: 180px; /* Adjust for mobile player height */
    max-height: 50vh;
  }
}

/* PLAYLIST MODAL */
.playlist-modal {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 350px;
  max-height: 400px;
  background: var(--beige);
  border: 4px solid var(--red);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s;
}

.playlist-header {
  background: var(--red);
  color: var(--gold);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.playlist-header h3 {
  margin: 0;
  font-family: "Oswald", sans-serif;
}

.playlist-header span {
  font-size: 1.5rem;
  cursor: pointer;
}

#playlist-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.playlist-item {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.playlist-item .song-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.playlist-item:hover {
  background: #f0f0f0;
}

.playlist-item.active {
  background: var(--red);
  color: var(--gold);
}

.playlist-item .song-title {
  font-weight: bold;
  font-size: 0.9rem;
}

.playlist-item .remove-btn {
  background: none;
  border: none;
  color: red;
  font-weight: bold;
  cursor: pointer;
  padding: 5px;
}

.playlist-item.active .remove-btn {
  color: var(--gold);
}

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