/* My Decks, search, deck card, and FAB styles (extracted) */

.my-decks-layout {
  padding: var(--space-md) 0 var(--space-3xl);
  max-width: var(--container-max-width);
  margin: 0 auto;
}

/* Page-level token for deck card height (can be adjusted) */
:root {
  --deck-card-height: 64px;
}

.my-decks-header {
  margin-bottom: var(--space-xl);
}

.my-decks-header__content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.my-decks-title {
  font-size: var(--font-size-4xl);
  font-weight: 900;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-xs);
  line-height: var(--line-height-tight);
}


.my-decks-stats {
  display: flex;
  align-items: center;
  padding-top: var(--space-xs);
  flex-shrink: 0;
}

.my-decks-count {
  font-size: var(--font-size-sm);
  font-weight: 800;
  color: var(--color-primary);
  background-color: var(--color-info-bg);
  padding: var(--space-xs) var(--space-md);
  border-radius: 999px;
  border: none;
  white-space: nowrap;
}


.my-decks-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.language-section__title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--font-size-base);
  font-weight: 800;
  color: var(--color-text-primary);
  margin-bottom: var(--space-lg);
}

.language-section__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-muted);
}

.decks-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.deck-card-container {
  position: relative;
  /* enforce consistent card heights */
  height: var(--deck-card-height);
}

.deck-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-md) var(--space-lg);
  border: none;
  border-left: 4px solid var(--color-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  height: 100%;
}

.deck-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.deck-card:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.deck-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
}

.deck-card__name {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-card__score {
  background-color: var(--color-primary);
  color: white;
  padding: 3px var(--space-sm);
  border-radius: 999px;
  font-weight: 800;
  font-size: var(--font-size-xs);
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
}

.favorite-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  z-index: 10;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.favorite-btn:hover {
  background-color: rgba(252, 88, 138, 0.1);
}

/* Alternate the left border colors in the requested 5-color pattern.
   Use the container nth-child so the selector matches the page markup
   when each card is wrapped in a .deck-card-container element. */
.decks-grid .deck-card-container:nth-child(5n+1) .deck-card {
  border-left-color: var(--color-primary);
}
.decks-grid .deck-card-container:nth-child(5n+2) .deck-card {
  border-left-color: var(--color-accent);
}
.decks-grid .deck-card-container:nth-child(5n+3) .deck-card {
  border-left-color: var(--color-purple);
}
.decks-grid .deck-card-container:nth-child(5n+4) .deck-card {
  border-left-color: var(--color-success);
}
.decks-grid .deck-card-container:nth-child(5n) .deck-card {
  border-left-color: var(--color-badge);
}

.favorite-icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.favorite-btn--active .favorite-icon {
  color: var(--color-accent);
  fill: var(--color-accent);
}

.default-deck-icon {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
  fill: var(--color-accent);
}

.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-md);
}

.empty-state__content {
  max-width: 400px;
  margin: 0 auto;
}

.empty-state__title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
}

.empty-state__message {
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-bottom: var(--space-xl);
  line-height: var(--line-height-relaxed);
}

.create-deck-btn {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-lg);
  background: var(--color-primary);
  color: var(--color-surface);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: var(--shadow-cta);
  transition: all 0.2s ease;
  z-index: 40;
}

.create-deck-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(47, 111, 237, 0.5);
  color: var(--color-surface);
  background-color: var(--color-primary-dark);
}

.create-deck-btn:focus {
  outline: 3px solid rgba(47, 111, 237, 0.3);
  outline-offset: 2px;
}

.create-deck-btn:active {
  transform: scale(0.9) translateY(0);
}

.create-icon {
  width: 26px;
  height: 26px;
  stroke-width: 2.5;
}

@media (min-width: 481px) {
  .create-deck-btn {
    position: static;
    margin: var(--space-lg) auto 0;
    display: flex;
    width: auto;
    height: 48px;
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
    font-weight: 700;
    gap: var(--space-sm);
    max-width: 320px;
  }

  .create-deck-btn .create-icon {
    width: 20px;
    height: 20px;
  }

  .create-deck-btn::after {
    content: "Create Deck";
  }
}