/* SSP Offline Player - Mobile First */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --teal: #00897b;
  --teal-dark: #00695c;
  --teal-light: #e0f2f1;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--card-bg);
  border-bottom: 3px solid var(--teal);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header .logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: -0.5px;
}
.header .logo span { color: var(--teal-dark); font-weight: 400; }
.header .badge {
  background: var(--teal);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

/* Main Content */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}
.main h1 {
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 4px;
}
.main .subtitle {
  font-size: 18px;
  color: var(--teal-dark);
  font-weight: 600;
  margin-bottom: 6px;
}
.main .desc {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 20px;
}

/* Playlist Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* Playlist Card */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.card-body {
  padding: 14px;
}
.card-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}
.card-body p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-body .listen-btn {
  display: inline-block;
  margin-top: 10px;
  color: var(--teal);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Player Overlay */
.player-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.player-overlay.active { display: flex; }

.player {
  background: var(--card-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.player-header {
  position: relative;
}
.player-header img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.player-header .close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-info {
  padding: 16px 20px 8px;
}
.player-info h2 {
  font-size: 20px;
  font-weight: 600;
}
.player-info .track-label {
  color: var(--teal);
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

/* Track List */
.track-list {
  display: flex;
  gap: 6px;
  padding: 8px 20px;
  overflow-x: auto;
}
.track-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 2px solid var(--teal);
  border-radius: 20px;
  background: white;
  color: var(--teal);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.track-btn.active {
  background: var(--teal);
  color: white;
}

/* Audio Controls */
.audio-controls {
  padding: 12px 20px 20px;
}
.progress-container {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 8px;
  position: relative;
}
.progress-bar {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}
.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 12px;
}
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 24px;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctrl-btn:hover { background: var(--teal-light); }
.ctrl-btn.play-btn {
  background: var(--teal);
  color: white;
  width: 56px;
  height: 56px;
  font-size: 28px;
  border-radius: 50%;
}
.ctrl-btn.play-btn:hover { background: var(--teal-dark); }

/* SVG icons inline */
.icon { width: 24px; height: 24px; fill: currentColor; }
.play-btn .icon { width: 28px; height: 28px; }

/* Level Tabs */
.level-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.level-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  background: white;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.level-tab.active {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal-dark);
}
.level-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.connect-dot { background: #4db6ac; }
.core-dot { background: #00897b; }
.balance-dot { background: #00695c; }

.level-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Card level label */
.card-level {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* Player level badge */
.level-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  color: white;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
