:root {
  --flms-black: #1a1a1a;
  --flms-white: #ffffff;
  --flms-red: #e63946;
  --flms-yellow: #f4a300;
  --flms-gray: #f8f9fa;
  --flms-gray-dark: #6c757d;
  --flms-primary: #2563eb;
  --flms-primary-hover: #1d4ed8;
  --flms-success: #18bb6b;
  --flms-danger: #f73757;
  --flms-warning: #ffab4d;
  --flms-info: #32bfff;
}

body {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  color: #4c5258;
  font-size: 14px;
  letter-spacing: .3px;
  background-color: #f7f8fa;
}

/* ===== LOADER ===== */
#loader-wrapper {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: #fff; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .4s, visibility .4s;
}
#loader-wrapper.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes animdropdown {
  from { transform: translate3d(0, 6px, 0); opacity: 0; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}

.animate-fade-in-up { animation: fadeInUp 0.5s ease both; }
.animate-slide-in-right { animation: slideInRight 0.4s ease both; }
.animate-fade-in { animation: fadeIn 0.4s ease both; }

.animate-stagger > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}
.animate-stagger > *:nth-child(1) { animation-delay: 0s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.16s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.24s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.32s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.40s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.48s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.56s; }
.animate-stagger > *:nth-child(9) { animation-delay: 0.64s; }
.animate-stagger > *:nth-child(10) { animation-delay: 0.72s; }

.tab-pane.fade.show.active { animation: fadeInUp 0.4s ease; }

.live-pulse { animation: pulse 2s ease-in-out infinite; display: inline-block; }

/* ===== NAVBAR ===== */
.navbar-flms {
  background-color: var(--flms-black) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 12px 0;
}
.navbar-flms .navbar-brand {
  color: var(--flms-white) !important;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}
.navbar-flms .navbar-brand span { color: var(--flms-red); }
.navbar-flms .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}
.navbar-flms .nav-link:hover,
.navbar-flms .nav-link.active { color: var(--flms-white) !important; }
.navbar-flms .nav-link.active::after {
  content: '';
  display: block;
  height: 3px;
  background: var(--flms-yellow);
  border-radius: 2px;
  margin-top: 2px;
  animation: fadeIn 0.3s ease;
}
.navbar-flms .navbar-toggler { border-color: var(--flms-white); }

/* ===== HERO ===== */
.hero-section {
  background: linear-gradient(135deg, var(--flms-black) 0%, #333 100%);
  color: var(--flms-white);
  padding: 60px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(146,62,185,0.15) 0%, transparent 50%);
  animation: fadeIn 1.5s ease;
}
.hero-section h1 { font-weight: 800; font-size: 2.5rem; margin-bottom: 0.5rem; position: relative; }
.hero-section h1 span { color: var(--flms-yellow); }
.hero-section p { font-size: 1.1rem; opacity: 0.85; position: relative; }

/* ===== SECTION TITLE ===== */
.section-title {
  font-weight: 700;
  color: var(--flms-black);
  border-left: 4px solid var(--flms-primary);
  padding-left: 12px;
  margin-bottom: 24px;
}

/* ===== CARDS ===== */
.card {
  border: 1px solid #e2e3e4;
  border-radius: 10px;
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
  transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.12) !important;
}

