/* ============================================
   ระบบรายงานผลคะแนนเลือกตั้ง สส. อำเภอสวรรคโลก
   Premium UI Design - v2.0
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables */
:root {
  /* Premium Color Palette */
  --primary: #0f172a;
  --primary-light: #1e293b;
  --primary-dark: #020617;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-dark: #d97706;
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f97316;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Gradient Colors */
  --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #fcd34d 100%);
  --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  --gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%);
  --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);

  /* Glass Effect */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

  /* Backgrounds */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-dark: #0f172a;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #ffffff;

  /* Borders */
  --border-color: #e2e8f0;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-lg: 24px;
  --border-radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(245, 158, 11, 0.4);
  --shadow-blue: 0 10px 40px rgba(59, 130, 246, 0.3);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Prompt', sans-serif;
  background: var(--bg-primary);
  background-image:
    radial-gradient(at 20% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    radial-gradient(at 80% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

h4 {
  font-size: 1.125rem;
  font-weight: 500;
}

/* Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ==================== HEADER ==================== */
.header {
  background: var(--gradient-dark);
  color: var(--text-light);
  padding: var(--space-lg) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.header__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  position: relative;
}

.header__title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header__icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.header__text h1 {
  font-size: 1.75rem;
  background: linear-gradient(90deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__text p {
  font-size: 0.95rem;
  opacity: 0.8;
  font-weight: 300;
}

.header__nav {
  display: flex;
  gap: var(--space-sm);
}

.header__link {
  color: var(--text-light);
  text-decoration: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius-full);
  background: var(--gradient-gold);
  color: var(--primary-dark);
  font-weight: 600;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-glow);
}

.header__link:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.6);
}

/* ==================== CARDS ==================== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
  border: 1px solid var(--glass-border);
  transition: var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid transparent;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    var(--gradient-primary) border-box;
  border-radius: 2px;
}

.card__icon {
  font-size: 1.75rem;
}

.card__title {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==================== STATS CARDS ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--gradient-primary);
  color: var(--text-light);
  padding: var(--space-xl);
  border-radius: var(--border-radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-blue);
}

.stat-card__label {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: var(--space-xs);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card__value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-card__sub {
  font-size: 0.9rem;
  opacity: 0.85;
  font-weight: 500;
}

.stat-card--accent {
  background: var(--gradient-gold);
  color: var(--primary-dark);
}

.stat-card--accent:hover {
  box-shadow: var(--shadow-glow);
}

.stat-card--success {
  background: var(--gradient-success);
}

/* ==================== TABS ==================== */
.tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  padding: var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--border-radius-full);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab {
  flex: 1;
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--border-radius-full);
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
}

.tab:hover:not(.active) {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

.tab.active {
  background: var(--gradient-primary);
  color: var(--text-light);
  box-shadow: var(--shadow-lg);
}

/* ==================== CANDIDATE LIST ==================== */
.candidate-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.candidate-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  padding-left: calc(var(--space-lg) + 8px);
  margin-left: 8px;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  position: relative;
  overflow: visible;
}

.candidate-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--border-color);
  transition: var(--transition-normal);
}

.candidate-item:hover {
  transform: translateX(8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--info);
}

.candidate-item:hover::before {
  background: var(--info);
}

.candidate-item--winner {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-card) 100%);
  border-color: var(--success);
}

.candidate-item--winner::before {
  background: var(--gradient-success);
  width: 6px;
}

.candidate-item--winner::after {
  content: '🏆';
  position: absolute;
  right: 110px;
  /* Move away from score */
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  opacity: 0.15;
}

.candidate__number {
  min-width: 60px;
  /* Flexible width */
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: var(--text-light);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}



.candidate__photo {
  width: 80px;
  height: 100px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 3px solid var(--primary);
  flex-shrink: 0;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.candidate-item:hover .candidate__photo {
  transform: scale(1.05);
  border-color: var(--info);
}

.candidate__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.candidate__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.candidate__name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.candidate__party {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.candidate__number {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
  z-index: 5;
}

.candidate__party-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
}

.candidate__party-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  background: white;
  padding: 2px;
}

