@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;700&display=swap');

/* 🎨 Biến CSS */
:root {
  --font-family: 'Poppins', sans-serif;
  --bg-color-main: #0a192f;
  --text-color-light: #00FFFF;
  --text-color-secondary: #000000;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-hover: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.15);
  --btn-bg: rgba(255, 255, 255, 0.15);
  --btn-bg-hover: rgba(255, 255, 255, 0.3);
  --blur-amount: 8px;
  --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  --box-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.25);
  --active-color: rgba(0, 255, 255, 0.25);
  --transition-speed: 0.3s ease;
}

/* 🌌 Tổng thể */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=80')
            no-repeat center center/cover;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-color-light);
  line-height: 1.6;
}

/* 📦 Container */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  width: 90%;
  max-width: 1200px;
  margin-top: 30px;
}

/* 💎 Glassmorphism */
.glass {
  background: var(--glass-bg);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  box-shadow: var(--box-shadow);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-speed);
}
.glass:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--box-shadow-hover);
}

/* ⏰ Đồng hồ & Profile */
.clock, .profile, .music { text-align: center; }
.clock h2 { font-size: 2.5rem; margin: 0; font-weight: 700; }
.clock p { color: var(--text-color-secondary); font-size: 0.9rem; }

.profile img {
  width: 100px; height: 100px; border-radius: 50%;
  margin-bottom: 10px; object-fit: cover;
  border: 2px solid var(--glass-border);
}
.profile h3 { margin: 5px 0; font-size: 1.5rem; font-weight: 700; }
.profile p { font-style: italic; margin-bottom: 20px; color: var(--text-color-secondary); }

/* 📌 Nút trong profile */
.profile .btn {
  display: inline-block;
  padding: 10px 22px;
  margin: 6px 5px;
  border-radius: 12px;
  background: var(--btn-bg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all var(--transition-speed);
  color: var(--text-color-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.profile .btn:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.profile .btn:focus {
  outline: 2px solid cyan;
  outline-offset: 2px;
}

/* 🎵 Music Player */
.music h3 {
  font-size: 1.6rem;
  margin-bottom: 15px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
#player {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  margin-bottom: 15px;
  border: none;
  outline: none;
}

/* 📃 Playlist */
#playlist {
  list-style: none;
  padding: 0;
  margin: 15px 0;
  max-height: 200px;
  overflow-y: auto;
}
#playlist li {
  padding: 12px 15px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--glass-bg);
  cursor: pointer;
  transition: var(--transition-speed);
  font-weight: 400;
  text-align: left;
}
#playlist li:hover { background: var(--glass-bg-hover); transform: translateX(5px); }
#playlist li.active {
  background: var(--active-color);
  font-weight: 600;
  border-left: 4px solid cyan;
}

/* 📜 Thanh cuộn playlist */
#playlist::-webkit-scrollbar { width: 6px; }
#playlist::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
}
#playlist::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

/* 🎛️ Nút điều khiển nhạc */
.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.controls .btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--btn-bg);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-color-light);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-speed);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.controls .btn:hover {
  background: var(--btn-bg-hover);
  transform: scale(1.1);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}
.controls .btn.active { background: cyan; color: #0a192f; font-weight: bold; }

/* 🌐 Social */
.social {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.social a {
  font-size: 2.2rem;
  color: var(--text-color-secondary);
  transition: color var(--transition-speed);
}
.social a:hover { color: cyan; }

/* 📌 Footer */
footer {
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--text-color-secondary);
  text-align: center;
  padding: 20px 0;
}

/* 📱 Responsive */
@media (max-width: 992px) {
  .container { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (max-width: 600px) {
  .container { grid-template-columns: 1fr; width: 95%; }
  .glass { padding: 15px; }
  .profile img { width: 80px; height: 80px; }
  .clock h2 { font-size: 2rem; }
  .profile .btn { padding: 8px 18px; font-size: 0.85rem; }
  .controls .btn { width: 42px; height: 42px; font-size: 1rem; }
  .social a { font-size: 1.8rem; }
}

/* CSS loa dài nhiều sóng */
.speaker {
  display: flex;
  justify-content: space-between;
  width: 120px; /* dài hơn */
  height: 40px;
  margin: 20px auto;
  align-items: flex-end;
  position: relative;
}

/* đường chân loa */
.speaker::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: cyan;
  border-radius: 2px;
}

.bar {
  width: 8px;
  height: 100%;
  background: cyan;
  border-radius: 4px;
  transform-origin: bottom;
  animation: bounce 1s infinite ease-in-out;
  animation-play-state: paused; /* mặc định tạm dừng */
}

/* animation delay cho từng bar để nhún theo nhịp */
.speaker .bar:nth-child(1) { animation-delay: 0s; }
.speaker .bar:nth-child(2) { animation-delay: 0.1s; }
.speaker .bar:nth-child(3) { animation-delay: 0.2s; }
.speaker .bar:nth-child(4) { animation-delay: 0.3s; }
.speaker .bar:nth-child(5) { animation-delay: 0.4s; }
.speaker .bar:nth-child(6) { animation-delay: 0.5s; }
.speaker .bar:nth-child(7) { animation-delay: 0.6s; }
.speaker .bar:nth-child(8) { animation-delay: 0.7s; }
.speaker .bar:nth-child(9) { animation-delay: 0.8s; }
.speaker .bar:nth-child(10) { animation-delay: 0.9s; }

@keyframes bounce {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}