html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  height: 100%;
}

body {
  background: #000;
  overflow-y: auto;
  position: relative;
}

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.spotify-card {
  background-color: #1DB954; 
  color: #fff;
  transition: background-color 0.3s ease;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  border-radius: 12px;
  padding: 1rem;
  width: 100%;
  max-width: 450px;
  margin: 1.5rem auto 0 auto;
  box-sizing: border-box;
  position: relative; 
  overflow: hidden; 
}

#audio-visualizer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; 
  opacity: 0.15; 
}

.spotify-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.genre-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.genre-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.spotify-card.video-mode .genre-btn {
    display: none !important; 
}

.spotify-content {
  display: flex !important;
  flex-direction: row !important; 
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.spotify-content img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  border: 2px solid #000;
  flex-shrink: 0; 
  object-fit: cover;
}

.spotify-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center;
  flex-grow: 1;
  min-width: 0; 
  margin: 0 !important;
  text-align: left;
}

#spotify-song-title {
  display: block;
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

#spotify-artist-name {
  display: block;
  font-size: 0.9rem;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.spotify-progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.time-display {
  font-size: 0.75rem;
  opacity: 0.8;
  min-width: 30px; 
}

.progress-bar-track {
  flex-grow: 1;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  cursor: pointer;
}

.progress-bar-fill {
  height: 100%;
  width: 0%; 
  background-color: #fff;
  border-radius: 3px;
}

#audio-controls-container {
  display: flex !important; 
  justify-content: center;
  align-items: center;
  width: auto !important; 
  flex-shrink: 0; 
  gap: 0.5rem;
}

.spotify-control {
  background-color: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s;
}

.spotify-control:hover {
  transform: scale(1.15);
}

.spotify-control.main {
  background-color: #fff;
  border: 4px solid #000;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.spotify-control.main:hover {
  background-color: #f0f0f0;
}

.spotify-control.secondary {
  font-size: 1.2rem;
  opacity: 0.8;
}

/* --- THEMES --- */
.spotify-theme {
  background-color: #1DB954; 
}
.spotify-theme .spotify-control.main {
  color: #1DB954; 
}

.youtube-theme {
  background-color: #CD201F; 
}
.youtube-theme .spotify-control.main {
  color: #CD201F;
}

.tiktok-theme .spotify-control.main {
  color: #000;
}


.spotify-card.video-mode .spotify-content {
    flex-direction: column !important;
    align-items: center;
}

.spotify-card.video-mode video {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #000;
   /* background: #ffffff;  */
    background: #000;
    margin-bottom: 10px;
    display: block;
}

.spotify-card.video-mode .spotify-info {
    width: 100%;
    text-align: center; 
    margin-top: 10px !important;
}

.spotify-card.video-mode #audio-progress-bar-container {
    display: none;
}

.mode-switch-button {
    padding: 0.6rem 1.2rem;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000; 
    background-color: #fff;
    color: #000;
    cursor: pointer;
    font-weight: bold;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background-color 0.2s, transform 0.2s;
    width: 90%; 
    max-width: 300px; 
    box-sizing: border-box;
    display: block; 
    margin: 0 auto;
}

.mode-switch-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 #000;
}

#corner-image {
    position: fixed; 
    bottom: 0px;     
    right: 0px;      
    width: 330px;    
    height: auto;
    z-index: 5;     
    display: none;   
    opacity: 1;      
    pointer-events: none; 
    animation: fadeInBottomRight 2s ease-in-out forwards;
}

@keyframes fadeInBottomRight {
  from { opacity: 0; transform: translate(50px, 50px); } 
  to { opacity: 1; transform: translate(0, 0); }
}

.container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 1rem; 
  animation: fadeIn 1.5s ease-in-out;
}

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

.card {
  background-color: #fff;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000; 
  border-radius: 10px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  text-align: center;
  margin-bottom: 2rem;
}

.card h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.card p { font-size: 1rem; margin: 0.5rem 0; }

