/* Archive Manager Component Styles */
.archive-manager-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
}

.archive-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.archive-modal-container {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 16px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 900px;
  height: 80vh;
  min-height: 600px;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Header */
.archive-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, #667eea, #764ba2);
  position: relative;
}

.header-left h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.archive-summary {
  margin-top: 4px;
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  opacity: 0.9;
}

.summary-total {
  color: rgba(255, 255, 255, 0.9);
}

.summary-selected {
  color: #ffcf33;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.view-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px;
  gap: 2px;
}

.view-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.view-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Toolbar */
.archive-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-section {
  flex: 1;
  min-width: 200px;
}

.search-input-group {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  padding-right: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.filter-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: white;
  padding: 6px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.filter-select option {
  background: #1a1a2e;
  color: white;
}

.filter-reset-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: white;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.filter-reset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.refresh-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.refresh-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.bulk-btn {
  background: #667eea;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bulk-btn:hover:not(:disabled) {
  background: #5a6fd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.bulk-btn.danger {
  background: #e74c3c;
}

.bulk-btn.danger:hover:not(:disabled) {
  background: #c0392b;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Content Area */
.archive-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.archive-view {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.archive-analytics-view {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.archive-analytics-view .analytics-dashboard {
  flex: 1;
  min-height: 0;
}

/* Grid View */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.archive-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.archive-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.archive-card.selected {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.card-type {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.type-icon {
  font-size: 0.75rem;
}

.card-content {
  margin-bottom: 12px;
}

.card-name {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f8f9fa;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
}

.meta-label {
  color: rgba(255, 255, 255, 0.6);
}

.meta-value {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.card-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: white;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.card-action-btn.primary {
  background: #667eea;
  border-color: #667eea;
}

.card-action-btn.primary:hover {
  background: #5a6fd8;
}

.card-action-btn.danger {
  background: #e74c3c;
  border-color: #e74c3c;
}

.card-action-btn.danger:hover {
  background: #c0392b;
}

/* List View */
.archive-table-container {
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
}

.archive-table th {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
}

.archive-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
}

.archive-row {
  transition: all 0.2s ease;
}

.archive-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.archive-row.selected {
  background: rgba(102, 126, 234, 0.1);
}

.select-column,
.actions-column {
  width: 80px;
  text-align: center;
}

.type-column {
  width: 140px;
}

.date-column,
.size-column {
  width: 120px;
}

.archive-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.row-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.row-action-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s ease;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.row-action-btn.danger:hover {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

/* Analytics View */
.analytics-dashboard {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Analytics Loading & Error States */
.analytics-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  gap: 1rem;
  text-align: center;
}

.loading-spinner {
  font-size: 3rem;
  animation: bounce 1.5s ease-in-out infinite;
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.loading-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
}

.analytics-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  gap: 1rem;
  text-align: center;
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  border-radius: 8px;
  margin: 1rem;
}

.error-icon {
  font-size: 3rem;
}

.error-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-error);
}

.error-message {
  color: var(--color-text-secondary);
  max-width: 400px;
}

.retry-btn {
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.retry-btn:hover {
  background: var(--color-primary-dark);
}

/* Advanced Analytics Container */
.advanced-analytics-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  padding-bottom: 2rem;
  height: 100%;
  overflow-y: auto;
}

/* Analytics Header */
.archive-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--color-primary-light, rgba(102, 126, 234, 0.1)), var(--color-accent-light, rgba(80, 227, 194, 0.1)));
  border-radius: 6px;
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  flex-shrink: 0;
}

.analytics-title h3 {
  margin: 0 0 0.25rem 0;
  color: var(--color-text-primary, #f8f9fa);
  font-size: 1rem;
}

.analytics-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
  opacity: 0.8;
}

.analytics-actions {
  display: flex;
  gap: 0.5rem;
}

.analytics-btn {
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  color: #333;
}

.analytics-btn:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Analytics Sections */
.analytics-section {
  background: var(--color-panel-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.analytics-section h4 {
  margin: 0;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--color-secondary-light, rgba(118, 75, 162, 0.1)), var(--color-primary-light, rgba(102, 126, 234, 0.1)));
  color: var(--color-text-primary, #f8f9fa);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  font-weight: 600;
}

/* Overview Section */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
}

.overview-card {
  background: var(--color-card-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  padding: 0.75rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.overview-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary, #667eea);
  margin-bottom: 0.25rem;
}

.card-label {
  font-size: 0.7rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
  font-weight: 500;
}

/* Performance Section */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
}

.performance-card {
  background: var(--color-card-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  padding: 0.75rem;
}

.performance-card h5 {
  margin: 0 0 0.75rem 0;
  color: var(--color-text-primary, #f8f9fa);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  padding-bottom: 0.5rem;
}

/* Player Rankings */
.player-rankings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.player-rank-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--color-panel-bg, rgba(255, 255, 255, 0.05));
  border-radius: 4px;
  transition: background 0.2s;
}

.player-rank-item:hover {
  background: var(--color-highlight-bg, rgba(255, 255, 255, 0.08));
}

.rank-position {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--color-primary, #667eea), var(--color-accent, #50e3c2));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.rank-info {
  flex: 1;
}

.rank-name {
  font-weight: 600;
  color: var(--color-text-primary, #f8f9fa);
}

.rank-stats {
  font-size: 0.85rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
}

.rank-bar {
  width: 60px;
  height: 4px;
  background: var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 2px;
  overflow: hidden;
}

.rank-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary, #667eea), var(--color-accent, #50e3c2));
  transition: width 0.3s ease;
}

/* Distribution Charts */
.distribution-chart, .victory-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.distribution-item, .victory-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--color-panel-bg, rgba(255, 255, 255, 0.05));
  border-radius: 4px;
}

