/* =======================================================================
   File: styles-components.css
   Date: 2025-09-07
   Version: 1.0.9
   Notes:
   - Removed legacy version mentions in comments.
   - Consolidated all dark-theme rules into a single section.
   - Non-dark selectors left unchanged.
   ======================================================================= */

/* styles-components.css - v1.0.0 - December 27, 2024 */
/* UI Components - Type-ahead, Badges, Cards, Tabs */
/* Split from styles.css v3.4.0 for better maintainability */

/* Type-Ahead Dropdown Styles */
.type-ahead-container {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.type-ahead-input {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: 15px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-subtle);
  width: 100%;
}

.type-ahead-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
  outline: none;
}

.type-ahead-input.loading {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3e%3cpath d='M21 12c0 4.97-4.03 9-9 9s-9-4.03-9-9 4.03-9 9-9c.395 0 .785.025 1.168.073'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
  animation: spin 1s linear infinite;
}

.type-ahead-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  box-shadow: var(--shadow-large);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 4px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.type-ahead-option {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.type-ahead-option:last-child {
  border-bottom: none;
}

.type-ahead-option:hover,
.type-ahead-option.highlighted {
  background: var(--accent-light);
  transform: scale(1.02);
}

.type-ahead-option-name {
  font-weight: 600;
  color: var(--text-primary);
}

.type-ahead-option-id {
  font-size: 14px;
  color: var(--text-muted);
  background: var(--glass-bg);
  padding: 2px 8px;
  border-radius: 8px;
}

.type-ahead-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.type-ahead-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.type-ahead-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.type-ahead-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.3s ease;
  font-size: 18px;
  line-height: 1;
}

.type-ahead-clear:hover {
  color: var(--accent-color);
  background: var(--accent-light);
}

/* Month Tabs */
.month-tabs {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto 20px;
  margin-left: 40px;
  margin-right: 40px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  box-shadow: var(--glass-shadow);
}

.month-tab {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
}

.month-tab:hover,
.month-tab.active {
  background: var(--success-gradient);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* Status Chips */
.status-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: inline-block;
  color: white;
}

.status-chip.closed {
  background: var(--status-closed);
}

.status-chip.due-soon {
  background: var(--status-due-soon);
}

.status-chip.closing-soon {
  background: var(--status-closing-soon);
}

.status-chip.open {
  background: var(--status-open);
}

