html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: 'Roboto', sans-serif;
}

/* Custom Colors */
:root {
  --primary-color: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --light-color: #f8fafc;
  --dark-color: #1e293b;
}

/* Primary Color Override */
.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Navigation */
.navbar-brand {
  font-weight: 700;
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Cards */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn {
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
}

/* Forms */
.form-control {
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

/* Hero Sections */
.hero-section {
  position: relative;
  overflow: hidden;
}

.carousel-item {
  position: relative;
}

.carousel-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.3s ease;
}

.lazy-background {
  background: linear-gradient(rgba(30, 58, 138, 0.3), rgba(30, 58, 138, 0.3));
  opacity: 0;
}

.lazy-background.loaded {
  opacity: 1;
}

/* Loading animation for lazy backgrounds */
.lazy-background::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
}

.lazy-background.loaded::before {
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.carousel-caption {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.carousel-caption h1 {
  font-weight: 700;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
}

.carousel-caption p {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: 500;
}

/* Service Cards */
.service-card {
  transition: transform 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
}

/* News Cards */
.news-card {
  transition: transform 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
}

.news-card .card-title {
  font-size: 1.1rem;
  line-height: 1.4;
  height: 3rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-card .card-text {
  height: 4.5rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Video Cards */
.video-card {
  transition: transform 0.3s ease;
}

.video-card:hover {
  transform: translateY(-5px);
}

.play-button {
  width: 60px;
  height: 60px;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.play-button:hover {
  opacity: 1;
  transform: scale(1.1);
}

.video-card:hover .play-button {
  opacity: 1;
}

/* News Content */
.news-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

.news-content h1, .news-content h2, .news-content h3, .news-content h4, .news-content h5, .news-content h6 {
  color: var(--primary-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.news-content p {
  margin-bottom: 1.5rem;
}

.news-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

.news-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #666;
}

.news-content ul, .news-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.news-content li {
  margin-bottom: 0.5rem;
}

/* Admin Sidebar */
.sidebar {
  min-height: 100vh;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease, background-color 0.3s ease;
}

.sidebar .nav-link:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Dark Mode Support */
[data-theme="dark"] {
  --primary-color: #3b82f6;
  --light-color: #1e293b;
  --dark-color: #f8fafc;
}

[data-theme="dark"] body {
  background-color: var(--light-color);
  color: var(--dark-color);
}

[data-theme="dark"] .card {
  background-color: #334155;
  color: white;
}

[data-theme="dark"] .navbar {
  background-color: #1e293b !important;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section .carousel-item {
    height: 400px;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .display-6 {
    font-size: 1.5rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Loading Spinner */
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* Solutions Carousel - Fixed Height */
#solutionsCarousel {
  height: 500px; /* Cố định chiều cao */
}

#solutionsCarousel .carousel-item {
  height: 500px; /* Cố định chiều cao cho từng slide */
}

#solutionsCarousel .carousel-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0;
  position: relative;
  z-index: 8;
}

#solutionsCarousel .carousel-content h3 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

#solutionsCarousel .carousel-content p {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--secondary-color);
}

#solutionsCarousel .carousel-content .btn {
  align-self: flex-start;
  position: relative;
  z-index: 10;
}

#solutionsCarousel .carousel-item .col-lg-6:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

#solutionsCarousel .carousel-item img {
  max-height: 400px;
  width: auto;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Carousel Controls - Đảm bảo không che button */
#solutionsCarousel .carousel-control-prev,
#solutionsCarousel .carousel-control-next {
  z-index: 5;
}

#solutionsCarousel .carousel-indicators {
  z-index: 5;
}

/* Responsive cho solutionsCarousel */
@media (max-width: 768px) {
  #solutionsCarousel {
    height: auto;
    min-height: 400px;
  }
  
  #solutionsCarousel .carousel-item {
    height: auto;
    min-height: 400px;
  }
  
  #solutionsCarousel .carousel-content {
    padding: 1rem 0;
    text-align: center;
  }
  
  #solutionsCarousel .carousel-content h3 {
    font-size: 2rem;
  }
  
  #solutionsCarousel .carousel-content p {
    font-size: 1rem;
  }
  
  #solutionsCarousel .carousel-content .btn {
    align-self: center;
    position: relative;
    z-index: 10;
  }
  
  #solutionsCarousel .carousel-item img {
    max-height: 250px;
    margin-top: 1rem;
  }
}