/*
 * FoundContext v4 Deck Styles
 * Deck overview and card list components
 */

/* Deck Overview */
.deck-overview {
  margin-top: var(--space-2xl);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-color);
}

.deck-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-lg);
  background: var(--surface-secondary);
  border: none;
  cursor: pointer;
  transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.deck-toggle:hover,
.deck-toggle:focus {
  background: var(--primary-color-alpha);
}

.deck-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--primary-color);
  margin: 0;
}

.deck-content {
  padding: var(--space-lg);
  display: none;
}

.deck-content.expanded {
  display: block;
}

.deck-description {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
}

/* Card List */
.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.card-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color);
  text-decoration: none;
  transition: all var(--animation-duration-fast) var(--animation-easing);
  min-height: var(--touch-target-min);
}

.card-list-item:hover,
.card-list-item:focus {
  background: var(--primary-color-alpha);
  border-color: var(--primary-color);
  transform: translateX(2px);
}

.card-list-item.current {
  background: var(--primary-color);
  color: var(--text-inverse);
  border-color: var(--primary-color);
}

.card-list-item.current:hover {
  background: var(--primary-color-dark);
  border-color: var(--primary-color-dark);
  transform: none;
}

.card-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--background-secondary);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  flex-shrink: 0;
}

.card-list-item.current .card-number {
  background: var(--text-inverse);
  color: var(--primary-color);
}

.card-reference-text {
  flex: 1;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Deck Context Header */
.deck-context-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md);
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-lg);
}

/* Deck Index Drawer (Desktop) */
.deck-index-drawer {
  position: fixed;
  top: var(--header-height);
  left: -var(--nav-drawer-width);
  width: var(--nav-drawer-width);
  height: calc(100vh - var(--header-height));
  background: var(--background-overlay);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-color);
  transition: left var(--animation-duration-normal) var(--animation-easing);
  z-index: var(--z-fixed);
  overflow-y: auto;
}

.deck-index-drawer.open {
  left: 0;
}

.drawer-content {
  padding: var(--space-lg);
}

.drawer-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-md);
  color: var(--text-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-sm);
}

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

.drawer-deck-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color);
  text-decoration: none;
  transition: all var(--animation-duration-fast) var(--animation-easing);
}

.drawer-deck-item:hover,
.drawer-deck-item:focus {
  background: var(--primary-color-alpha);
  border-color: var(--primary-color);
}

.drawer-deck-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-xs);
}

.drawer-deck-meta {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 767px) {
  .deck-context-header {
    padding: var(--space-md) var(--space-sm);
  }
  
  .deck-progress {
    flex-direction: column;
    align-items: stretch;
  }
  
  .progress-text {
    text-align: center;
  }
  
  .card-list-item {
    padding: var(--space-md);
  }
  
  .card-reference-text {
    font-size: var(--font-size-base);
  }
  
  /* Hide deck drawer on mobile */
  .deck-index-drawer {
    display: none;
  }
}

@media (min-width: 768px) {
  .deck-context-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .deck-overview {
    margin-top: var(--space-3xl);
  }
  
  .card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-sm);
  }
}

/* Animation States */
@media (prefers-reduced-motion: reduce) {
  .deck-index-drawer {
    transition: none;
  }
  
  .card-list-item:hover {
    transform: none;
  }
}