/**
 * AniWorld - Card Styles
 *
 * Card and panel component styles including
 * series cards and stat cards.
 */

/* Series Card */
.series-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-duration) var(--transition-easing);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.series-card:hover {
  box-shadow: var(--shadow-elevated);
  transform: translateY(-1px);
}

.series-card.selected {
  border-color: var(--color-accent);
  background-color: var(--color-surface-hover);
}

.series-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-md);
  position: relative;
}

.series-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

.series-info h3 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: var(--font-size-subtitle);
  color: var(--color-text-primary);
  line-height: 1.3;
}

.series-folder {
  font-size: var(--font-size-caption);
  color: var(--color-text-tertiary);
  margin-bottom: var(--spacing-sm);
}

.series-stats {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: auto;
}

.series-site {
  font-size: var(--font-size-caption);
  color: var(--color-text-tertiary);
}

/* Series Card Status Indicators */
.series-status {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.status-missing {
  color: var(--color-warning);
  font-size: 1.2em;
}

.status-complete {
  color: var(--color-success);
  font-size: 1.2em;
}

/* NFO Status Badge */
.nfo-badge {
  font-size: 1em;
  margin-left: var(--spacing-xs);
}

.nfo-badge.nfo-exists {
  color: var(--color-success);
}

.nfo-badge.nfo-missing {
  color: var(--color-text-tertiary);
  opacity: 0.5;
}

/* Series Card Loading State */
.series-card.loading {
  border-color: var(--color-info);
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
}

/* Loading Indicator */
.loading-indicator {
  background: var(--color-surface-secondary, var(--color-surface));
  border-radius: var(--border-radius-md);
  padding: var(--spacing-md);
  margin-top: var(--spacing-md);
  border: 1px solid var(--color-border);
}

.loading-status {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.status-text {
  font-size: var(--font-size-caption);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.status-text i.fa-spinner {
  color: var(--color-info);
}

.progress-items {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-caption);
}

.progress-item.completed {
  color: var(--color-success);
}

.progress-item.completed .icon {
  color: var(--color-success);
}

.progress-item.pending {
  color: var(--color-text-tertiary);
}

.progress-item.pending .icon {
  color: var(--color-text-tertiary);
}

.progress-item .icon {
  font-size: 1.1em;
  font-weight: bold;
}

.progress-item .label {
  font-size: 0.9em;
}

/* Series Card Actions */
.series-actions {
  display: flex;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
}

.series-actions .btn {
  flex: 1;
  font-size: var(--font-size-caption);
  padding: var(--spacing-xs) var(--spacing-sm);
}

.series-actions .btn i {
  margin-right: var(--spacing-xs);
}

/* Series Card States */
.series-card.has-missing {
  border-left: 4px solid var(--color-warning);
}

.series-card.complete {
  border-left: 4px solid var(--color-success);
  opacity: 0.8;
}

.series-card.complete .series-checkbox {
  opacity: 0.5;
  cursor: not-allowed;
}

.series-card.complete:not(.selected) {
  background-color: var(--color-background-secondary);
}

/* Dark theme adjustments */
[data-theme="dark"] .series-card.complete:not(.selected) {
  background-color: var(--color-background-tertiary);
}

/* Stat Card */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  transition: all var(--transition-duration) var(--transition-easing);
}

.stat-card:hover {
  background: var(--color-surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.stat-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--color-primary-rgb), 0.1);
}

.stat-value {
  font-size: var(--font-size-title);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1;
}

.stat-label {
  font-size: var(--font-size-caption);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Download Card */
.download-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  transition: all var(--transition-duration) var(--transition-easing);
}

.download-card:hover {
  background: var(--color-surface-hover);
  transform: translateX(4px);
}

.download-card.active {
  border-left: 4px solid var(--color-primary);
}

.download-card.completed {
  border-left: 4px solid var(--color-success);
  opacity: 0.8;
}

.download-card.failed {
  border-left: 4px solid var(--color-error);
}

.download-card.pending {
  border-left: 4px solid var(--color-warning);
  position: relative;
}

.download-card.pending.high-priority {
  border-left-color: var(--color-accent);
  background: linear-gradient(90deg, rgba(var(--color-accent-rgb), 0.05) 0%, transparent 10%);
}

.download-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.download-info h4 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: var(--font-size-subtitle);
  color: var(--color-text-primary);
}

.download-info p {
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-body);
}

.download-info small {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-caption);
}

.download-actions {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
}

.priority-indicator {
  color: var(--color-accent);
  margin-right: var(--spacing-sm);
}

/* Queue Position */
.queue-position {
  position: absolute;
  top: var(--spacing-sm);
  left: 48px;
  background: var(--color-warning);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-caption);
  font-weight: 600;
}

.download-card.pending .download-info {
  margin-left: 80px;
}

.download-card.pending .download-header {
  padding-left: 0;
}

/* Dark Theme Adjustments for Cards */
[data-theme="dark"] .stat-card {
  background: var(--color-surface-dark);
  border-color: var(--color-border-dark);
}

[data-theme="dark"] .stat-card:hover {
  background: var(--color-surface-hover-dark);
}

[data-theme="dark"] .download-card {
  background: var(--color-surface-dark);
  border-color: var(--color-border-dark);
}

[data-theme="dark"] .download-card:hover {
  background: var(--color-surface-hover-dark);
}