.info {
  margin: 1rem 0 2rem;
  padding: 1.5rem;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000; 
  border-radius: 12px;
  background-color: #e6e6e6;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.info img {
  width: 90px;
  height: auto;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  border: 2px solid #000;
}
.info strong { font-size: 1.5rem; }
.info br + div { font-size: 1.2rem; }

.social-icons { margin-top: 0.5rem; }
.social-icons a { margin: 0 0.4rem; color: #000; font-size: 1.2rem; }

.section-box-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.section-box {
  background-color: #fff;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000; 
  border-radius: 10px;
  padding: 1rem;
  width: 100%;
  max-width: 500px;
  margin-bottom: 2rem;
  animation: fadeInUp 1.2s ease-in-out;
}

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

.section-title { font-size: 1.4rem; font-weight: bold; text-align: center; margin-bottom: 1rem; }

.links, .contact {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.links a, .contact a {
  width: 100%;
  max-width: 90%;
  background-color: #fff;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000; 
  margin: 0.5rem 0;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  color: #000;
  transition: transform 0.2s;
  text-align: center;
}

.links a:hover, .contact a:hover {
  transform: scale(1.05);
  background-color: #d1d1d1;
}

#clock {
  font-size: 1.5rem;
  font-weight: bold;
  background-color: #fff;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000; 
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 1rem;
}

.api-status-card, .sankanime-status-card { padding: 1.5rem; }

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem; 
    margin-bottom: 2.5rem;
}

