/* Custom Scrollbar Styles - Đẹp và hiện đại */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 50%, #007bff 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: all 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 50%, #0056b3 100%);
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
  transform: scaleY(1.05);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(135deg, #004085 0%, #002752 50%, #004085 100%);
  box-shadow: 0 0 15px rgba(0, 123, 255, 0.7);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #007bff rgba(0, 0, 0, 0.1);
}

/* Smooth scrolling cho toàn bộ site */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar cho các element có scroll riêng */
.scroll-container,
.cards-list,
.hm-flex,
.hm-list,
.cards-small,
.match-list,
.video-list,
.genre-row {
  scrollbar-width: thin;
  scrollbar-color: #007bff rgba(0, 0, 0, 0.1);
}

.scroll-container::-webkit-scrollbar,
.cards-list::-webkit-scrollbar,
.hm-flex::-webkit-scrollbar,
.hm-list::-webkit-scrollbar,
.cards-small::-webkit-scrollbar,
.match-list::-webkit-scrollbar,
.video-list::-webkit-scrollbar,
.genre-row::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scroll-container::-webkit-scrollbar-track,
.cards-list::-webkit-scrollbar-track,
.hm-flex::-webkit-scrollbar-track,
.hm-list::-webkit-scrollbar-track,
.cards-small::-webkit-scrollbar-track,
.match-list::-webkit-scrollbar-track,
.video-list::-webkit-scrollbar-track,
.genre-row::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb,
.cards-list::-webkit-scrollbar-thumb,
.hm-flex::-webkit-scrollbar-thumb,
.hm-list::-webkit-scrollbar-thumb,
.cards-small::-webkit-scrollbar-thumb,
.match-list::-webkit-scrollbar-thumb,
.video-list::-webkit-scrollbar-thumb,
.genre-row::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6c757d 0%, #495057 100%);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.scroll-container::-webkit-scrollbar-thumb:hover,
.cards-list::-webkit-scrollbar-thumb:hover,
.hm-flex::-webkit-scrollbar-thumb:hover,
.hm-list::-webkit-scrollbar-thumb:hover,
.cards-small::-webkit-scrollbar-thumb:hover,
.match-list::-webkit-scrollbar-thumb:hover,
.video-list::-webkit-scrollbar-thumb:hover,
.genre-row::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #495057 0%, #343a40 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Scrollbar cho dark theme (nếu có) */
@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
  }
  
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4a90e2 0%, #357abd 100%);
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #357abd 0%, #2868a0 100%);
  }
  
  * {
    scrollbar-color: #4a90e2 rgba(255, 255, 255, 0.1);
  }
}

/* Scrollbar mỏng hơn trên mobile */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  
  .scroll-container::-webkit-scrollbar,
  .cards-list::-webkit-scrollbar,
  .hm-flex::-webkit-scrollbar,
  .hm-list::-webkit-scrollbar,
  .cards-small::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
}

/* Animation khi scroll */
@keyframes scroll-indicator {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

/* Corner của scrollbar (góc trên và dưới) */
::-webkit-scrollbar-corner {
  background: rgba(0, 0, 0, 0.08);
}

/* Tối ưu hiệu suất */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar cho các modal, dropdown */
.modal,
.dropdown-menu,
.select-dropdown,
.popup {
  scrollbar-width: thin;
  scrollbar-color: #007bff rgba(0, 0, 0, 0.1);
}

.modal::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar,
.select-dropdown::-webkit-scrollbar,
.popup::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.modal::-webkit-scrollbar-thumb,
.dropdown-menu::-webkit-scrollbar-thumb,
.select-dropdown::-webkit-scrollbar-thumb,
.popup::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border-radius: 10px;
}

.modal::-webkit-scrollbar-thumb:hover,
.dropdown-menu::-webkit-scrollbar-thumb:hover,
.select-dropdown::-webkit-scrollbar-thumb:hover,
.popup::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

/* Scrollbar cho textarea và input có scroll */
textarea,
[contenteditable="true"] {
  scrollbar-width: thin;
  scrollbar-color: #007bff rgba(0, 0, 0, 0.1);
}

textarea::-webkit-scrollbar,
[contenteditable="true"]::-webkit-scrollbar {
  width: 8px;
}

textarea::-webkit-scrollbar-thumb,
[contenteditable="true"]::-webkit-scrollbar-thumb {
  background: #007bff;
  border-radius: 10px;
}

textarea::-webkit-scrollbar-thumb:hover,
[contenteditable="true"]::-webkit-scrollbar-thumb:hover {
  background: #0056b3;
}

