/* css/styles.css - Belgian-themed styles optimized for performance */

/* ===================================
   COMBINED STYLES - LEAGUE.CSS PRIORITY
   ================================== */

/* Variables CSS pour réduire la répétition */
:root {
  --belgium-black: #000000;
  --belgium-yellow: #FDDA24;
  --belgium-red: #EF3340;
  --belgium-white: #FFFFFF;
  --shadow-light: 0 4px 8px rgba(253, 218, 36, 0.2);
  --shadow-medium: 0 4px 8px rgba(253, 218, 36, 0.3);
  --shadow-dark: 0 8px 32px rgba(253, 218, 36, 0.15);
  --transition: all 0.3s ease;
  --border-radius: 12px;
  --card-bg: rgba(0, 0, 0, 0.80);
  --overlay-bg: rgba(0, 0, 0, 0.3);
  --belgian-flag-bg: url('../includes/Belgianflag.webp');
}

/* OPTIMISATION: Préchargement de l'image critique */
/* Ajoutez cette classe pour précharger l'image */
.preload-bg {
  background-image: var(--belgian-flag-bg);
  background-size: 1px 1px;
  background-repeat: no-repeat;
  background-position: -9999px -9999px;
}

/* Base styles */
body {
  padding-bottom: 70px;
  font-family: Arial, sans-serif;
  background-color: rgba(0, 0, 0, 0.85);
}

/* ===================================
   TEAM LOGOS & RANKING
   ================================== */

.team-logo, .team-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}

.team-logo {
    object-fit: cover;
}

.team-placeholder {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.team-logo:hover, .team-placeholder:hover {
    transform: scale(1.05);
}

/* Ranking Table Logos */
.ranking-logo, .ranking-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease;
}

.ranking-logo {
    object-fit: cover;
}

.ranking-placeholder {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.ranking-logo:hover, .ranking-placeholder:hover {
    transform: scale(1.1);
}

/* ===================================
   CATEGORY TILES
   ================================== */

.category-tile {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 40px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border-radius: 8px;
}

.category-tile:hover, .category-tile.active {
    transform: translateY(-2px);
    border-color: #007bff;
    background: #f8f9ff;
    text-decoration: none;
    color: inherit;
}

.category-tile .card-body {
    padding: 0.5rem;
    width: 100%;
}

.category-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.category-tile:hover .category-title {
    color: #007bff;
}

.category-details {
    font-size: 0.7rem;
    color: #6c757d;
    margin: 0;
}

/* ===================================
   TABLES
   ================================== */

.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.sortable-header:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sort-icon {
    margin-left: 5px;
    font-size: 0.8em;
}

.game-row {
    transition: background-color 0.3s ease;
}

.game-row:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.game-score {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

/* ===================================
   CARDS & BADGES
   ================================== */

.info-card {
    margin-bottom: 1.5rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.info-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.stat-item:hover {
    background: rgba(0, 123, 255, 0.05);
}

.badge-custom {
    font-size: 0.8em;
    padding: 0.4em 0.8em;
    border-radius: 12px;
}

/* ===================================
   BELGIUM THEME COMPONENTS
   ================================== */

/* OPTIMISATION: Classe réutilisable pour le background belge */
.belgian-flag-bg {
  background: var(--belgian-flag-bg) center/cover no-repeat;
  position: relative;
}

.belgian-flag-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--overlay-bg);
  z-index: 1;
}

.belgian-flag-bg > * {
  position: relative;
  z-index: 2;
}

/* Container principal */
.container {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-dark);
  margin: 20px auto;
  position: relative;
}

/* Navigation avec background - OPTIMISÉ */
.navbar-container-bg {
  /* Utilisation de la classe réutilisable */
  background: var(--belgian-flag-bg) center/cover no-repeat;
  position: relative;
  height: 100px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  /* OPTIMISATION: Lazy loading du background */
  background-attachment: scroll; /* Évite le fixed qui cause des problèmes de performance */
}

.navbar-container-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--overlay-bg);
  z-index: 1;
}

.navbar-container-bg > * {
  position: relative;
  z-index: 2;
}

/* Section welcome */
.welcome-section {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 20px;
}

.welcome-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.welcome-section p {
  font-size: 1.2rem;
  margin-bottom: 0;
  opacity: 0.9;
}

/* Dropdowns */
.dropdown-menu {
  background-color: var(--overlay-bg);
  border: 1px solid rgba(253, 218, 36, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.dropdown-menu .nav-link,
.dropdown-menu .dropdown-item {
  background-color: transparent;
  transition: var(--transition);
  color: var(--belgium-white);
  font-weight: bold;
  padding: 10px 18px;
}

.dropdown-menu .nav-link:hover,
.dropdown-menu .dropdown-item:hover {
  color: var(--belgium-white);
  transform: translateX(5px);
}

.dropdown-menu .nav-link.active,
.dropdown-menu .dropdown-item.active {
  background-color: var(--belgium-yellow);
  color: var(--belgium-black);
}

.dropdown-menu .dropdown-divider {
  border-color: rgba(253, 218, 36, 0.3);
}

/* Container homepage - OPTIMISÉ */
.container.homepage {
  background: var(--belgian-flag-bg) center/cover no-repeat;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: transparent;
  padding: 30px;
  /* OPTIMISATION: Utilisation de will-change pour de meilleures performances */
  will-change: transform;
}

.container.homepage::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--overlay-bg);
  border-radius: 10px;
  z-index: 1;
}