.candidate__bar {
  height: 10px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.candidate__bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--border-radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.candidate__bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.candidate__score {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 120px;
  text-align: right;
  font-feature-settings: "tnum";
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.form-label--required::after {
  content: ' *';
  color: var(--danger);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-normal);
  background: var(--bg-card);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--info);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.form-input--number {
  text-align: right;
  font-weight: 700;
  font-size: 1.25rem;
  font-feature-settings: "tnum";
}

.form-input[readonly] {
  background: #f3f4f6;
  /* Gray-100 */
  color: var(--text-muted);
  /* Softer text color */
  font-weight: 600;
  cursor: default;
  border-color: transparent;
  box-shadow: none;
}

.form-input.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.05);
  animation: shake 0.5s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
}

/* ==================== TABLES ==================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.table th,
.table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: var(--gradient-primary);
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.table tr {
  transition: var(--transition-fast);
}

.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.table--centered td,
.table--centered th {
  text-align: center;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--border-radius-full);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: var(--transition-normal);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn--primary {
  background: var(--gradient-primary);
  color: var(--text-light);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-blue);
}

.btn--accent {
  background: var(--gradient-gold);
  color: var(--primary-dark);
}

.btn--accent:hover {
  box-shadow: var(--shadow-glow);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn--outline:hover {
  background: var(--primary);
  color: var(--text-light);
}

.btn--danger {
  background: var(--gradient-danger);
  color: var(--text-light);
}

.btn--lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.125rem;
}

.btn--block {
  width: 100%;
}

/* ==================== ALERTS ==================== */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert--success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert--warning {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid var(--warning);
  color: var(--warning);
}

/* ==================== SECTIONS ==================== */
.section {
  padding: var(--space-2xl) 0;
}

.section__title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-xl);
  position: relative;
}

.section__title::after {
  content: '';
  flex: 1;
  height: 3px;
  background: var(--gradient-gold);
  border-radius: var(--border-radius-full);
  margin-left: var(--space-md);
}

/* ==================== LOADING ==================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-secondary);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.scale-in {
  animation: scaleIn 0.4s ease forwards;
}

/* ==================== WINNER PULSE ==================== */
@keyframes winnerPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  50% {
    box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
  }
}

.candidate-pulse {
  animation: winnerPulse 2s ease-in-out infinite;
}

/* ==================== CONFETTI CANVAS ==================== */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

/* ==================== SCORE STYLING ==================== */
.candidate__score {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 120px;
  text-align: right;
  font-feature-settings: "tnum";
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.score-value {
  font-size: 1.75rem;
  font-weight: 800;
}

.score-percent {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==================== AUTO-REFRESH STATUS ==================== */
.refresh-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.refresh-status__indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.refresh-status__text {
  font-weight: 500;
}

.refresh-status__countdown {
  opacity: 0.7;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ==================== HEADER LOGO ==================== */
.header__logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: var(--transition-normal);
}

.header__logo:hover {
  transform: scale(1.05);
}

.header__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .header__content {
    flex-direction: column;
    text-align: center;
  }

  .header__text h1 {
    font-size: 1.4rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .candidate-item {
    grid-template-columns: 60px 1fr;
    padding: var(--space-md);
  }

  .candidate__photo {
    width: 60px;
    height: 75px;
  }

  .candidate__score {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.5rem;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--border-color);
    justify-content: center;
    align-items: center;
  }

  /* Hide trophy on mobile to prevent overlap */
  .candidate-item--winner::after {
    display: none;
  }

  /* Adjust badge for mobile */
  .candidate__number {
    font-size: 0.8rem;
    height: 30px;
    padding: 0 8px;
    top: -6px;
    left: -6px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-direction: column;
    border-radius: var(--border-radius);
  }

  .tab {
    border-radius: var(--border-radius-sm);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: var(--space-lg);
  }

  .stat-card__value {
    font-size: 2rem;
  }

  .header__icon {
    font-size: 2rem;
  }

  .section__title {
    font-size: 1.25rem;
  }
}

/* ==================== UTILITIES ==================== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.font-bold {
  font-weight: 700;
}

.mt-md {
  margin-top: var(--space-md);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.hidden {
  display: none !important;
}

/* ==================== CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ==================== SELECTION ==================== */
::selection {
  background: var(--accent);
  color: var(--primary-dark);
}