/* ===== Base ===== */
:root {
  --green-main: #198754;
  --green-light: #43e97b;
  --green-gradient: linear-gradient(90deg, var(--green-main) 70%, var(--green-light) 100%);
  --shadow-soft: 0 2px 12px rgba(25, 135, 84, 0.08);
  --shadow-hover: 0 8px 32px rgba(25, 135, 84, 0.14);
  --bg-gradient: linear-gradient(120deg, #fff 80%, #e9f7ef 100%);
  --transition-fast: 0.25s ease;
  --text-main: #333;
  --text-sub: #777;
  --radius-lg: 1.5rem;
}

body {
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  color: var(--text-main);
  background: linear-gradient(135deg, #f8fafc 0%, #e9ecef 100%);
}

.hidden {
  display: none !important;
  visibility: hidden !important;
}

/* ===== Layout ===== */
.navbar, .footer {
  background: #fff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
}

.carousel {
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* ===== Components ===== */
.card, .service-card, .project-card, .news-card, .feedback-card, .stat-box {
  background: var(--bg-gradient);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover, .service-card:hover, .project-card:hover, .news-card:hover, .feedback-card:hover, .stat-box:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-hover);
}

/* Service icon */
.service-card img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

/* Title and subtitles */
.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 1.1rem;
  color: #888;
  margin-bottom: 1.5rem;
}

/* Divider */
.title-divider {
  height: 4px;
  width: 80px;
  margin: 0 auto 2rem;
  border-radius: 2px;
  background: var(--green-gradient);
}

/* Stat section */
.stat-item {
  text-align: center;
  padding: 1.5rem 0;
}
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--green-main);
}
.stat-label {
  font-size: 1rem;
  color: var(--text-sub);
}

/* Testimonials */
.testimonial-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2rem;
}

.profile-pic {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.review-text {
  color: #666;
  font-style: italic;
  line-height: 1.6;
}

.stars {
  color: #ffc107;
}

/* Buttons */
.btn-success {
  background: var(--green-gradient);
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(25, 135, 84, 0.1);
}
.btn-success:hover {
  background: linear-gradient(90deg, var(--green-light), var(--green-main));
  box-shadow: 0 4px 16px rgba(25, 135, 84, 0.18);
}

/* Form */
.form-control, .form-select {
  border-radius: 1rem;
  border: 1px solid #e9ecef;
  box-shadow: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 0 2px #43e97b33;
}

/* Toast */
.toast-custom {
  background: var(--green-gradient);
  color: #fff !important;
  font-weight: 600;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: slideInDown 0.4s ease forwards;
}
.toast-top-center {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1055;
}
@keyframes slideInDown {
  0% { transform: translate(-50%, -30px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .carousel, .project-card, .news-card, .contact-section .card, .video-wrapper {
    border-radius: 1rem;
  }
  .testimonial-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

/* ===== Compact Sizing - Giảm kích thước tổng thể ===== */
section {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

/* Headings - Giảm font size */
h2 {
  font-size: 1.8rem !important;
}

/* Service cards - Nhỏ gọn hơn */
.service-card {
  padding: 0.8rem !important;
}

.service-card .mb-3 {
  height: 60px !important;
}

.service-card img {
  max-height: 60px !important;
}

.service-card p {
  font-size: 0.85rem !important;
}

/* Stats section - Nhỏ gọn hơn */
.stats-section h2 {
  font-size: 2rem !important;
}

.stats-section p {
  font-size: 0.95rem !important;
}

.stat-box h3 {
  font-size: 2rem !important;
}

.stat-box {
  padding: 1rem !important;
}

/* Testimonials - Nhỏ gọn hơn */
.testimonial-card {
  padding: 1rem !important;
}

.testimonial-card .profile-pic {
  width: 50px !important;
  height: 50px !important;
}

.testimonial-card .review-text {
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
}

/* Projects - Nhỏ gọn hơn */
.project-card .card-body {
  padding: 0.8rem !important;
}

.project-card h6 {
  font-size: 0.9rem !important;
}

/* News cards - Nhỏ gọn hơn */
.news-card .card-body {
  padding: 0.8rem !important;
}

.news-card h6 {
  font-size: 0.9rem !important;
  min-height: 2.4rem !important;
}

/* Stat items - Nhỏ gọn hơn */
.stat-item {
  padding: 1rem !important;
}

.stat-number {
  font-size: 2rem !important;
}

.stat-label {
  font-size: 0.85rem !important;
}

/* Partner logos - Nhỏ gọn hơn */
.partner-logo-wrapper {
  height: 80px !important;
  padding: 0.8rem !important;
}

.partner-logo-wrapper img {
  max-height: 50px !important;
}

/* Contact form - Nhỏ gọn hơn */
.contact-section .card {
  padding: 1.2rem !important;
}

.contact-section h2 {
  font-size: 2rem !important;
}

/* Video cards - Nhỏ gọn hơn */
.feedback-card {
  padding: 0.8rem !important;
}

.feedback-card h6 {
  font-size: 0.9rem !important;
}

.feedback-card p {
  font-size: 0.85rem !important;
}

/* Carousel - Nhỏ gọn hơn */
#sliderCarousel {
  margin-top: 70px !important;
}

#sliderCarousel img {
  max-height: 400px !important;
}

/* Carousel controls - Nhỏ hơn */
.carousel-control-prev, .carousel-control-next {
  width: 40px !important;
  height: 40px !important;
}

/* Section titles - Nhỏ gọn hơn */
.title-divider-container {
  max-width: 150px !important;
}

.title-divider {
  height: 3px !important;
}

/* Text sizes - Nhỏ gọn hơn */
.text-muted {
  font-size: 0.9rem !important;
}

/* Buttons - Nhỏ gọn hơn */
.btn-lg {
  padding: 0.6rem 1.5rem !important;
  font-size: 1rem !important;
}

/* Transition effects */
.transition-all {
  transition: all 0.3s ease;
}

/* Service card hover */
.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(25, 135, 84, 0.15) !important;
}

.service-card:hover img {
  transform: scale(1.1);
}

/* Project card hover */
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(25, 135, 84, 0.2) !important;
}

.project-card:hover .position-absolute {
  opacity: 0.8 !important;
}

.project-card:hover img {
  transform: scale(1.1);
}

/* News card hover */
.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(25, 135, 84, 0.2) !important;
}

