/**
 * KbitMusic Lite - Modern Lightweight CSS
 * White Background & Blue Accent Theme (#0066ff)
 */

:root {
  --primary: #0066ff;
  --primary-hover: #0052cc;
  --primary-light: #e6f0ff;
  --bg-main: #ffffff;
  --bg-card: #f8fafc;
  --bg-subtle: #f1f5f9;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --max-width: 1200px;
  --header-height: 64px;
  --player-height: 80px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.5;
  padding-bottom: var(--player-height);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Navbar */
.site-header {
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.brand-logo svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.header-search {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.header-search input {
  width: 100%;
  padding: 8px 16px 8px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.header-search input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.header-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Search Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}

.search-results-dropdown.active {
  display: block;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

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

.search-item:hover {
  background: var(--bg-card);
}

.search-item img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

.search-item-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.search-item-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Hero & Banners */
.hero-banner {
  background: linear-gradient(135deg, #0066ff 0%, #0044bb 100%);
  color: #ffffff;
  padding: 48px 24px;
  border-radius: var(--radius-lg);
  margin: 24px 0;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.hero-banner h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-banner p {
  font-size: 16px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 24px auto;
}

.hero-search-box {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.hero-search-box input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 16px;
  outline: none;
  box-shadow: var(--shadow-lg);
}

.hero-search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--text-muted);
}

/* Section Header */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px 0;
}

.section-title h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title a {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* Song Grid & List */
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.song-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.song-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.song-cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--bg-subtle);
}

.song-cover-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay-btn {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
}

.song-card:hover .play-overlay-btn {
  opacity: 1;
}

.play-circle-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s;
}

.play-circle-icon:hover {
  transform: scale(1.08);
}

.song-title-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  display: block;
}

.song-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.song-card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Song List (Horizontal Rows) */
.song-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.song-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  gap: 16px;
  transition: background 0.15s;
}

.song-row-item:hover {
  background: var(--bg-subtle);
}

.song-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.song-row-cover {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.song-row-info {
  min-width: 0;
}

.song-row-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-row-artist {
  font-size: 13px;
  color: var(--text-muted);
}

.song-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

/* Album & Artist Grids */
.album-grid, .artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.album-card, .artist-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  transition: transform 0.2s;
}

.album-card:hover, .artist-card:hover {
  transform: translateY(-3px);
}

.album-cover {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-bottom: 8px;
}

.artist-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px auto;
}

/* Genre Badges */
.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.genre-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  transition: all 0.2s;
}

.genre-pill:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Song Detail Page Layout */
.song-detail-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  margin: 24px 0;
}

@media (max-width: 768px) {
  .song-detail-container {
    grid-template-columns: 1fr;
  }
}

.song-cover-large {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.song-info-panel h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.song-info-panel .artist-subtitle {
  font-size: 18px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 16px;
  display: inline-block;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* Audio Player Bar */
.sticky-player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-height);
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: 900;
  display: flex;
  align-items: center;
}

.player-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.player-song-details {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 240px;
  flex-shrink: 0;
}

.player-song-details img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.player-song-details-text {
  min-width: 0;
}

.player-song-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-song-artist {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls-center {
  flex: 1;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.player-btn-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-btn-main {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.time-text {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

.progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-subtle);
  outline: none;
  cursor: pointer;
  accent-color: var(--primary);
}

.player-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 200px;
  justify-content: flex-end;
}

.eq-btn {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Equalizer Modal */
.eq-modal {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 320px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 950;
  display: none;
}

.eq-modal.active {
  display: block;
}

.eq-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.eq-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.eq-control-group {
  margin-bottom: 12px;
}

.eq-control-group label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.eq-control-group input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

/* Lyrics & Accordions */
.lyrics-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: monospace;
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.8;
  margin-top: 16px;
}

/* Breadcrumbs */
.breadcrumbs-container {
  margin: 16px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  flex-wrap: wrap;
}

.breadcrumbs-list a {
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.breadcrumbs-list .separator {
  color: var(--border-color);
}

.breadcrumbs-list .active {
  color: var(--text-dark);
  font-weight: 600;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

/* Admin Dashboard & Forms */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-number {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
}

.stat-card-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-dark);
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  margin-top: 48px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
  .header-search {
    display: none; /* Mobile view toggles search overlay or search page */
  }
  .hero-banner {
    padding: 24px 16px;
  }
  .hero-banner h1 {
    font-size: 22px;
  }
  .song-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .player-song-details {
    width: 140px;
  }
  .player-right-actions {
    width: auto;
  }
}
