/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

/* Music Player Styles */
.music-player {
    background: #121212; /* darker card */
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.music-player h1 {
    margin-bottom: 20px;
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Music Info Styles */
.music-info {
    margin-bottom: 25px;
}

.cover-container {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.cover-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.cover-art.play {
    animation-play-state: running;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.song-details {
    margin-bottom: 15px;
}

.song-details h2 {
    font-size: 22px;
    margin-bottom: 5px;
    color: #fff;
}

.song-details p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

/* Progress Bar Styles */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    background: rgba(255,255,255,0.18);
    height: 6px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 5px;
    overflow: hidden;
}

.progress {
    background-color: #4a00e0;
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.1s linear;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Meta actions row (lyrics + quick actions) */
.meta-actions {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 14px 0 6px;
}
.icon-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
}
.icon-btn:hover { color: #fff; transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.icon-btn span { font-weight: 700; font-size: 16px; }


/* Controls Styles */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    margin: 0 15px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    transform: scale(1.1);
    color: #4a00e0;
}

.play-btn {
    background-color: #fff;
    color: #4a00e0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.play-btn:hover {
    background-color: #4a00e0;
    color: #fff;
}

/* Volume Control Styles */
.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.volume-container i {
    margin-right: 10px;
    color: #fff;
}

#volume {
    -webkit-appearance: none;
    width: 150px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
}

#volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* Playlist Styles */
.playlist-container {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.playlist-header h3 {
    font-size: 18px;
    color: #fff;
    text-align: left;
    margin: 0;
}

.playlist-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#playlist-select {
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: none;
    cursor: pointer;
}

.small-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    background-color: #4a00e0;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.small-btn:hover {
    background-color: #3700b3;
}

.small-btn:active {
    transform: scale(0.95);
}

.playlist {
    list-style: none;
    text-align: left;
}

/* Auth label */
.user-label {
    margin-left: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.playlist li {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.playlist li.active {
    background-color: rgba(74, 0, 224, 0.3);
    color: #fff;
}

.playlist li .song-info {
    flex: 1;
}

.playlist li .song-actions {
    display: flex;
    gap: 5px;
}

.playlist li .song-actions button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
}

.playlist li .song-actions button:hover {
    color: #fff;
}

/* Add Music Button */
.add-music-btn-container {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.add-music-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4a00e0;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

.add-music-toggle-btn:hover {
    background-color: #3700b3;
    transform: scale(1.05);
}

.add-music-toggle-btn:active {
    transform: scale(0.95);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background-color: rgba(30, 30, 30, 0.95);
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close, .close-music-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .close-music-modal:hover {
    color: #fff;
}

.modal h2 {
    margin-bottom: 20px;
    color: #fff;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-form input {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: none;
}

.modal-form button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background-color: #4a00e0;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  body {
    align-items: flex-start;
    padding-top: 12px;
    min-height: 100vh;
  }
  .controls { gap: 8px; }
  .control-btn { margin: 0 10px; }
}
@media (max-width: 480px) {
  .container { padding: 12px; }
  .music-player { padding: 15px; }
  .cover-container { width: 150px; height: 150px; }
  .song-details h2 { font-size: 18px; }
  .song-details p { font-size: 14px; }
  .control-btn { font-size: 16px; margin: 0 8px; }
  .play-btn { width: 44px; height: 44px; }
  .volume-container { margin-bottom: 20px; }
  .playlist-header { flex-wrap: wrap; gap: 8px; }
  #playlist-select { flex: 1; min-width: 140px; }
  .playlist-controls .small-btn { padding: 6px 8px; font-size: 11px; }
  .modal-content { width: 92%; max-width: 380px; margin: 12vh auto; }
  .tab-bar { height: 52px; }
  .tab-btn i { font-size: 17px; }
  .tab-btn span { display: none; }
}
@media (min-width: 600px) {
  .container { max-width: 560px; }
}
@media (min-width: 768px) {
  .container { max-width: 680px; }
}
@media (min-width: 1024px) {
  .container { max-width: 840px; }
  .cover-container { width: 240px; height: 240px; }
  .song-details h2 { font-size: 24px; }
}
/* Fluid playlist height */
.playlist-container { max-height: clamp(240px, 38vh, 420px); overflow-y: auto; }
/* Ensure content not hidden behind tab bar */
.container { padding-bottom: 72px; }
/* Inline auth messages */
.error-text {
  color: #e74c3c;
  font-size: 0.9rem;
  margin-top: 8px;
}

.info-text {
  color: #2ecc71;
  font-size: 0.9rem;
  margin-top: 8px;
}

.profile-row {
  margin: 8px 0;
  color: #ddd;
}

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: rgba(30, 30, 30, 0.95);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
}
.tab-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  gap: 4px;
  cursor: pointer;
}
.tab-btn i { font-size: 18px; }
.tab-btn.active, .tab-btn:hover { color: #fff; }
.tab-content { min-height: calc(100vh - 56px); }
.tab-page { display: none; }
.tab-page.active { display: block; }
.container { padding-bottom: 72px; }
/* Account bar */
.account-bar {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2000;
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 10px;
  border-radius: 9999px;
  cursor: pointer;
}

.account-btn .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.account-bar .user-label {
  font-size: 13px;
  color: #fff;
  opacity: 0.9;
}

@media (max-width: 420px) {
  .account-bar .user-label {
    display: none;
  }
}

/* Shadcn-style theme tokens */
:root {
  --background: 0 0% 6%;
  --foreground: 0 0% 98%;
  --card: 0 0% 10%;
  --card-foreground: 0 0% 98%;
  --popover: 0 0% 10%;
  --popover-foreground: 0 0% 98%;
  --primary: 262 84% 52%; /* purple */
  --primary-foreground: 0 0% 100%;
  --secondary: 220 13% 22%;
  --secondary-foreground: 0 0% 100%;
  --muted: 0 0% 20%;
  --muted-foreground: 0 0% 80%;
  --accent: 0 0% 20%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 80% 52%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 20%;
  --input: 0 0% 18%;
  --ring: 262 84% 52%;
}

.account-bar .user-label {
  font-size: 13px;
  color: #fff;
  opacity: 0.9;
}

@media (max-width: 420px) {
  .account-bar .user-label {
    display: none;
  }
}