.dist-label, .victory-name {
  min-width: 80px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-primary, #f8f9fa);
}

.dist-bar {
  flex: 1;
  height: 8px;
  background: var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  overflow: hidden;
}

.dist-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-secondary, #764ba2), var(--color-primary, #667eea));
  transition: width 0.3s ease;
}

.dist-value {
  min-width: 80px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
}

.victory-icon {
  font-size: 1.2rem;
}

.victory-info {
  flex: 1;
}

.victory-count {
  font-size: 0.85rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
}

/* AI Analysis Section */
.ai-stats-summary {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(80, 227, 194, 0.1));
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
}

.ai-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-stat-label {
  font-weight: 500;
  color: var(--color-text-primary, #f8f9fa);
}

.ai-stat-value {
  font-weight: 600;
  color: var(--color-primary, #667eea);
}

.ai-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
}

.ai-card {
  background: var(--color-card-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  padding: 0.75rem;
}

.ai-card h5 {
  margin: 0 0 0.75rem 0;
  color: var(--color-text-primary, #f8f9fa);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  padding-bottom: 0.5rem;
}

/* Decision Patterns */
.decision-patterns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pattern-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--color-panel-bg, rgba(255, 255, 255, 0.05));
  border-radius: 4px;
}

.pattern-action {
  min-width: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-primary, #f8f9fa);
}

.pattern-bar {
  flex: 1;
  height: 6px;
  background: var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 3px;
  overflow: hidden;
}

.pattern-fill {
  height: 100%;
  background: linear-gradient(90deg, #4A90E2, #50E3C2);
  transition: width 0.3s ease;
}

.pattern-stats {
  min-width: 70px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
}

/* Confidence Distribution */
.confidence-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.confidence-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--color-panel-bg, rgba(255, 255, 255, 0.05));
  border-radius: 4px;
}

.conf-level {
  min-width: 80px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-primary, #f8f9fa);
}

.conf-bar {
  flex: 1;
  height: 6px;
  background: var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 3px;
  overflow: hidden;
}