.news-card:hover .position-absolute {
  opacity: 0.8 !important;
}

.news-card:hover img {
  transform: scale(1.1);
}

/* Testimonial card hover */
.testimonial-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(25, 135, 84, 0.15) !important;
}

/* Stat box hover */
.stat-box:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 25px rgba(25, 135, 84, 0.2) !important;
}

/* Partner logo hover */
.partner-logo-wrapper:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(25, 135, 84, 0.15) !important;
}

.partner-logo-wrapper:hover img {
  filter: grayscale(0%) !important;
  opacity: 1 !important;
  transform: scale(1.1);
}

/* Button hover */
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(25, 135, 84, 0.3) !important;
}

/* Form input focus */
.form-control:focus, .form-select:focus {
  border-color: #198754 !important;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
}

.carousel-control-prev {
  left: 15px;
}

.carousel-control-next {
  right: 15px;
}

.carousel-control-prev:hover, .carousel-control-next:hover {
  opacity: 1;
  background: rgba(25, 135, 84, 1);
  transform: translateY(-50%) scale(1.1);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Section spacing */
section {
  position: relative;
}

/* Image hover effects */
img {
  transition: transform 0.3s ease;
}

/* Feedback card hover */
.feedback-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(25, 135, 84, 0.15) !important;
}

/* ===== Toast Notification - Tối ưu - Hiển thị giữa màn hình ===== */
.toast-custom {
  background: linear-gradient(135deg, #198754 0%, #20c997 100%) !important;
  color: #fff !important;
  border-radius: 1rem !important;
  padding: 1.25rem 1.5rem !important;
  box-shadow: 0 12px 32px rgba(25, 135, 84, 0.4) !important;
  min-width: 350px;
  max-width: 90%;
  border: none !important;
  animation: toastSlideInCenter 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
  will-change: transform, opacity;
  margin: 0 !important;
}

.toast-top-center {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
  will-change: transform, opacity;
  margin: 0 !important;
}

.toast-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  flex-shrink: 0;
  animation: iconPulse 0.6s ease 0.2s;
}

.toast-body {
  padding: 0 !important;
  color: #fff !important;
}

.toast-body strong {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: block;
}

.toast-message {
  font-size: 0.9rem;
  line-height: 1.4;
  display: block;
}

.toast-custom .btn-close {
  opacity: 0.8;
  filter: brightness(0) invert(1);
  transition: opacity 0.3s;
}

.toast-custom .btn-close:hover {
  opacity: 1;
}

@keyframes toastSlideIn {
  0% {
    transform: translate(-50%, -100px);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes toastSlideInCenter {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

/* Đảm bảo toast container luôn hiển thị giữa màn hình và không bị ảnh hưởng bởi scroll */
#successToast {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
  will-change: transform, opacity;
  margin: 0 !important;
  contain: layout style paint !important;
}

/* Đảm bảo toast không bị ảnh hưởng bởi scroll khi show - Giữ ở giữa màn hình */
.toast.showing,
.toast.show,
.toast.hiding,
.toast:not(.hide) {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
  will-change: transform, opacity;
  margin: 0 !important;
}

/* Đảm bảo toast không bị ảnh hưởng bởi parent container */
.toast-custom,
#successToast {
  isolation: isolate !important;
  contain: layout style paint !important;
}

/* Override mọi CSS có thể ảnh hưởng đến toast */
body .toast-custom,
body #successToast,
html .toast-custom,
html #successToast {
  position: fixed !important;
  z-index: 999999 !important;
}

/* Toast Overlay - Làm mờ background khi toast hiển thị */
.toast-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.5) !important;
  z-index: 999998 !important;
  pointer-events: auto !important;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Responsive toast */
@media (max-width: 576px) {
  .toast-custom {
    min-width: calc(100% - 2rem);
    max-width: calc(100% - 2rem);
    padding: 1rem 1.25rem !important;
  }

  .toast-icon-wrapper {
    width: 35px;
    height: 35px;
  }

  .toast-icon-wrapper i {
    font-size: 1.25rem !important;
  }

  .toast-body strong {
    font-size: 0.95rem;
  }

  .toast-message {
    font-size: 0.85rem;
  }
}