/* Base styles */
body {
  font-family: "Arial", sans-serif;
  padding-top: 70px; /* Padding cho sticky header */
}

:root {
  --primary-color: #0d6efd;
  --hover-color: #f8f9fa;
  --text-color: #212529;
  --border-color: #dee2e6;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
  --hero-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --button-gradient: linear-gradient(45deg, #ff6b6b, #ff8e53);
  --success-color: #4ade80;
  --secondary-color: #0d6efd;
  --background-light: #f8f9fa;
  --text-muted: #6c757d;
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --transition-fast: 0.15s ease;
}

/* Filter container */
.filter-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
}

.search-input {
  flex: 1;
  min-width: 200px;
}

.search-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Position groups */
.position-group {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.position-group input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.position-group label {
  background-color: var(--background-light);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
  font-weight: 600;
  user-select: none;
  min-width: 35px;
  text-align: center;
  position: relative;
  outline-offset: 2px;
}

.position-group input[type="checkbox"]:checked + label {
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Season group */
.season-filter-wrapper {
  margin-bottom: 0.75rem;
}

.season-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 0.25rem;
  padding: 0.5rem;
  background: rgba(248, 249, 250, 0.5);
  border-radius: 0.375rem;
}

.season-group input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.season-group label {
  cursor: pointer;
  border-radius: 0.25rem;
  overflow: hidden;
  position: relative;
  transition: transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  outline-offset: 2px;
}

.season-group input[type="checkbox"]:checked + label {
  border: 2px solid #ff0055;
  background: rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
  z-index: 1;
}

.season-group input[type="checkbox"]:checked + label::after {
  content: none;
}

/* Form styles */
.form-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-compact .form-control,
.form-compact .form-select {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.form-compact .form-control:focus,
.form-compact .form-select:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  outline: none;
}

.form-compact label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

.range-inputs {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.range-inputs input {
  flex: 1;
}

.range-inputs span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Advanced filters */
.advanced-filters {
  display: none;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  will-change: opacity, max-height;
}

.advanced-filters.show {
  display: block;
  opacity: 1;
  max-height: 2000px;
}

/* Table styles */
.table a {
  color: #212529;
  text-decoration: none;
  transition: color 0.2s ease-in-out, text-decoration 0.2s ease-in-out;
  font-weight: 500;
}

.table a:hover {
  color: #28a745;
  text-decoration: underline;
}

.table img:hover {
  transform: scale(1.1);
}

.invalid-feedback {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Loading state */
.loading {
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary-color);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .filter-container {
    padding: 1rem;
  }

  .search-input {
    min-width: auto;
  }

  .search-buttons {
    justify-content: center;
  }

  .form-compact {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .season-group {
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  }

  .season-group label img {
    height: 24px;
  }

  .season-group input[type="checkbox"]:checked + label::after {
    width: 12px;
    height: 12px;
    font-size: 8px;
  }

  .table {
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .form-compact {
    grid-template-columns: 1fr;
  }

  .season-group {
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  }

  .season-group label img {
    height: 22px;
  }

  .position-group {
    gap: 0.15rem;
  }

  .position-group label {
    font-size: 0.7rem;
    padding: 0.15rem 0.3rem;
    min-width: 30px;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Smooth scroll cho toàn trang */
html {
  scroll-behavior: smooth;
}
.hexagon-icon {
  --size: 23px;
  position: relative;
  width: var(--size);
  height: var(--size);
  margin-right: 8px;
}

.hexagon-icon svg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.hexagon-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  font-size: calc(var(--size) * 0.55);
  line-height: 1;
  text-align: center;
  width: 100%;
}

/* Style cho rating sao */
.star-rating {
  font-size: 0.75rem;
  letter-spacing: 1px;
}

/* Đảm bảo ảnh avatar hiển thị đẹp */
.player-avatar img {
  transition: transform 0.2s;
}

.player-avatar:hover img {
  transform: scale(1.05);
}

/* Responsive cho mobile */
@media (max-width: 768px) {
  .player-avatar {
    width: 36px;
    height: 36px;
    margin-right: 0.75rem !important;
  }

  .salary-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
  }
}

/* Màu chữ cho các vị trí */
/* Nhóm tiền đạo & cánh */
.pos-ST,
.pos-LW,
.pos-RW,
.pos-CF {
  color: #af1616;
  font-weight: bold;
}

/* Nhóm tiền vệ */
.pos-LM,
.pos-RM,
.pos-LAM,
.pos-RAM,
.pos-CM,
.pos-CAM,
.pos-CDM {
  color: #41a01c;
  font-weight: bold;
}

/* Nhóm hậu vệ */
.pos-LB,
.pos-RB,
.pos-LWB,
.pos-RWB,
.pos-SW,
.pos-CB {
  color: #1e4ca8;
  font-weight: bold;
}

/* Thủ môn */
.pos-GK {
  color: #cda20b;
  font-weight: bold;
}

/* Màu chữ cho OVR */
/* Màu sắc cho OVR value */
.ovr-0,
.ovr-10,
.ovr-20,
.ovr-30,
.ovr-40 {
  color: #88889b;
  font-weight: bold;
}

.ovr-50,
.ovr-60,
.ovr-70 {
  color: #414150;
  font-weight: bold;
}

.ovr-80 {
  color: #319bd7;
  font-weight: bold;
}

.ovr-90 {
  color: #195fde;
  font-weight: bold;
}

.ovr-100 {
  color: #5956fe;
  font-weight: bold;
}

.ovr-110 {
  color: #9329ff;
  font-weight: bold;
}

.ovr-120,
.ovr-130,
.ovr-140,
.ovr-150,
.ovr-160 {
  color: #ef0f39;
  font-weight: bold;
}

a {
  color: #000;
}

a:hover {
  text-decoration: none;
}

a.active-link,
a:hover {
  color: #28a745;
}

/* Style cho mùa giải */
.season {
  display: inline-flex;
  align-items: center;
}

/* ===== NAVBAR STYLES (UPDATED) ===== */
.navbar {
  backdrop-filter: blur(10px);
  transition: all var(--transition-speed) ease;
}

/* Header sticky với hiệu ứng mượt mà */
.navbar.sticky-top {
  position: fixed !important;
  top: 0;
  width: 100%;
  z-index: 1030;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Hiệu ứng khi cuộn xuống */
.navbar.sticky-top.scrolled {
  background-color: #fff !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Logo styling */
.navbar-brand img {
  transition: all var(--transition-speed) ease;
  will-change: transform;
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

/* Tối ưu cho logo khi cuộn */
.navbar.sticky-top.scrolled .navbar-brand img {
  height: 35px;
  width: auto;
  transition: all 0.3s ease;
}

/* Nav links styling (MERGED) */
.nav-link {
  position: relative;
  transition: all var(--transition-speed) ease;
  font-weight: 500;
  will-change: transform;
  border-radius: 8px;
}

.nav-link:hover {
  background-color: rgba(0, 123, 255, 0.1) !important;
  color: var(--primary-color) !important;
  transform: translateY(-1px);
}

/* Active state cho nav links */
.navbar-nav .nav-link[aria-current="page"] {
  background-color: rgba(0, 123, 255, 0.15);
  font-weight: 600;
}

/* Dropdown menu styling (MERGED) */
.dropdown-menu {
  animation: slideDown 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden !important;
}

.dropdown-item {
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 2px 6px;
}

.dropdown-item:hover {
  background-color: rgba(0, 123, 255, 0.1);
  transform: translateX(2px);
}

/* Button styling (MERGED) */
.btn-navbar {
  transition: all var(--transition-speed) ease;
  font-weight: 500;
  border-radius: 25px;
  will-change: transform;
}

.btn-navbar:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-color);
}

/* Navbar toggler (MERGED) */
.navbar-toggler {
  border: none !important;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.navbar-toggler:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

/* User avatar styling (MERGED) */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-right: 8px;
}

.user-avatar:hover {
  transform: scale(1.05);
}

/* Custom scrollbar cho dropdown */
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ===== HERO SECTION STYLES ===== */
.hero-section {
  background: var(--hero-gradient);
  position: relative;
  overflow: hidden;
  min-height: 600px;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.download-btn {
  background: var(--button-gradient);
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  color: white;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  position: relative;
  overflow: hidden;
}

.download-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
  color: white;
  text-decoration: none;
}

.download-btn:hover::before {
  left: 100%;
}

.product-image {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.product-image:hover {
  transform: scale(1.05) rotate(2deg);
}

.feature-highlight {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 1rem;
  margin: 1rem 0;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  color: rgba(255, 255, 255, 0.9);
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
}

.stats-container {
  display: flex;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 10px;
  flex: 1;
  min-width: 120px;
  backdrop-filter: blur(5px);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: var(--success-color);
  line-height: 1;
}

.stat-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ===== SELECT2 CUSTOMIZATION ===== */
.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  display: flex;
  align-items: center;
  height: 40px;
  line-height: 40px;
}

.select2-container--default .select2-selection--single {
  height: 40px;
}

.select2-selection__rendered img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin-right: 8px;
}

/* ===== UTILITY CLASSES ===== */
.title-box {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  display: inline-block;
  color: white;
}

/* ===== GRADE STYLES ===== */
.grade-1 {
  background-color: #000;
  color: #fff;
  border: 1.5px solid #607dc4;
}

.grade-2-4 {
  background-color: #cd7f32;
  color: #000;
  border: 1.5px solid #607dc4;
}

.grade-5-7 {
  background-color: #e0e0e0;
  color: #000;
  border: 1.5px solid #607dc4;
}

.grade-8-10 {
  background-color: #ffd700;
  color: #000;
  border: 1.5px solid #607dc4;
}

.grade-11-13 {
  color: #2d2b43;
  background-image: url("/css/images/platinum.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border: 1.5px solid #607dc4;
  height: 28px;
  line-height: 28px;
}

/* ===== SCROLL STYLES ===== */
.scroll-to-top {
  position: fixed;
  bottom: 50px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: linear-gradient(135deg, #0056b3, #004085);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
  transform: translateY(-2px);
}

.scroll-to-top i {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.scroll-to-top:hover i {
  transform: translateY(-2px);
}

/* ===== ANIMATIONS ===== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991.98px) {
  .navbar-nav {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }

  .nav-link {
    margin: 4px 0;
  }

  .navbar.sticky-top {
    padding: 0.75rem 0;
  }

  .navbar.sticky-top.scrolled {
    padding: 0.5rem 0;
  }

  .navbar-collapse {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-top: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .download-btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 2rem;
  }

  .stats-container {
    justify-content: center;
    gap: 1rem;
  }

  .hero-section {
    min-height: 500px;
  }

  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }

  .scroll-to-top i {
    font-size: 16px;
  }

  body {
    padding-top: 70px; /* Giảm padding trên mobile */
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .stat-item {
    min-width: 100px;
    padding: 0.75rem;
  }

  .fb-customerchat {
    display: none;
  }

  .feature-highlight {
    margin: 0.5rem 0;
    padding: 0.75rem;
  }

  .stats-container {
    gap: 0.5rem;
  }

  body {
    padding-top: 65px; /* Padding nhỏ hơn cho mobile nhỏ */
  }
}