.conf-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.conf-very-high { background: linear-gradient(90deg, #27AE60, #2ECC71); }
.conf-high { background: linear-gradient(90deg, #F39C12, #F1C40F); }
.conf-medium { background: linear-gradient(90deg, #3498DB, #5DADE2); }
.conf-low { background: linear-gradient(90deg, #E67E22, #F39C12); }
.conf-very-low { background: linear-gradient(90deg, #E74C3C, #EC7063); }

.conf-count {
  min-width: 40px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
}

/* Strategy Analysis */
.strategy-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.strategy-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-panel-bg, rgba(255, 255, 255, 0.05));
  border-radius: 4px;
  transition: background 0.2s;
}

.strategy-item:hover {
  background: var(--color-highlight-bg, rgba(255, 255, 255, 0.08));
}

.strategy-icon {
  font-size: 1.2rem;
}

.strategy-info {
  flex: 1;
}

.strategy-name {
  font-weight: 500;
  color: var(--color-text-primary, #f8f9fa);
}

.strategy-percentage {
  font-size: 0.85rem;
  color: var(--color-primary, #667eea);
  font-weight: 600;
}

.strategy-count {
  font-size: 0.85rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
}

/* Trends Section */
.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
}

.trend-card {
  background: var(--color-card-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  padding: 0.75rem;
}

.trend-card h5 {
  margin: 0 0 0.75rem 0;
  color: var(--color-text-primary, #f8f9fa);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  padding-bottom: 0.5rem;
}

/* Activity Timeline */
.activity-timeline {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.frequency-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 80px;
}

.freq-bar {
  width: 20px;
  min-height: 20px;
  background: linear-gradient(180deg, var(--color-primary, #667eea), var(--color-accent, #50e3c2));
  border-radius: 2px;
  transition: height 0.3s ease;
}

.freq-label {
  font-size: 0.7rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
  transform: rotate(-45deg);
  white-space: nowrap;
}

.freq-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-primary, #f8f9fa);
}

/* Player Activity Trends */
.player-activity {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-trend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--color-panel-bg, rgba(255, 255, 255, 0.05));
  border-radius: 4px;
}

.trend-player {
  flex: 1;
  font-weight: 500;
  color: var(--color-text-primary, #f8f9fa);
}

.trend-direction {
  font-size: 1.2rem;
}

.trend-direction.increasing { color: #27AE60; }
.trend-direction.decreasing { color: #E74C3C; }
.trend-direction.stable { color: var(--color-text-secondary, rgba(255, 255, 255, 0.6)); }

.trend-value {
  font-size: 0.9rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
}

/* Performance Trends */
.performance-trends {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.perf-trend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: var(--color-panel-bg, rgba(255, 255, 255, 0.05));
  border-radius: 4px;
}

.trend-metric {
  font-weight: 500;
  color: var(--color-text-primary, #f8f9fa);
}

.trend-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.trend-change.increasing { color: #27AE60; }
.trend-change.decreasing { color: #E74C3C; }
.trend-change.stable { color: var(--color-text-secondary, rgba(255, 255, 255, 0.6)); }

/* Insights Section */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
}

.insight-card {
  background: var(--color-card-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  padding: 0.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.insight-card.info {
  border-left: 4px solid #3498DB;
}

.insight-card.warning {
  border-left: 4px solid #F39C12;
}

.insight-card.success {
  border-left: 4px solid #27AE60;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.insight-icon {
  font-size: 1.2rem;
}

.insight-title {
  font-weight: 600;
  color: var(--color-text-primary, #f8f9fa);
}

.insight-message {
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.insight-type {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-tertiary, rgba(255, 255, 255, 0.4));
  opacity: 0.5;
}

.no-insights {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.no-insights-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-insights-text {
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
  font-style: italic;
}

/* Chart No Data */
.chart-no-data {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
  font-style: italic;
  text-align: center;
  background: var(--color-panel-bg, rgba(255, 255, 255, 0.05));
  border-radius: 4px;
  border: 1px dashed var(--color-border, rgba(255, 255, 255, 0.1));
}

/* Basic Analytics Grid (Legacy) */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.analytics-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
}

.analytics-card h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #f8f9fa;
  display: flex;
  align-items: center;
  gap: 8px;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 16px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-chart-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.type-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 80px;
  font-size: 14px;
}

.type-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.type-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.6s ease;
}

.type-stats {
  display: flex;
  gap: 4px;
  font-size: 12px;
  min-width: 60px;
  justify-content: flex-end;
}

.type-count {
  font-weight: 600;
}

.type-percentage {
  color: rgba(255, 255, 255, 0.6);
}

/* Storage Analysis Section */
.storage-section {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  margin-bottom: 16px;
}

.storage-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #f8f9fa;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.storage-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.storage-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: #667eea;
}

.metric-label {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-info,
.storage-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}

.timeline-item,
.storage-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-item:last-child,
.storage-item:last-child {
  border-bottom: none;
}

.timeline-label,
.storage-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
}

.timeline-value,
.storage-value {
  color: white;
  font-weight: 500;
  font-size: 0.75rem;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.empty-description {
  font-size: 14px;
  line-height: 1.5;
}

.empty-state-small {
  text-align: center;
  padding: 40px 20px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
}

/* Footer */
.archive-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.storage-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.storage-info .storage-label {
  font-weight: 500;
}

.storage-info .storage-value {
  color: #667eea;
  font-weight: 600;
}

.footer-right {
  display: flex;
  gap: 12px;
}

.btn-secondary,
.btn-primary {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: #667eea;
  color: white;
  border: 1px solid #667eea;
}

.btn-primary:hover {
  background: #5a6fd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Loading States */
.analytics-loading,
.analytics-error {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
}

.analytics-error {
  color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .archive-modal-container {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }
  
  .archive-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .toolbar-section {
    justify-content: stretch;
  }
  
  .actions-section {
    justify-content: center;
  }
  
  .archive-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .archive-modal-footer {
    flex-direction: column;
    gap: 12px;
  }
  
  .view-toggle {
    order: 2;
  }
  
  /* Enhanced Analytics Responsive */
  .archive-manager-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .analytics-actions {
    justify-content: center;
  }
  
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .performance-grid,
  .ai-analysis-grid,
  .trends-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }
  
  .activity-timeline {
    overflow-x: scroll;
    scrollbar-width: thin;
  }
  
  .player-rank-item {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .rank-bar {
    order: 3;
    width: 100%;
    margin-top: 0.25rem;
  }
  
  .insight-card {
    padding: 0.75rem;
  }
  
  .card-actions {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .overview-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .type-chart-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .type-stats {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .archive-modal-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .header-left h2 {
    font-size: 20px;
  }
  
  .card-actions {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .overview-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .type-chart-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .type-stats {
    justify-content: center;
  }
}