* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --text-color: #ffffff;
  --text-secondary: #b3b3b3;
  --accent-color: #FF8C00;
  --accent-hover: #e07d00;
  --border-color: #2a2a2a;
  --safe-area-top: env(safe-area-inset-top);
  --safe-area-bottom: env(safe-area-inset-bottom);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  height: 100vh;
  overflow: hidden;
  padding-top: var(--safe-area-top);
  padding-bottom: var(--safe-area-bottom);
}

.app-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header */
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  min-height: 70px;
  padding: 0 20px;
}

.logo-area {
  display: flex;
  align-items: center;
}

.header-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.header-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.icon-btn:hover {
  color: var(--accent-color);
  background: rgba(255,140,0,0.1);
}

/* Main Player */
.player-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Album Art Container - FIXED */
.album-art-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 30px;
}

.image-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

#album-art {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.ad-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: none;
  z-index: 2;
  cursor: pointer;
}

.ad-content {
  width: 100%;
  height: 100%;
}

.ad-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Song Info */
.song-info {
  text-align: center;
  margin-bottom: 30px;
}

#song-title {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

#song-artist {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Progress Bar */
.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 30px;
}

.time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 40px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-color);
  border-radius: 4px;
  transition: width 0.1s linear;
}

/* Controls */
.controls {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-bottom: 30px;
}

.control-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 12px;
  border-radius: 50%;
  transition: all 0.2s;
  min-width: 48px;
  min-height: 48px;
}

.control-btn:hover {
  color: var(--accent-color);
}

.main-btn {
  background: var(--accent-color);
  color: white;
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

/* Secondary Controls */
.secondary-controls {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.action-btn {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  min-height: 44px;
}

.action-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--surface-color);
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-secondary);
}

/* Playlist Sidebar */
#songs-sidebar {
  position: fixed;
  right: -320px;
  top: 0;
  width: 320px;
  height: 100%;
  background: var(--surface-color);
  border-left: 1px solid var(--border-color);
  transition: right 0.3s ease;
  z-index: 900;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-area-top);
}

#songs-sidebar.open {
  right: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.playlist-queue {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.playlist-queue li {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.playlist-queue li:hover {
  background: rgba(255,140,0,0.1);
}

.playlist-queue li.active {
  border-left: 3px solid var(--accent-color);
  background: rgba(255,140,0,0.15);
}

/* Mobile */
@media (max-width: 600px) {
  .image-wrapper {
    width: 220px;
    height: 220px;
  }
  
  #song-title {
    font-size: 1.2rem;
  }
  
  .main-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .action-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  
  #songs-sidebar {
    width: 280px;
  }
}

/* Light mode */
body.light-mode {
  --bg-color: #f5f5f5;
  --surface-color: #ffffff;
  --text-color: #121212;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
}

.ticker-container {
  background: #FF8C00;
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
}

.ticker-text {
  display: inline-block;
  animation: ticker 25s linear infinite;
  font-size: 14px;
  font-weight: bold;
  color: #121212;
}

.ticker-text span {
  margin-right: 50px;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.ticker-container:hover .ticker-text {
  animation-play-state: paused;
}

.contact-footer {
  margin-top: 40px;
  padding: 15px 0;
  text-align: center;
  border-top: 1px solid var(--border-color, #2a2a2a);
}

.contact-email {
  color: var(--accent-color, #FF8C00);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}

.contact-email:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Light mode */
body.light-mode .contact-email {
  color: #FF8C00;
}