/* Prize Tags */
.prize-tag {
  background: var(--glass-bg);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin: 4px 6px 4px 0;
  display: inline-block;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.clickable-prize {
  cursor: pointer;
}

.clickable-prize:hover {
  background: var(--accent-gradient);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* Rank Badges */
.rank-badge {
  background: var(--primary-gradient);
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 800;
  margin-right: 12px;
  display: inline-block;
  box-shadow: var(--shadow-subtle);
}

.top-rank .rank-badge {
  background: var(--warning-gradient);
}

/* Info Display Cards */
.prize-info-display, .artist-info-display {
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 40px;
}

.prize-summary-card, .artist-summary-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
}

.prize-header, .artist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.prize-header h3, .artist-header h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.prize-id-badge, .artist-id-badge {
  background: var(--accent-light);
  color: var(--accent-color);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.prize-stats, .artist-stats {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

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

.stat-item strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-color);
  margin-bottom: 4px;
}

.stat-item small {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Appearances styling */
.appearances-count {
  font-size: 20px;
  font-weight: bold;
  color: var(--accent-color);
  display: block;
}

.appearances-label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.artist-id {
  color: var(--text-muted);
  font-size: 12px;
}

.various-prizes {
  color: var(--text-muted);
  font-style: italic;
  font-size: 14px;
}

/* Expand/Collapse buttons */
.expand-prizes, .collapse-prizes {
  background: none;
  border: none;
  color: var(--accent-color);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 12px;
  background-color: var(--accent-light);
  transition: all 0.3s ease;
  margin-top: 6px;
  display: inline-block;
}

.expand-prizes:hover, .collapse-prizes:hover {
  background-color: var(--accent-color);
  color: white;
}

/* Enhanced clickable artist names */
.clickable-artist.enhanced {
  color: #4A90E2;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.clickable-artist.enhanced:hover {
  color: #357ABD;
  border-bottom-color: #357ABD;
  background-color: rgba(74, 144, 226, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
}

.click-indicator {
  font-size: 12px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.clickable-artist.enhanced:hover .click-indicator {
  opacity: 1;
}

.artist-name-readonly {
  color: inherit;
}

/* Responsive adjustments for components */
@media (max-width: 968px) {
  .type-ahead-container {
    min-width: auto;
    width: 100%;
  }
  
  .month-tabs {
    margin: 0 30px 20px;
    padding: 16px;
  }
  
  .prize-info-display, .artist-info-display {
    padding: 0 30px;
  }
}

@media (max-width: 640px) {
  .month-tabs {
    margin: 0 20px 20px;
    gap: 8px;
  }
  
  .month-tab {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .prize-info-display, .artist-info-display {
    padding: 0 20px;
  }
  
  .stat-item strong {
    font-size: 20px;
  }
}

/* ADD THESE STYLES TO styles-components.css - Winner Integration Styling */

/* Winner and Finalist Badge Styling */
.winner-badge {
  background: linear-gradient(135deg, #ffd700, #ffb347);
  color: #8b4513;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 4px 12px;
  border-radius: 16px;
  display: inline-block;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(139, 69, 19, 0.2);
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.finalist-badge {
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 4px 12px;
  border-radius: 16px;
  display: inline-block;
  border: 1px solid var(--border-color);
}

/* Dark theme adjustments for badges */
                                                                                                                

                                                                                                          

/* Table Row Styling for Winners vs Finalists */
.winner-row {
  background: linear-gradient(90deg, 
      rgba(255, 215, 0, 0.08) 0%, 
      rgba(255, 215, 0, 0.03) 50%, 
      transparent 100%);
  border-left: 3px solid #ffd700;
}

.winner-row:hover {
  background: linear-gradient(90deg, 
      rgba(255, 215, 0, 0.12) 0%, 
      rgba(255, 215, 0, 0.06) 50%, 
      rgba(255, 215, 0, 0.02) 100%);
}

.finalist-row {
  background: var(--surface-primary);
  border-left: 3px solid transparent;
}

.finalist-row:hover {
  background: var(--surface-hover);
}

/* Dark theme row adjustments */
                                                                                                                                                                                                         

                                                                                                                                                                                             

/* Result Cell Styling */
.result-cell {
  padding: 12px 16px;
  vertical-align: middle;
}

.category-detail {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 4px;
  font-style: italic;
}

/* Enhanced Artist Stats Display for Wins */
.artist-stats .stat-item:nth-child(2) {
  border-left: 2px solid #ffd700;
  padding-left: 12px;
  margin-left: 8px;
}

                                                                                           

/* Artist Profile Stats Enhancement */
.artist-profile-stats .profile-stat-item:nth-child(2) {
  background: linear-gradient(135deg, 
      rgba(255, 215, 0, 0.1), 
      rgba(255, 179, 71, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

                                                                                                                                                                                                                             

/* Loading state for winner data */
.winner-loading {
  background: linear-gradient(90deg, 
      rgba(255, 215, 0, 0.1), 
      rgba(255, 215, 0, 0.3), 
      rgba(255, 215, 0, 0.1));
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .winner-badge, .finalist-badge {
      font-size: 0.75rem;
      padding: 3px 8px;
  }
  
  .category-detail {
      font-size: 0.7rem;
  }
  
  .winner-row, .finalist-row {
      border-left-width: 2px;
  }
}

/* --------------------------------------------------------------------------
 * File: styles-components.css (patch)
 * Section: Sortable table headers
 * Date: 2025-08-31
 * Purpose: Visual affordance for sortable columns + sort direction indicator.
 * ------------------------------------------------------------------------ */
 table thead th.sortable {
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

table thead th.sortable::after {
  content: '⇅';
  font-size: 0.8em;
  opacity: 0.5;
  margin-left: 6px;
}

table thead th.sorted-asc::after {
  content: '▲';
  opacity: 0.9;
}

table thead th.sorted-desc::after {
  content: '▼';
  opacity: 0.9;
}
/* ------------------------ End sortable table headers --------------------- */

/* EOF */


/* =======================================================================
   Dark Theme Consolidated Section
   (All rules targeting [data-theme="dark"] or .dark-mode grouped here)
   ======================================================================= */
[data-theme="dark"] .winner-badge {
  background: linear-gradient(135deg, #b8860b, #daa520);
  color: #2c1810;
}

[data-theme="dark"] .finalist-badge {
  background: var(--surface-tertiary);
  color: var(--text-muted);
}

[data-theme="dark"] .winner-row {
  background: linear-gradient(90deg, 
      rgba(184, 134, 11, 0.15) 0%, 
      rgba(184, 134, 11, 0.08) 50%, 
      transparent 100%);
  border-left-color: #b8860b;
}

[data-theme="dark"] .winner-row:hover {
  background: linear-gradient(90deg, 
      rgba(184, 134, 11, 0.2) 0%, 
      rgba(184, 134, 11, 0.12) 50%, 
      rgba(184, 134, 11, 0.04) 100%);
}

[data-theme="dark"] .artist-stats .stat-item:nth-child(2) {
  border-left-color: #b8860b;
}

[data-theme="dark"] .artist-profile-stats .profile-stat-item:nth-child(2) {
  background: linear-gradient(135deg, 
      rgba(184, 134, 11, 0.2), 
      rgba(218, 165, 32, 0.1));
  border-color: rgba(184, 134, 11, 0.3);
}
/* === End Dark Theme Section === */

/* EOF */