.container.homepage > * {
  position: relative;
  z-index: 2;
}

/* Couleurs belges - classes utilitaires */
.text-belgium-black { color: var(--belgium-black); }
.text-belgium-yellow { color: var(--belgium-yellow); }
.text-belgium-red { color: var(--belgium-red); }
.text-belgium-white { color: var(--belgium-white); }

.bg-belgium-black { background-color: var(--belgium-black); }
.bg-belgium-yellow { background-color: var(--belgium-yellow); }
.bg-belgium-red { background-color: var(--belgium-red); }
.bg-belgium-white { background-color: var(--belgium-white); }

/* Cards - OPTIMISÉ */
.card {
  margin-bottom: 25px;
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  background-color: var(--card-bg);
  transition: var(--transition);
  overflow: hidden;
  /* OPTIMISATION: Amélioration des performances d'animation */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.card:hover {
  transform: translateY(-5px) translateZ(0);
  box-shadow: var(--shadow-medium);
}

.container.homepage .card {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

/* Cards statistiques */
.stats-card {
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stats-card .card-body {
  padding: 25px 20px;
  text-align: center;
}

.stats-card .fas {
  margin-bottom: 15px;
  opacity: 0.9;
}

.stats-card .card-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.stats-card .card-text {
  font-size: 2.2rem !important;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Card header et body */
.card-header {
  font-weight: 600;
  background-color: var(--card-bg) !important;
  color: white !important;
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  padding: 15px 20px;
  border-bottom: 2px solid rgba(253, 218, 36, 0.3);
}

.card-body {
  font-weight: 500;
  background-color: var(--card-bg) !important;
  color: white !important;
  border-radius: 0 0 var(--border-radius) var(--border-radius) !important;
  padding: 20px;
}

/* Jumbotron */
.jumbotron {
  background-color: var(--card-bg) !important;
  color: var(--belgium-black);
  border: none;
  box-shadow: var(--shadow-medium);
  border-radius: var(--border-radius);
  padding: 40px;
}

.container.homepage .jumbotron {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.80);
  position: relative;
  z-index: 1;
}

/* Boutons - OPTIMISÉ */
.btn-belgium {
  background-color: var(--belgium-black);
  border-color: var(--belgium-black);
  color: var(--belgium-yellow);
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 20px;
  transition: var(--transition);
  /* OPTIMISATION: Performance des animations de boutons */
  transform: translateZ(0);
}

.btn-belgium:hover {
  background-color: var(--belgium-red);
  border-color: var(--belgium-red);
  color: white;
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 4px 12px rgba(239, 51, 64, 0.3);
}

.btn-belgium-outline {
  color: var(--belgium-white);
  border-color: var(--belgium-yellow);
  background-color: transparent;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 16px;
  transition: var(--transition);
  border-width: 2px;
  transform: translateZ(0);
}

.btn-belgium-outline:hover {
  background-color: var(--belgium-yellow);
  color: var(--belgium-black);
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 4px 12px rgba(253, 218, 36, 0.4);
}

.btn-belgium-primary {
  background-color: var(--belgium-black);
  border-color: var(--belgium-black);
  color: var(--belgium-yellow);
  font-weight: 600;
  border-radius: 8px;
  padding: 12px 24px;
  transition: var(--transition);
  transform: translateZ(0);
}

.btn-belgium-primary:hover {
  background-color: var(--belgium-red);
  border-color: var(--belgium-red);
  color: white;
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 4px 12px rgba(239, 51, 64, 0.3);
}

/* Status badges */
.status-badge {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-scheduled {
  background-color: var(--belgium-yellow);
  color: var(--belgium-black);
  box-shadow: 0 2px 4px rgba(253, 218, 36, 0.3);
}

.status-in-progress {
  background-color: var(--belgium-red);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 51, 64, 0.3);
}

.status-finished {
  background-color: var(--belgium-black);
  color: var(--belgium-yellow);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* List group items - OPTIMISÉ */
.list-group-item {
  border-left: none;
  border-right: none;
  transition: var(--transition);
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 8px !important;
  margin-bottom: 8px;
  padding: 15px;
  /* OPTIMISATION: Performance des animations */
  transform: translateZ(0);
}

.list-group-item:hover {
  background-color: rgba(253, 218, 36, 0.15);
  transform: translateX(5px) translateZ(0);
  box-shadow: 0 4px 12px rgba(253, 218, 36, 0.2);
}

.list-group-item:last-child {
  margin-bottom: 0;
}

/* Score display */
.match-score {
  color: var(--belgium-red);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Border colors */
.border-belgium-black {
  border-color: var(--belgium-black) !important;
}

/* Spacing utilities */
.row.mt-4 { margin-top: 2.5rem !important; }
.row.mt-2 { margin-top: 2rem !important; }
.mb-4 { margin-bottom: 2rem !important; }

