/* ========================================
   MUGA WANDERERS - COMPONENT-BASED STYLING
   ======================================== */

/* CSS Custom Properties */
:root {
  /* Primary Brand Colors */
  --primary-purple: #9333ea;
  --primary-purple-hover: #7c3aed;
  --primary-purple-light: #a855f7;
  
  /* Secondary Colors */
  --red-primary: #dc2626;
  --red-hover: #b91c1c;
  --red-light: #fca5a5;
  --blue-primary: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-light: #93c5fd;
  
  /* Status Colors */
  --success: #16a34a;
  --success-hover: #15803d;
  --warning: #eab308;
  --warning-hover: #ca8a04;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  
  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Background & Surface */
  --bg-primary: #ffffff;
  --bg-secondary: var(--gray-50);
  --bg-dark: var(--gray-900);
  
  /* Text Colors */
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #4b5563;
  --text-inverse: #ffffff;
  
  /* Spacing & Layout */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.25rem;
  --space-2xl: 1.5rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Base Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  color: var(--text-primary);
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

.main-bg {
  background-color: var(--bg-secondary);
  min-height: 100vh;
}

.content-container {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* ========================================
   TEXT COMPONENTS
   ======================================== */

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-inverse {
  color: var(--text-inverse);
}

/* Text contrast fixes for readability */
.text-gray-400 {
  color: #374151 !important;
}

.text-gray-500 {
  color: #111827 !important;
}

.text-gray-600 {
  color: #111827 !important;
}

/* Force black text on white backgrounds */
.bg-white,
.bg-white * {
  color: #111827 !important;
}

.bg-white .text-gray-400,
.bg-white .text-gray-500,
.bg-white .text-gray-600,
.bg-white .text-gray-700,
.bg-white .text-gray-800,
.bg-white .text-gray-900 {
  color: #111827 !important;
}

/* ========================================
   BUTTON COMPONENTS
   ======================================== */

.btn-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  border: none;
  text-decoration: none;
  line-height: 1.5;
}

.btn-primary {
  background-color: var(--primary-purple);
  color: var(--text-inverse);
  padding: var(--space-md) var(--space-xl);
}

.btn-primary:hover {
  background-color: var(--primary-purple-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--gray-200);
  color: var(--text-primary);
  padding: var(--space-md) var(--space-xl);
}

.btn-secondary:hover {
  background-color: var(--gray-300);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--text-inverse);
  padding: var(--space-md) var(--space-xl);
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-success {
  background-color: var(--success);
  color: var(--text-inverse);
  padding: var(--space-md) var(--space-xl);
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-warning {
  background-color: var(--warning);
  color: var(--text-primary);
  padding: var(--space-md) var(--space-xl);
}

.btn-warning:hover {
  background-color: var(--warning-hover);
}

.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.125rem;
}

.btn-full {
  width: 100%;
}

.btn-flex {
  flex: 1;
}

/* ========================================
   VOTE BUTTON COMPONENTS
   ======================================== */

.vote-btn-red {
  background-color: var(--red-primary);
  color: var(--text-inverse);
}

.vote-btn-red:hover,
.vote-btn-red.active {
  background-color: var(--red-hover);
  transform: scale(1.02);
}

.vote-btn-blue {
  background-color: var(--blue-primary);
  color: var(--text-inverse);
}

.vote-btn-blue:hover,
.vote-btn-blue.active {
  background-color: var(--blue-hover);
  transform: scale(1.02);
}

.vote-btn-maybe {
  background-color: var(--warning);
  color: var(--text-primary);
}

.vote-btn-maybe:hover,
.vote-btn-maybe.active {
  background-color: var(--warning-hover);
  transform: scale(1.02);
}

.vote-btn-no {
  background-color: var(--gray-400);
  color: var(--text-inverse);
}

.vote-btn-no:hover,
.vote-btn-no.active {
  background-color: var(--gray-500);
  transform: scale(1.02);
}

/* ========================================
   CARD COMPONENTS
   ======================================== */

.card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
  border: 1px solid var(--gray-200);
}

.card-sm {
  padding: var(--space-lg);
}

.card-lg {
  padding: var(--space-2xl);
}

.poll-card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--gray-200);
}

