/**
 * Tippspiel Pro V2 - Unified Theme CSS (Project Clean Slate)
 * Version: 6.0.0
 * Modern 2026 Design System: Glassmorphism, Layers, Micro-Animations
 */

/* ============================================
   1. Root Variables & Theme System
   ============================================ */
:root {
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* Easing Functions for Fluid Animations */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.15, 0.86);

  /* Modern Glass Shadows & Glows */
  --shadow-glass: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --shadow-glass-hover: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 48px 0 rgba(0, 0, 0, 0.4);

  --shadow-glow-primary: 0 0 24px -4px rgba(14, 165, 233, 0.4);
  --shadow-glow-accent: 0 0 24px -4px rgba(217, 70, 239, 0.4);
  --shadow-glow-danger: 0 0 24px -4px rgba(239, 68, 68, 0.4);
  --shadow-glow-success: 0 0 24px -4px rgba(16, 185, 129, 0.4);

  /* Glassmorphism Backgrounds */
  --glass-bg-base: rgba(17, 24, 39, 0.45);
  --glass-bg-hover: rgba(17, 24, 39, 0.65);
  --glass-bg-active: rgba(31, 41, 55, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(14, 165, 233, 0.3);

  /* Blur amounts */
  --blur-sm: 8px;
  --blur-md: 16px;
  --blur-lg: 24px;
}

/* ============================================
   2. Global Resets & Document Setup
   ============================================ */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  /* For sticky header */
}

body {
  font-family: var(--font-sans);
  background-color: #030712;
  /* Fallback for older browsers, Tailwind handles the gradient */
  color: #f3f4f6;
  /* text-gray-100 */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection Styling */
::selection {
  background: rgba(14, 165, 233, 0.4);
  /* primary-500 */
  color: #ffffff;
}

::-moz-selection {
  background: rgba(14, 165, 233, 0.4);
  color: #ffffff;
}

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   3. Custom Scrollbars (Modern Dark Theme)
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(3, 7, 18, 0.8);
  /* gray-950 */
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(55, 65, 81, 0.6);
  /* gray-700 */
  border-radius: 5px;
  border: 2px solid rgba(3, 7, 18, 0.8);
  /* Creates padding effect inside the track */
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.7);
  /* primary-500 */
}

/* ============================================
   4. Custom UI Components (Abstracted Utility Classes)
   ============================================ */

/* --- Typography Utilities --- */
.gradient-text {
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: gradientFlow 4s linear infinite;
}