.card-match .match-score {
  font-size: 2rem;
  font-weight: 800;
  color: var(--flms-black);
}
.match-score-lg { font-size: 3rem; }
.card-match .match-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===== BADGES ===== */
.status-programme { background: #e8f4fd; color: #0d6efd; }
.status-en-cours { background: #fff8e1; color: #f4a300; }
.status-termine { background: #e8f5e9; color: #18bb6b; }
.status-mi-temps { background: #fff8e1; color: #f4a300; }
.status-annule { background: #fce4ec; color: #f73757; }

.badge-red { background-color: var(--flms-danger); color: white; }
.badge-yellow { background-color: var(--flms-warning); color: #1a1a1a; }
.badge-primary { background-color: var(--flms-primary); color: white; }

/* ===== BUTTONS ===== */
.btn-flms {
  background-color: var(--flms-primary);
  color: var(--flms-white);
  font-weight: 600;
  border: none;
  padding: 8px 24px;
  border-radius: 6px;
  transition: all 0.2s;
}
.btn-flms:hover {
  background-color: #1d4ed8;
  color: var(--flms-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(146,62,185,0.3);
}

.btn-flms-outline {
  background: transparent;
  color: var(--flms-primary);
  border: 2px solid var(--flms-primary);
  font-weight: 600;
  padding: 6px 22px;
  border-radius: 6px;
  transition: all 0.2s;
}
.btn-flms-outline:hover {
  background: var(--flms-primary);
  color: var(--flms-white);
  transform: translateY(-1px);
}

/* ===== FORMS ===== */
.form-control:focus {
  border-color: #c27be4;
  box-shadow: 0 0 0 .25rem rgba(146, 62, 185, 0.3);
}
.form-select:focus {
  border-color: #c27be4;
  box-shadow: 0 0 0 .25rem rgba(146, 62, 185, 0.3);
}

/* ===== TABLES ===== */
.standings-table th {
  background-color: var(--flms-primary);
  color: var(--flms-white);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.standings-table .position-1 { background-color: #e8f5e9; }
.standings-table .position-2 { background-color: #e8f5e9; }
.standings-table .position-3 { background-color: #e8f5e9; }

.table-flms thead { background: #f7f8fa; }
.table-flms th { font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.3px; }

/* ===== TIMELINE ===== */
.timeline-event {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
  border-radius: 6px;
  padding-left: 8px;
}
.timeline-event:hover { background: #f8f9fa; }
.timeline-event .event-minute {
  font-weight: 700;
  color: var(--flms-primary);
  min-width: 30px;
  font-size: 1.1rem;
}
.timeline-event .event-icon { font-size: 1.3rem; min-width: 28px; text-align: center; }

/* ===== STICKY FOOTER LAYOUT ===== */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.flex-main { flex: 1 0 auto; }

/* ===== FOOTER ===== */
.footer-flms {
  flex-shrink: 0;
  background-color: var(--flms-black);
  color: rgba(255,255,255,0.7);
  padding: 30px 0;
  margin-top: 60px;
}
.footer-flms h6 { color: var(--flms-yellow); font-weight: 700; }

/* ===== TABS ===== */
.nav-tabs .nav-link {
  color: #4c5258;
  font-weight: 500;
  border: none;
  padding: 10px 18px;
  transition: all 0.2s;
}
.nav-tabs .nav-link:hover { color: var(--flms-primary); }
.nav-tabs .nav-link.active {
  color: var(--flms-primary);
  border-bottom: 2px solid var(--flms-primary);
  background: transparent;
}

/* ===== FILTER ===== */
.filter-section {
  background: var(--flms-white);
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
  margin-bottom: 20px;
  border: 1px solid #e2e3e4;
}

/* ===== LOGO PLACEHOLDER ===== */
.team-logo-placeholder {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--flms-primary), #1d4ed8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(146,62,185,0.2);
}
.team-logo-sm { width: 40px; height: 40px; font-size: 0.9rem; }

/* ===== PLAYER ===== */
.player-card .player-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--flms-primary), #1d4ed8);
}
.player-stat-box {
  text-align: center;
  padding: 12px;
  background: #f7f8fa;
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.player-stat-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 .25rem .5rem rgba(0,0,0,.1);
}
.player-stat-box .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--flms-black);
}
.player-stat-box .stat-label {
  font-size: 0.8rem;
  color: var(--flms-gray-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== NEWS ===== */
.news-card .news-image {
  min-height: 200px;
  max-height: 300px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
}

/* ===== COMPETITION GROUP ===== */
.competition-group-header {
  background: linear-gradient(135deg, var(--flms-primary) 0%, #1d4ed8 100%);
  color: white;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.match-comp-group {
  margin-bottom: 28px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
  border: 1px solid #e2e3e4;
}
.match-comp-group .card { border-radius: 0; box-shadow: none; border: none; border-bottom: 1px solid #e2e3e4; }
.match-comp-group .card:last-child { border-bottom: none; }

/* ===== GRADIENT UTILITIES ===== */
.bg-gradient-danger { background: linear-gradient(to right, rgb(238,9,121), rgb(255,106,0)); }
.bg-gradient-success { background: linear-gradient(310deg, #17ad37, #98ec2d); }
.bg-gradient-blue { background: linear-gradient(310deg, #2563eb, #1d4ed8); }
.bg-gradient-info { background: linear-gradient(to top, rgb(0,198,251) 0%, rgb(0,91,234) 100%); }
.bg-gradient-warning { background: linear-gradient(to right, rgb(247,151,30), rgb(255,210,0)); }
.bg-gradient-gold { background: linear-gradient(135deg, #d4a017, #f5d77b); }
.bg-gradient-silver { background: linear-gradient(135deg, #8e9eab, #c9d1d9); }
.bg-gradient-bronze { background: linear-gradient(135deg, #8d5524, #c47e3b); }

/* ===== STAT GRADIENT BACKGROUNDS ===== */
.bg-stat-primary { background: linear-gradient(310deg, #2563eb, #1d4ed8); }
.bg-stat-success { background: linear-gradient(310deg, #17ad37, #98ec2d); }
.bg-stat-info { background: linear-gradient(to top, rgb(0,198,251) 0%, rgb(0,91,234) 100%); }
.bg-stat-warning { background: linear-gradient(to right, rgb(247,151,30), rgb(255,210,0)); }
.bg-stat-danger { background: linear-gradient(to right, rgb(238,9,121), rgb(255,106,0)); }
.bg-stat-blue { background: linear-gradient(310deg, #2563eb, #1d4ed8); }

.border-white-10 { border-color: rgba(255,255,255,0.15) !important; }

.filter-transition {
  transition: opacity 0.3s ease;
}

/* ===== WIDGET ICONS ===== */
.widget-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.match-card-accent {
  border-left: 4px solid var(--flms-success) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 1.8rem; }
  .card-match .match-score { font-size: 1.5rem; }
  .match-score-lg { font-size: 2.2rem; }
}

@media (max-width: 576px) {
  .hero-section { padding: 40px 0; }
  .hero-section h1 { font-size: 1.4rem; }
  .hero-section p { font-size: 0.95rem; }
  .filter-section { padding: 10px; }
  .section-title { font-size: 1.1rem; }
  .news-card .news-image { min-height: 150px; max-height: 200px; }
  .player-stat-box .stat-value { font-size: 1.4rem; }
  .match-score-lg { font-size: 1.8rem; }
}

/* ===== COLLAPSE CHEVRON ===== */
.collapse-chevron { transition: transform 0.3s ease; }
[data-bs-toggle="collapse"].collapsed .collapse-chevron { transform: rotate(-90deg); }

/* ===== LIVE SCORES ===== */
.live-pulse { animation: pulse 1.5s ease-in-out infinite; }
.team-logo-sm { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--flms-primary), #1d4ed8); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; color: #fff; }
.team-logo-placeholder { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--flms-primary), #1d4ed8); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; color: #fff; }
.match-status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.status-en-cours { background: #fff3cd; color: #856404; border-left: 3px solid var(--flms-warning); }
.status-termine { background: #d4edda; color: #155724; border-left: 3px solid var(--flms-success); }
.status-programme { background: #cce5ff; color: #004085; border-left: 3px solid var(--flms-primary); }

/* ===== STATISTIQUES ===== */
.stat-card-icon { font-size: 2.2rem; opacity: 0.3; }
.stat-card-value { font-size: 1.8rem; font-weight: 800; line-height: 1.2; }

/* ===== FULLCALENDAR RESPONSIVE ===== */
@media (max-width: 576px) {
  .fc-header-toolbar { flex-direction: column; gap: 8px; }
  .fc-toolbar-title { font-size: 1rem; }
  .fc .fc-button { font-size: 0.8rem; padding: 4px 8px; }
  .fc .fc-toolbar-title { font-size: 1rem; }
}

/* ===== HERO CAROUSEL ===== */
#heroCarousel .hero-slide { min-height: 320px; display: flex; align-items: center; justify-content: center; padding: 60px 0; }
#heroCarousel .hero-slide h1 { font-weight: 800; font-size: 2.5rem; }
#heroCarousel .hero-slide h1 span { color: var(--flms-yellow); }
#heroCarousel .hero-slide p { font-size: 1.1rem; opacity: 0.85; }
#heroCarousel .carousel-indicators { bottom: 16px; }
#heroCarousel .carousel-indicators button { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); border: none; margin: 0 4px; }
#heroCarousel .carousel-indicators button.active { background: #fff; }
#heroCarousel .carousel-control-prev, #heroCarousel .carousel-control-next { width: 40px; height: 40px; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.2); border-radius: 50%; }
@media (max-width: 768px) {
  #heroCarousel .hero-slide { min-height: 240px; }
  #heroCarousel .hero-slide h1 { font-size: 1.8rem; }
}
@media (max-width: 576px) {
  #heroCarousel .hero-slide { min-height: 200px; padding: 40px 0; }
  #heroCarousel .hero-slide h1 { font-size: 1.4rem; }
  #heroCarousel .hero-slide p { font-size: 0.95rem; }
}

/* ===== SKELETON LOADER ===== */
@keyframes skeleton-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton-box { background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%); background-size: 200px 100%; animation: skeleton-shimmer 1.5s infinite; border-radius: 6px; }

/* ===== DROPDOWN NAVBAR ===== */
.navbar-flms .dropdown-menu { border: none; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.12); padding: 8px; min-width: 200px; margin-top: 2px; }
.navbar-flms .dropdown-item { border-radius: 6px; padding: 8px 16px; font-size: 0.875rem; font-weight: 500; color: #4c5258; transition: background 0.15s; }
.navbar-flms .dropdown-item:hover, .navbar-flms .dropdown-item:focus { background: #f0f4ff; color: var(--flms-primary); }
.navbar-flms .dropdown-item.active, .navbar-flms .dropdown-item:active { background: var(--flms-primary); color: #fff; }
.navbar-flms .dropdown-toggle::after { vertical-align: middle; margin-left: 6px; }
@media (max-width: 991.98px) {
  .navbar-flms .dropdown-menu { box-shadow: none; padding-left: 16px; background: transparent; }
  .navbar-flms .dropdown-item { color: rgba(255,255,255,0.8); }
  .navbar-flms .dropdown-item:hover { color: #fff; background: rgba(255,255,255,0.1); }
}

/* ===== FOOTER PAGES COLUMNS ===== */
@media (max-width: 576px) {
  .footer-flms .col-md-2 ul { column-count: 1 !important; }
}