/* Ensure card text is readable */
.card .text-gray-400,
.card .text-gray-500,
.card .text-gray-600,
.card .text-gray-700,
.card .text-gray-800,
.card .text-gray-900 {
  color: #111827 !important;
}

/* ========================================
   MODAL COMPONENTS
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  z-index: 50;
}

.modal-content {
  background-color: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-xl);
  max-width: 28rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* ========================================
   FORM COMPONENTS
   ======================================== */

.form-input {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.form-select {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
}

.form-textarea {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  resize: vertical;
  min-height: 6rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* ========================================
   BADGE COMPONENTS
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-primary {
  background-color: var(--primary-purple-light);
  color: var(--primary-purple);
}

.badge-success {
  background-color: #dcfce7;
  color: var(--success);
}

.badge-warning {
  background-color: #fef3c7;
  color: var(--warning);
}

.badge-danger {
  background-color: #fee2e2;
  color: var(--danger);
}

.badge-secondary {
  background-color: var(--gray-100);
  color: var(--gray-700);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-200 { background-color: var(--gray-200); }

.text-white { color: var(--text-inverse); }
.text-black { color: #000000; }

.border { border-width: 1px; }
.border-gray-200 { border-color: var(--gray-200); }
.border-gray-300 { border-color: var(--gray-300); }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .card,
  .poll-card,
  .modal-content {
    margin: var(--space-md);
    padding: var(--space-lg);
  }

  .btn-base {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem;
  }

  .modal-content {
    max-width: 95vw;
    margin: var(--space-sm);
    padding: var(--space-lg);
  }

  .text-3xl { font-size: 1.5rem; }
  .text-2xl { font-size: 1.25rem; }
  .text-xl { font-size: 1.125rem; }
}

/* ========================================
   QUILL RICH TEXT EDITOR STYLES
   ======================================== */
.ql-container {
  font-family: inherit;
}

.ql-editor {
  min-height: 100px;
  max-height: 300px;
  overflow-y: auto;
}

.ql-editor.ql-blank::before {
  font-style: italic;
  color: #9ca3af;
}

/* Rich text content display */
.rich-text-content {
  line-height: 1.6;
}

.rich-text-content.inline {
  display: inline;
}

.rich-text-content.inline p {
  display: inline;
  margin: 0;
}

.rich-text-content p {
  margin-bottom: 0.5rem;
}

.rich-text-content strong {
  font-weight: bold;
}

.rich-text-content em {
  font-style: italic;
}

.rich-text-content u {
  text-decoration: underline;
}

.rich-text-content ul, .rich-text-content ol {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.rich-text-content a {
  color: #2563eb;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .card,
  .poll-card {
    margin: var(--space-sm);
    padding: var(--space-md);
  }

  .btn-base {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8rem;
  }

  .modal-content {
    max-width: 98vw;
    margin: var(--space-xs);
    padding: var(--space-md);
  }
}
/* ========================================
   ADMIN NAME SPARKLE EFFECT
   ======================================== */

.admin-name-sparkle {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 25%, #ffd700 50%, #ff8c00 75%, #ffd700 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 700;
  animation: goldShine 3s linear infinite;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  display: inline-block;
  position: relative;
}

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

.admin-name-sparkle::before {
  content: '';
  position: absolute;
  left: -1.2em;
  animation: sparkle 2s ease-in-out infinite;
}

.admin-name-sparkle::after {
  content: '';
  position: absolute;
  right: -1.2em;
  animation: sparkle 2s ease-in-out infinite 1s;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

/* ========================================
   MOTM WINNER SUBTLE SPARKLE
   A slightly different, softer sparkle for recent Man of the Match winners
   ======================================== */
.motm-winner-sparkle {
  background: linear-gradient(90deg, #a7f3d0 0%, #93c5fd 40%, #e0e7ff 100%);
  background-size: 150% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 700;
  display: inline-block;
  position: relative;
  text-shadow: 0 0 6px rgba(147, 51, 234, 0.12);
  animation: motmShine 2.6s linear infinite;
}

@keyframes motmShine {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

.motm-winner-sparkle::after {
  content: '✨';
  font-size: 0.8em;
  position: absolute;
  right: -1.1em;
  top: -0.1em;
  opacity: 0.9;
  transform-origin: center;
  animation: motmTwinkle 2.2s ease-in-out infinite;
}

@keyframes motmTwinkle {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(0.8); opacity: 0.5; }
}
