/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #1a1a1a;
  color: #ffffff;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
  border: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

/* Mobile Viewport Meta */
@viewport {
  width: device-width;
  initial-scale: 1;
}

/* Container */
.dashboard-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
  background-color: #121212;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.logo {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(to right, #4F46E5, #8B5CF6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 10px;
  flex-shrink: 0;
}

.logo-info h1 {
  font-size: 20px;
  font-weight: bold;
  margin: 0;
}

.logo-info p {
  font-size: 12px;
  color: #a0aec0;
}

.stats {
  display: flex;
  align-items: center;
}

.stat-badge {
  background-color: rgba(79, 70, 229, 0.2);
  padding: 6px 10px;
  border-radius: 50px;
  font-size: 12px;
  color: #a0aec0;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #4F46E5;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 1.5s infinite;
}

.pulse-dot.green {
  background-color: #10B981;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
}

/* Content Layout */
.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.panel {
  background-color: #1e1e1e;
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.panel-title {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
}

.panel-title .icon, 
.info-icon {
  margin-right: 6px;
  font-size: 16px;
}

/* Playlist */
.playlist-panel {
  order: 2;
}

.melody-list {
  max-height: 350px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.melody-list::-webkit-scrollbar {
  width: 5px;
}

.melody-list::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.melody-list::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 5px;
}

.melody-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.melody-item:hover {
  background-color: #333333;
}

.melody-active {
  border-left: 4px solid #4F46E5;
  background-color: #333333;
}

.melody-info {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.melody-number {
  width: 24px;
  height: 24px;
  background-color: #4a4a4a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  margin-right: 10px;
  flex-shrink: 0;
}

.melody-active .melody-number {
  background: linear-gradient(to bottom right, #4F46E5, #8B5CF6);
}

.melody-details {
  flex: 1;
  min-width: 0;
}

.melody-title {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.melody-description {
  font-size: 11px;
  color: #a0aec0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.melody-stats {
  text-align: right;
  flex-shrink: 0;
  margin-left: 10px;
}

.melody-duration {
  font-size: 11px;
  color: #a0aec0;
  margin-bottom: 2px;
}

.melody-listeners {
  font-size: 11px;
  color: #4ADE80;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.avatar-group {
  display: flex;
  margin-right: 4px;
}

.mini-avatar {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #1e1e1e;
  margin-right: -6px;
}

.info-bar {
  display: flex;
  flex-direction: column;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px;
}

.info-content {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.info-text {
  font-size: 11px;
  color: #a0aec0;
}

.log-button {
  background-color: #2d3748;
  color: #cbd5e0;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  align-self: flex-end;
}

/* Player */
.player-panel {
  order: 1;
}

.now-playing-header {
  font-size: 12px;
  color: #a0aec0;
  margin-bottom: 12px;
}

.player-section {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.player-artwork {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 12px;
  background: linear-gradient(to bottom right, #4F46E5, #8B5CF6);
  flex-shrink: 0;
}

.player-artwork.alpha {
  background: linear-gradient(to bottom right, #3B82F6, #60A5FA);
}

.player-artwork.theta {
  background: linear-gradient(to bottom right, #8B5CF6, #A78BFA);
}

.player-artwork.delta {
  background: linear-gradient(to bottom right, #EC4899, #F472B6);
}

.player-details {
  flex: 1;
  min-width: 0;
}

.player-details h3 {
  font-size: 16px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-details p {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-alpha {
  color: #60A5FA;
}

.text-theta {
  color: #A78BFA;
}

.text-delta {
  color: #F472B6;
}

.progress-container {
  margin-bottom: 15px;
}

.progress-bar {
  height: 5px;
  background-color: #4a4a4a;
  border-radius: 2.5px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, #4F46E5, #8B5CF6);
  animation: progress-animation 60s linear infinite;
}

@keyframes progress-animation {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

.progress-fill.alpha {
  background: linear-gradient(to right, #3B82F6, #60A5FA);
}

.progress-fill.theta {
  background: linear-gradient(to right, #8B5CF6, #A78BFA);
}

.progress-fill.delta {
  background: linear-gradient(to right, #EC4899, #F472B6);
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #a0aec0;
}

.player-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.volume-control {
  display: flex;
  align-items: center;
}

.volume-icon {
  color: #a0aec0;
  margin-right: 6px;
}

.volume-bar {
  width: 40px;
  height: 3px;
  background-color: #4a4a4a;
  border-radius: 1.5px;
  overflow: hidden;
}

.volume-fill {
  height: 100%;
  background-color: #a0aec0;
}

.transport-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skip-back-button,
.skip-forward-button {
  background: none;
  color: #a0aec0;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
}

.play-button {
  width: 36px;
  height: 36px;
  background: linear-gradient(to right, #4F46E5, #8B5CF6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  padding: 0;
}

.play-button.alpha {
  background: linear-gradient(to right, #3B82F6, #60A5FA);
}

.play-button.theta {
  background: linear-gradient(to right, #8B5CF6, #A78BFA);
}

.play-button.delta {
  background: linear-gradient(to right, #EC4899, #F472B6);
}

.play-button.disabled {
  opacity: 0.8;
  cursor: not-allowed;
  pointer-events: none;
}

.heart-button {
  color: #a0aec0;
  font-size: 18px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tracker */
.tracker-section {
  margin-top: 15px;
}

.tracker-list {
  max-height: 250px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tracker-list::-webkit-scrollbar {
  width: 5px;
}

.tracker-list::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.tracker-list::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 5px;
}

.tracker-item {
  display: flex;
  justify-content: space-between;
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

.tracker-user {
  display: flex;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.tracker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  margin-right: 8px;
  flex-shrink: 0;
}

.tracker-info {
  flex: 1;
  min-width: 0;
}

.tracker-info h4 {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tracker-week {
  font-size: 11px;
  color: #a0aec0;
  font-weight: normal;
  margin-left: 4px;
}

.tracker-result {
  font-size: 11px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tracker-meta {
  text-align: right;
  flex-shrink: 0;
  margin-left: 8px;
}

.tracker-day {
  display: inline-block;
  background-color: #4a4a4a;
  border-radius: 50px;
  padding: 1px 6px;
  font-size: 10px;
  margin-bottom: 2px;
}

.tracker-melody {
  font-size: 11px;
}

.tracker-melody.alpha {
  color: #60A5FA;
}

.tracker-melody.theta {
  color: #A78BFA;
}

.tracker-melody.delta {
  color: #F472B6;
}

.verified {
  color: #4ADE80;
  margin-left: 2px;
}

/* Chat */
.chat-panel {
  order: 3;
}

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

.online-badge {
  background-color: rgba(79, 70, 229, 0.2);
  padding: 3px 8px;
  border-radius: 50px;
  font-size: 11px;
  color: #a0aec0;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.chat-messages {
  height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 5px;
}

.chat-message {
  display: flex;
  margin-bottom: 10px;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  margin-right: 6px;
  flex-shrink: 0;
}

.chat-bubble {
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 8px 10px;
  max-width: 85%;
  word-break: break-word;
}

.chat-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.chat-username {
  font-weight: bold;
  font-size: 12px;
}

.chat-time {
  font-size: 10px;
  color: #a0aec0;
}

.chat-content {
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.4;
}

.chat-likes {
  margin-top: 4px;
  font-size: 11px;
  color: #60A5FA;
  display: flex;
  align-items: center;
}

.chat-likes-icon {
  margin-right: 2px;
}

.chat-input-container {
  display: flex;
  border-top: 1px solid #4a4a4a;
  padding-top: 12px;
}

.chat-input-container input {
  flex-grow: 1;
  background-color: #2a2a2a;
  border: none;
  border-radius: 8px 0 0 8px;
  color: white;
  padding: 8px 10px;
  font-size: 12px;
  min-width: 0;
}

.chat-input-container button {
  background-color: #4F46E5;
  color: white;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .dashboard-container {
    padding: 20px;
    margin: 20px auto;
  }
  
  .dashboard-header {
    margin-bottom: 20px;
  }
  
  .logo-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
    margin-right: 12px;
  }
  
  .logo-info h1 {
    font-size: 24px;
  }
  
  .logo-info p {
    font-size: 14px;
  }
  
  .dashboard-content {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }
  
  .panel {
    padding: 16px;
  }
  
  .playlist-panel {
    order: 1;
    flex: 1;
  }
  
  .player-panel {
    order: 2;
    flex: 1;
  }
  
  .chat-panel {
    order: 3;
    flex: 1;
  }
  
  .panel-title {
    font-size: 18px;
  }
  
  .melody-title {
    font-size: 14px;
  }
  
  .melody-description {
    font-size: 12px;
  }
  
  .player-artwork {
    width: 64px;
    height: 64px;
  }
  
  .player-details h3 {
    font-size: 18px;
  }
  
  .info-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .info-content {
    margin-bottom: 0;
  }
}

/* Fix iOS zoom on form elements */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select,
  textarea,
  input[type="text"],
  input[type="password"],
  input[type="datetime"],
  input[type="datetime-local"],
  input[type="date"],
  input[type="month"],
  input[type="time"],
  input[type="week"],
  input[type="number"],
  input[type="email"],
  input[type="url"],
  input[type="search"],
  input[type="tel"],
  input[type="color"] {
    font-size: 16px;
  }
}

/* Fix for iOS Safari tap highlight */
* {
  -webkit-tap-highlight-color: transparent;
}