/*
 * Indie Crates Embed Player Styles
 */

:root {
  --embed-bg: #14213d;
  --embed-text: #ffffff;
  --embed-accent: #fca311;
  --embed-muted: rgba(255, 255, 255, 0.6);
  --embed-border: rgba(255, 255, 255, 0.1);
  --embed-radius: 8px;
  --embed-font: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

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

.embed-body {
  font-family: var(--embed-font);
  background: transparent;
  -webkit-font-smoothing: antialiased;
}

.embed-player {
  display: flex;
  align-items: stretch;
  background: var(--embed-bg);
  border-radius: var(--embed-radius);
  overflow: hidden;
  height: 152px;
  max-width: 100%;
}

/* Artwork */
.embed-artwork {
  width: 152px;
  height: 152px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);

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

.embed-artwork-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--embed-muted);
}

/* Content */
.embed-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 16px;
  min-width: 0;
}

/* Track Info */
.embed-track-info {
  min-width: 0;
}

.embed-track-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--embed-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

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

/* Progress */
.embed-progress-container {
  cursor: pointer;
}

.embed-progress {
  height: 4px;
  background: var(--embed-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.embed-progress-bar {
  height: 100%;
  background: var(--embed-accent);
  width: 0%;
  transition: width 0.1s linear;
}

.embed-times {
  display: flex;
  justify-content: space-between;
}

.embed-time {
  font-size: 10px;
  color: var(--embed-muted);
  font-variant-numeric: tabular-nums;
}

/* Controls */
.embed-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.embed-controls-main {
  display: flex;
  align-items: center;
  gap: 4px;
}

.embed-btn {
  background: none;
  border: none;
  color: var(--embed-text);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;

  &:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  &:active {
    transform: scale(0.95);
  }
}

.embed-btn-play {
  width: 36px;
  height: 36px;
  background: var(--embed-accent);
  color: var(--embed-bg);

  &:hover {
    background: oklch(from var(--embed-accent) calc(l * 0.9) c h);
  }
}

.embed-icon {
  font-size: 14px;
  line-height: 1;
}

.embed-btn-play .embed-icon {
  font-size: 16px;
}

/* Volume */
.embed-volume {
  display: flex;
  align-items: center;
  gap: 4px;
}

.embed-btn-volume {
  padding: 4px;
}

.embed-volume-slider {
  width: 60px;
  height: 4px;
  appearance: none;
  background: var(--embed-border);
  border-radius: 2px;
  cursor: pointer;

  &::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    background: var(--embed-text);
    border-radius: 50%;
    cursor: pointer;
  }

  &::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: var(--embed-text);
    border-radius: 50%;
    cursor: pointer;
    border: none;
  }
}

/* Branding */
.embed-branding {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  background: rgba(0, 0, 0, 0.2);
  text-decoration: none;
  transition: background 0.15s ease;

  &:hover {
    background: rgba(0, 0, 0, 0.3);
  }
}

.embed-logo {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 11px;
  font-weight: 700;
  color: var(--embed-accent);
  letter-spacing: 0.05em;
}

/* Responsive - Compact mode */
@media (max-width: 400px) {
  .embed-player {
    height: auto;
    flex-direction: column;
  }

  .embed-artwork {
    width: 100%;
    height: 200px;
  }

  .embed-content {
    padding: 12px;
  }

  .embed-branding {
    width: 100%;
    height: 28px;
    writing-mode: horizontal-tb;
  }

  .embed-logo {
    writing-mode: horizontal-tb;
  }

  .embed-volume {
    display: none;
  }
}