.status-item {
    background-color: #f9f9f9;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000; 
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.status-item span { display: block; color: #555; margin-bottom: 0.25rem; }
.status-item strong { font-size: 1.1rem; word-wrap: break-word; line-height: 1.3;}
.status-item strong.small-text { font-size: 0.85rem; }
.status-item .aktif { color: #28a745; font-weight: bold; }

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

.charts-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.chart-container { width: 100%; }

.chart-title {
    font-weight: bold;
    margin: 0 auto 1.5rem auto;
    padding: 0.4rem 1rem;
    border: 2px solid #000;
    box-shadow: 3px 3px 0 #000;
    border-radius: 8px;
    background-color: #f9f9f9;
    max-width: 400px;
    text-align: center;
}

.separator {
    width: 100%;
    max-width: 500px;
    height: 3px;
    background-color: #000;
    margin: 1.5rem 0 3rem 0;
    box-shadow: 6px 6px 0 #000;
}

.extra-stats {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000; 
    border-radius: 8px;
    display: flex;
    justify-content: space-around;
    text-align: center;
    background-color: #f9f9f9;
    flex-wrap: wrap;
    gap: 1rem;
}

.info-pair { flex: 1 1 auto; min-width: 120px; }
.info-pair span { display: block; color: #555; margin-bottom: 0.25rem; }
.info-pair strong { font-size: 1.2rem; font-weight: bold; }

.top-donors-wrapper {
    display: flex;
    justify-content: center; 
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.top-donor-item {
    width: 250px; 
    background-color: #fff;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.top-donor-info strong { display: block; font-size: 1.1rem; margin-top: 0.5rem; }
.top-donor-info span { display: block; font-weight: bold; color: #28a745; margin-top: 0.25rem; }

.donation-list {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    background-color: #fff;
}

.donation-item { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid #f0f0f0; }
.donation-item:last-child { border-bottom: none; }
.donation-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #000; }
.donation-content { flex: 1; }
.donation-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.donation-header strong { font-size: 1.1rem; }
.donation-header span { font-weight: bold; color: #28a745; background-color: #eaf6ec; padding: 0.2rem 0.5rem; border-radius: 6px; }
.donation-msg { margin: 0 0 0.5rem 0; color: #333; }
.donation-date { color: #777; font-size: 0.8rem; }

.donation-list::-webkit-scrollbar { width: 8px; }
.donation-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.donation-list::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
.donation-list::-webkit-scrollbar-thumb:hover { background: #555; }

@media(max-width: 480px) {
  .info { flex-direction: column; text-align: center; max-width: 300px; margin-left: auto; margin-right: auto; padding: 1rem; }
  .card { padding: 1.2rem; width: 90%; box-shadow: 4px 4px 0 #000; }
  .card h1 { font-size: 1.6rem; }
  .card p { font-size: 0.95rem; }
  .section-box { width: 90%; }
  #corner-image { display: none; } 
  .chart-container {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }
  .spotify-content {
    gap: 0.75rem;
  }
  .spotify-content img {
    width: 60px;
    height: 60px;
  }
  .spotify-info strong {
    font-size: 1rem;
  }
  .spotify-control.main {
    width: 38px;
    height: 38px;
  }
  .spotify-control.secondary {
    font-size: 1rem;
  }
  .spotify-header {
    font-size: 11px; 
    margin-bottom: 10px; 
  }

  .spotify-header i {
    font-size: 16px; 
    margin-right: 6px;
  }
  .genre-btn {
     padding: 3px 8px;
     font-size: 10px; 
     border-radius: 12px; 
     white-space: nowrap; 
     max-height: 24px; 
  }
}
@media (min-width: 768px) {
  .section-box-wrapper { flex-direction: row; justify-content: center; align-items: flex-start; gap: 2rem; }
  .section-box { margin-bottom: 0; }
  .status-grid { grid-template-columns: repeat(4, 1fr); }
  #corner-image { 
    display: block; 
    width: 220px;
  }
}

@media (min-width: 1060px) {
    .api-status-card, .sankanime-status-card { max-width: 1044px; }
    .charts-wrapper { flex-direction: row; justify-content: space-between; align-items: flex-start; }
    .chart-container { flex: 1; max-width: 32%; }
    .separator { max-width: 1044px; }
    #corner-image {
        width: 330px;
    }
}

@media (prefers-reduced-motion: reduce) {
  #particles-js {
    display: none; 
  }
}

.click-particle {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  border: 3px solid #000;
  animation: particleFloat 1s ease-out forwards;
}

.particle-square {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 2px 2px 0 #000;
}

.particle-star {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid;
  position: relative;
  box-shadow: 2px 2px 0 #000;
}

.particle-star:after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid;
  top: 5px;
  left: -8px;
}

@keyframes particleFloat {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) rotate(var(--rotation)) scale(0);
    opacity: 0;
  }
}

.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

.recent-requests-container {
    margin-top: 2.5rem;
    width: 100%;
}

.recent-requests-list {
    max-height: 250px; 
    overflow-y: auto;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    background-color: #f9f9f9;
}

.request-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.request-list-item:last-child {
    border-bottom: none;
}

.request-list-item .route {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    margin-right: 1rem;
}

.request-list-item .timestamp {
    font-size: 0.85rem;
    color: #555;
    background-color: #e6e6e6;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    flex-shrink: 0; 
}

.recent-requests-list::-webkit-scrollbar { width: 8px; }
.recent-requests-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.recent-requests-list::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
.recent-requests-list::-webkit-scrollbar-thumb:hover { background: #555; }
.spotify-card.video-mode #spotify-song-title,
.spotify-card.video-mode #spotify-artist-name { display: none !important; }
.spotify-card.video-mode #audio-controls-container { margin-top: 10px; margin-bottom: 5px; }
.spotify-card.video-mode .spotify-header { margin-bottom: 0.8rem !important; }
.spotify-card.video-mode video { margin: 0 auto 0.5rem auto !important;  border-radius: 8px; width: 100%; }
.spotify-card.video-mode .spotify-content { flex-direction: column !important; gap: 0 !important; }
.spotify-card.video-mode .spotify-info { display: none !important; }
.spotify-card.video-mode #audio-controls-container { margin-top: 0; margin-bottom: 5px; }
.spotify-card.tiktok-theme { background-color: #000000 !important; border-color: #333333; }
.tiktok-theme .spotify-header,
.tiktok-theme .spotify-header i,
.tiktok-theme .spotify-control.secondary { color: #ffffff !important; }
.tiktok-theme .spotify-control.main { background-color: #ffffff !important; color: #000000 !important; border-color: #ffffff !important; }
.tiktok-theme .spotify-control.main:hover { background-color: #e6e6e6 !important; }
