/* ==========================================================================
   components.css — Botoes, cards, badges, formularios, player
   Praticar Juntos — Yoga para Todos
   ========================================================================== */

/* ---------- Botoes ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn--hero {
  background: var(--audio-primary);
  color: var(--audio-dark);
  box-shadow: var(--shadow-glow);
  font-size: 1rem;
  padding: 0.875rem 2rem;
}

.btn--hero:hover {
  transform: scale(1.05);
  color: var(--audio-dark);
}

.btn--premium {
  background: linear-gradient(to right, var(--audio-primary), var(--audio-secondary));
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn--premium:hover {
  transform: scale(1.05);
  color: #fff;
}

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

.btn--outline:hover {
  background: hsl(85 35% 45% / 0.15);
  border-color: var(--accent);
  color: var(--foreground);
}

.btn--ghost {
  background: transparent;
  color: var(--foreground);
}

.btn--ghost:hover {
  background: hsl(85 35% 45% / 0.15);
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.btn svg,
.btn .icon {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid;
}

.badge--audio {
  background: hsl(38 75% 68% / 0.2);
  color: var(--audio-primary);
  border-color: hsl(38 75% 68% / 0.3);
}

.badge--epub {
  background: hsl(85 35% 45% / 0.2);
  color: var(--audio-green);
  border-color: hsl(85 35% 45% / 0.3);
}

.badge--online {
  background: hsl(355 35% 60% / 0.2);
  color: var(--audio-secondary);
  border-color: hsl(355 35% 60% / 0.3);
}

.badge--free {
  background: var(--audio-primary);
  color: var(--audio-dark);
  border-color: var(--audio-primary);
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px hsl(340 18% 4% / 0.3);
  transition: var(--transition);
}

@media (min-width: 768px) {
  .card {
    padding: 2rem;
  }
}

.card:hover {
  border-color: hsl(38 75% 68% / 0.3);
  box-shadow: var(--shadow-card);
}

.card__icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.card__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card__text {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* ---------- Stars ---------- */
.stars {
  display: inline-flex;
  gap: 0.125rem;
  color: var(--audio-primary);
}

.stars svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* ---------- Gradient text ---------- */
.text-gradient {
  background: linear-gradient(to right, var(--foreground), var(--muted-foreground));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient--gold {
  background: linear-gradient(to right, var(--audio-primary), var(--audio-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Subtitle / muted ---------- */
.text-muted {
  color: var(--muted-foreground);
}

.text-primary {
  color: var(--primary);
}

/* ---------- Section header ---------- */
.section-header {
  margin-bottom: 2.5rem;
}

.section-header p {
  color: var(--muted-foreground);
  max-width: 40rem;
}

.section-header.text-center p {
  margin-inline: auto;
}

/* ---------- Feature list ---------- */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-list__item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.feature-list__check {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  color: var(--audio-primary);
}

/* ---------- Author card ---------- */
.author-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.author-card__avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 2rem;
  flex-shrink: 0;
}

.author-card__name {
  font-size: 1.5rem;
  font-weight: 700;
}

.author-card__role {
  font-size: 0.875rem;
  color: var(--audio-secondary);
  margin-top: 0.25rem;
}

.author-info-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.author-info-list dt {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--primary);
}

.author-info-list dd {
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* ---------- Book cover ---------- */
.book-cover {
  position: relative;
  max-width: 20rem;
  margin-inline: auto;
}

.book-cover img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  width: 100%;
  height: auto;
}

.book-cover__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

/* ---------- Audio Player ---------- */
.player {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .player {
    padding: 2rem;
  }
}

.player__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.player__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  color: var(--foreground);
  width: 2.5rem;
  height: 2.5rem;
}

.player__btn--play {
  background: var(--primary);
  color: var(--audio-dark);
  width: 3.5rem;
  height: 3.5rem;
}

.player__btn:hover {
  transform: scale(1.1);
}

.player__btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.player__btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.player__btn--play svg {
  width: 1.5rem;
  height: 1.5rem;
}

.player__progress {
  width: 100%;
  margin-bottom: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 0.375rem;
  background: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.progress-bar__fill {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  width: 0%;
  transition: width 0.15s linear;
}

.player__time {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.player__now-playing {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.player__chapter-info {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

/* Playlist */
.playlist {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.playlist__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.playlist__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 25rem;
  overflow-y: auto;
}

.playlist__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  color: var(--foreground);
  font-size: 0.875rem;
}

.playlist__item:hover {
  background: hsl(340 15% 18%);
}

.playlist__item.is-active {
  background: hsl(38 75% 68% / 0.1);
  color: var(--primary);
}

.playlist__item-num {
  width: 1.75rem;
  flex-shrink: 0;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.playlist__item-title {
  flex: 1;
}

.playlist__item-duration {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

/* Audio bars decorative animation */
.audio-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 1rem;
}

.audio-bars__bar {
  width: 3px;
  background: var(--primary);
  border-radius: 1px;
  animation: audioBar 1.2s ease-in-out infinite;
}

.audio-bars__bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.audio-bars__bar:nth-child(2) { height: 70%; animation-delay: 0.15s; }
.audio-bars__bar:nth-child(3) { height: 50%; animation-delay: 0.3s; }
.audio-bars__bar:nth-child(4) { height: 80%; animation-delay: 0.45s; }

@keyframes audioBar {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.4); }
}

/* ---------- FAQ / Accordion ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: none;
  cursor: pointer;
  color: var(--foreground);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  transition: var(--transition);
}

.faq-item__question:hover {
  background: hsl(340 15% 15%);
}

.faq-item__question:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.faq-item__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--muted-foreground);
}

.faq-item[open] .faq-item__icon {
  transform: rotate(180deg);
}

.faq-item__answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--muted-foreground);
  line-height: 1.8;
  font-size: 0.875rem;
}

.faq-item__answer a {
  color: var(--primary);
}

/* ---------- Footer ---------- */
.footer {
  padding-block: 3rem;
}

.footer__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer__desc {
  color: var(--muted-foreground);
  max-width: 32rem;
  font-size: 0.875rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.footer__bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ---------- Tags row ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  color: var(--muted-foreground);
}

/* ---------- CTA row ---------- */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ---------- Author meta in hero ---------- */
.hero-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.hero-author__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.hero-author__name {
  font-weight: 600;
  font-size: 0.875rem;
}

.hero-author__role {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ---------- Visually hidden ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