.gradient-primary-accent {
  background-image: linear-gradient(to right, #38bdf8, #d946ef, #38bdf8);
}

.gradient-success {
  background-image: linear-gradient(to right, #10b981, #34d399, #10b981);
}

.gradient-danger {
  background-image: linear-gradient(to right, #ef4444, #f87171, #ef4444);
}

@keyframes gradientFlow {
  0% {
    background-position: 0% center;
  }

  100% {
    background-position: 200% center;
  }
}

/* --- Glassmorphism Base --- */
.glass-panel {
  background: var(--glass-bg-base);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

.glass-panel-heavy {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-glass);
}

/* --- Bento Grid Cards --- */
.bento-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  /* 3xl */
  background: var(--glass-bg-base);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  padding: 1.5rem;
  transition: all 0.3s var(--ease-smooth);
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .bento-card {
    padding: 2rem;
  }
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-glass-hover), var(--shadow-glow-primary);
  background: var(--glass-bg-hover);
}

/* Background Highlight Effect on Hover for Cards */
.bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(14, 165, 233, 0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-smooth);
  pointer-events: none;
  z-index: 0;
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card>* {
  position: relative;
  z-index: 1;
}


/* --- Button Micro-Interactions --- */
button,
.btn {
  transition: all 0.2s var(--ease-spring);
  will-change: transform, box-shadow;
  outline: none;
}

button:active,
.btn:active {
  transform: scale(0.96) !important;
  /* The only allowed !important for universal active state */
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
  box-shadow: var(--shadow-glow-primary);
}

/* Glow Buttons */
.btn-glow {
  position: relative;
  border: none;
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  color: white;
  z-index: 1;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  z-index: -1;
  border-radius: inherit;
  filter: blur(12px);
  opacity: 0.5;
  transition: opacity 0.3s var(--ease-smooth), filter 0.3s var(--ease-smooth);
}

.btn-glow:hover::after {
  opacity: 0.8;
  filter: blur(16px);
}

/* Action Buttons (Save, Delete, Reload) */
.btn-action-primary {
  background: linear-gradient(to right, #0284c7, #2563eb);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-action-primary:hover {
  background: linear-gradient(to right, #0369a1, #1d4ed8);
  box-shadow: var(--shadow-glow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-action-danger {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-action-danger:hover {
  background: rgba(220, 38, 38, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fef2f2;
  box-shadow: var(--shadow-glow-danger);
  transform: translateY(-2px);
}

.btn-action-secondary {
  background: rgba(55, 65, 81, 0.4);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-action-secondary:hover {
  background: rgba(75, 85, 99, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* --- Pill Buttons (Fixing Tailwind CDN Limits) --- */
.btn-pill {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s var(--ease-spring);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-pill:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn-pill-primary {
  background: rgba(14, 165, 233, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.btn-pill-primary:hover {
  background: rgba(14, 165, 233, 0.2);
  box-shadow: var(--shadow-glow-primary);
}

.btn-pill-accent {
  background: rgba(217, 70, 239, 0.1);
  color: #e879f9;
  border: 1px solid rgba(217, 70, 239, 0.2);
}

.btn-pill-accent:hover {
  background: rgba(217, 70, 239, 0.2);
  box-shadow: var(--shadow-glow-accent);
}

.btn-pill-success {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-pill-success:hover {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: var(--shadow-glow-success);
}

.btn-pill-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-pill-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: var(--shadow-glow-danger);
}

.btn-pill-ghost {
  background: rgba(31, 41, 55, 0.5);
  color: #d1d5db;
  border: 1px solid rgba(75, 85, 99, 0.5);
}

.btn-pill-ghost:hover {
  background: rgba(55, 65, 81, 0.6);
  color: #f3f4f6;
  border-color: rgba(107, 114, 128, 0.8);
}


/* --- Form Elements --- */
input,
select,
textarea {
  transition: all 0.2s var(--ease-smooth);
}

input:focus,
select:focus,
textarea:focus {
  background-color: rgba(17, 24, 39, 0.8) !important;
  border-color: #0ea5e9 !important;
}

/* Custom Select Arrow */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Dark mode date picker icon */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.6);
  cursor: pointer;
  transition: filter 0.2s ease;
}

input[type="date"]:hover::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(1);
}

/* --- Navigation & Tabs --- */
.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0ea5e9, #d946ef);
  transition: width 0.3s var(--ease-spring);
}

.nav-link:hover::after {
  width: 100%;
}

.tab-button {
  transition: all 0.3s var(--ease-spring);
  position: relative;
}

.tab-button[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.9), rgba(217, 70, 239, 0.9));
  color: white;
  box-shadow: var(--shadow-glow-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button[aria-selected="false"] {
  background: transparent;
  color: #9ca3af;
  border: 1px solid transparent;
}

.tab-button[aria-selected="false"]:hover {
  background: rgba(31, 41, 55, 0.6);
  color: #f3f4f6;
}

/* Tab Content Transitions */
.tab-panel {
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-spring);
}

.tab-panel.hidden {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}


/* ============================================
   5. Dynamic App Content (Analytics / PHP Interface)
   ============================================ */

#appContent {
  position: relative;
  width: 100%;
  animation: fadeUpIn 0.5s var(--ease-spring);
}

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auth Shake Animation */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.animate-shake {
  animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

.border-error {
  border-color: #ef4444 !important;
}

/* Loading Spinner */
.loader-spinner {
  width: 4rem;
  height: 4rem;
  border: 4px solid rgba(14, 165, 233, 0.1);
  border-left-color: #0ea5e9;
  border-top-color: #d946ef;
  border-radius: 50%;
  animation: spinGradient 1s linear infinite;
}

@keyframes spinGradient {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  pointer-events: auto;
  min-width: 320px;
  max-width: 400px;
  transform-origin: bottom right;
  animation: slideInToast 0.4s var(--ease-spring) forwards;
}

.toast.hiding {
  animation: slideOutToast 0.3s var(--ease-smooth) forwards;
}

@keyframes slideInToast {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideOutToast {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

.toast-success {
  border-left: 4px solid #10b981;
}

.toast-success i {
  color: #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-error i {
  color: #ef4444;
}

.toast-info {
  border-left: 4px solid #3b82f6;
}

.toast-info i {
  color: #3b82f6;
}

/* Empty State / Status Boxes inside App */
.status-box {
  background: rgba(31, 41, 55, 0.4);
  border: 1px dashed rgba(75, 85, 99, 0.6);
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.status-box:hover {
  background: rgba(31, 41, 55, 0.6);
  border-color: rgba(14, 165, 233, 0.4);
}

.status-box i {
  font-size: 3rem;
  background: linear-gradient(135deg, #4b5563, #9ca3af);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
  display: inline-block;
}

/* ============================================
   6. Data Tables (Analytics App Base Styles)
   ============================================ */
.data-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 1rem;
  background: var(--glass-bg-base);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: rgba(17, 24, 39, 0.8);
  padding: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  border-bottom: 1px solid rgba(75, 85, 99, 0.4);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 1rem;
  font-size: 0.875rem;
  color: #d1d5db;
  border-bottom: 1px solid rgba(55, 65, 81, 0.3);
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover td {
  background: rgba(31, 41, 55, 0.6);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Visual Tags in Tables */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* ============================================
   7. Decorative Layout Elements
   ============================================ */
/* Header fade gradient when scrolling horizontally in tables */
.scroll-fade-right {
  position: relative;
}

.scroll-fade-right::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4rem;
  background: linear-gradient(to right, transparent, rgba(17, 24, 39, 0.9));
  pointer-events: none;
  border-radius: 0 1rem 1rem 0;
}

/* Custom Cursor Tracker (Desktop) */
#customCursor {
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(14, 165, 233, 0.8);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
  mix-blend-mode: difference;
}

#customCursor.hovering {
  width: 40px;
  height: 40px;
  background-color: rgba(14, 165, 233, 0.1);
  border-color: rgba(217, 70, 239, 0.8);
}

@media (max-width: 1024px) {
  #customCursor {
    display: none !important;
  }
}

/* ============================================
   8. Analytics / Content Specific Styles (Restored & Modernized)
   ============================================ */

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.view-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.view-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.breadcrumb a {
  color: #0ea5e9;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: #38bdf8;
}

.breadcrumb i {
  font-size: 0.75rem;
  opacity: 0.7;
}

.summary-section {
  margin-bottom: 2rem;
}

.summary-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.summary-section h3 i {
  color: #0ea5e9;
}

.hint-text {
  color: #9ca3af;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.hint-text i {
  color: #0ea5e9;
  margin-right: 0.5rem;
}

/* Analytics Summary Tables (Overview JS) */
.summary-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.summary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.summary-table thead tr {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(217, 70, 239, 0.1));
}

.summary-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(186, 230, 253);
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-table tbody tr {
  transition: background-color 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-table tbody tr:hover {
  background: rgba(14, 165, 233, 0.08);
}

.summary-table td {
  padding: 1rem;
  color: rgb(229, 231, 235);
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-table tbody tr:last-child td {
  border-bottom: none;
}

.col-rank,
.rank-cell {
  width: 60px;
  text-align: center;
  font-size: 1.125rem;
  color: rgb(251, 191, 36);
  font-weight: 700;
}

.summary-table th:last-child,
.summary-table td:last-child {
  padding-right: 1.5rem;
}

.col-website,
.website-cell {
  min-width: 180px;
  font-weight: 600;
  color: rgb(14, 165, 233);
}

.stars-cell {
  min-width: 120px;
}

.count-cell {
  text-align: center;
  font-weight: 600;
  min-width: 100px;
}

/* Stars Display in Analytics */
.stars-display {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.total-stars {
  font-size: 1.125rem;
  font-weight: 700;
  color: rgb(251, 191, 36);
  min-width: 40px;
  text-align: right;
}

/* Matchday Grid (Overview JS) */
.matches-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.matchday-card {
  padding: 1.5rem 0;
  transition: all 0.3s ease;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.matchday-card:last-child {
  border-bottom: none;
}

.matchday-card:hover {
  background: rgba(255, 255, 255, 0.02);
  transform: translateX(4px);
}

.matchday-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.matchday-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.matchday-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.matchday-stats .stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgb(156, 163, 175);
  font-size: 0.875rem;
}

.matchday-stats .stat i {
  color: rgb(14, 165, 233);
  width: 20px;
}

/* Predictions Table (Matchday JS) */
.predictions-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

.predictions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.predictions-table thead tr {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(217, 70, 239, 0.15));
}

.predictions-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(186, 230, 253);
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.predictions-table tbody tr {
  background: rgba(31, 41, 55, 0.2);
  transition: all 0.2s ease;
}

.predictions-table tbody tr:hover {
  background: rgba(14, 165, 233, 0.08);
}

.predictions-table td {
  padding: 1rem;
  color: rgb(229, 231, 235);
  font-size: 0.8125rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.col-prognose {
  min-width: 80px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgb(251, 191, 36);
}

.col-tendenz {
  min-width: 90px;
}

.tendency-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.2);
  color: rgb(14, 165, 233);
}

.col-kommentar {
  min-width: 150px;
  max-width: 250px;
}

.comment-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-text {
  color: rgb(209, 213, 219);
  line-height: 1.5;
  max-height: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.rating-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stars {
  display: inline-flex;
  gap: 0.25rem;
}

.stars i {
  color: rgb(156, 163, 175);
  font-size: 1rem;
}

.stars i.filled {
  color: rgb(251, 191, 36);
}

/* Common UI Elements */
.badge-small {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(14, 165, 233, 0.2);
  color: rgb(14, 165, 233);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-spring);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 90%;
  width: 500px;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-spring);
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.btn-icon:hover {
  color: #fff;
  transform: scale(1.1);
}

.btn-danger-ghost:hover {
  color: #ef4444;
}

.btn-edit {
  color: #0ea5e9;
}

.btn-edit:hover {
  color: #38bdf8;
}

.btn-delete {
  color: #ef4444;
}

.btn-delete:hover {
  color: #f87171;
}

.btn-icon-sm {
  background: transparent;
  border: none;
  font-size: 0.875rem;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-icon-sm:hover {
  color: #ef4444;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #9ca3af;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.empty-state-small {
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
  background: rgba(31, 41, 55, 0.3);
  border-radius: 1rem;
  border: 1px dashed rgba(75, 85, 99, 0.5);
}

/* Star Progress Box */
.star-progress-container {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 70px;
  position: relative;
}

.star-progress-bar {
  height: 8px;
  background: linear-gradient(90deg, rgb(251, 191, 36), rgb(245, 158, 11));
  border-radius: 9999px;
  position: relative;
  overflow: hidden;
  transition: width 0.5s ease;
  min-width: 8px;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

.star-progress-glow {
  position: absolute;
  top: 0;
  left: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: progressGlow 2s infinite;
}

@keyframes progressGlow {
  0% {
    left: -50%;
  }

  100% {
    left: 150%;
  }
}

/* Matchday Card & Team formatting */
.match-card {
  background: rgba(31, 41, 55, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.match-card:hover {
  background: rgba(255, 255, 255, 0.02);
}

.match-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.match-teams {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  cursor: pointer;
}

.team-name {
  font-weight: 600;
  color: rgb(255, 255, 255);
  font-size: 1rem;
  transition: color 0.2s ease;
}

.match-teams:hover .team-name {
  color: rgb(14, 165, 233);
}

.match-vs {
  color: rgb(156, 163, 175);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0 0.5rem;
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: rgb(156, 163, 175);
  font-size: 0.875rem;
}

.match-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.match-meta i {
  color: rgb(14, 165, 233);
}

/* Header within details Match JS */
.match-header-big {
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(217, 70, 239, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.match-header-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: rgb(255, 255, 255);
  margin-bottom: 0.5rem;
}

.match-header-content .vs {
  color: rgb(14, 165, 233);
  margin: 0 0.75rem;
}

.match-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: rgb(156, 163, 175);
  font-size: 0.875rem;
}

.match-info span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Action Ghost buttons */
.btn-ghost {
  background: transparent;
  color: rgb(209, 213, 219);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

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

/* ============================================
   9. Modals (Overlays & Dialogs)
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  animation: fadeInModal 0.2s var(--ease-smooth);
}

.modal-content {
  background: var(--glass-bg-heavy, rgba(17, 24, 39, 0.95));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass-hover);
  border-radius: 1.5rem;
  width: 90%;
  max-width: 500px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUpModal 0.3s var(--ease-spring);
}

.modal-content.modal-large {
  max-width: 800px;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.modal-close:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.modal-body {
  padding: 2rem;
  color: #d1d5db;
  font-size: 0.95rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-body input[type="number"],
.modal-body input[type="text"],
.modal-body input[type="url"],
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(3, 7, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: #fff;
  font-family: inherit;
  margin-top: 0.5rem;
}

.modal-body select option {
  background: #1f2937;
  color: #fff;
}

.modal-body label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #e5e7eb;
}

.modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: rgba(3, 7, 18, 0.3);
}

.warning-text {
  color: #fca5a5;
  font-size: 0.875rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  border-radius: 0.25rem;
}

@keyframes fadeInModal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   8. Light Mode & Floating Header States
   ============================================ */

/* Sticky Header State */
#mainHeader nav {
  transition: all 0.3s var(--ease-spring);
}

#mainHeader.scrolled nav {
  background: rgba(17, 24, 39, 0.95);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Light Mode (CSS Invert Hack for hardcoded dark themes) */
html.light {
  filter: invert(1) hue-rotate(180deg);
  background-color: #f9fafb;
  /* ensure solid background rendering when inverted */
}

/* Re-invert media so they look normal */
html.light img,
html.light video,
html.light canvas,
html.light [style*="background-image"],
html.light .btn-glow::after {
  filter: invert(1) hue-rotate(180deg);
}