/* Hero Carousel */
.hero-carousel {
  height: 80vh;
  overflow: hidden;
  position: relative;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-position: center 25%;
  object-fit: cover;
  display: block;
}

.carousel-item:nth-child(3) .hero-image {
  object-position: center 100%;
}

.carousel-inner,
.carousel-item {
  height: 100%;
}

.carousel-item {
  background-size: cover;
  background-position: center;
}

.carousel-caption {
  bottom: 30%;
  background: transparent;
  border-radius: 15px;
  padding: 30px;
  padding-left: 50px;
  max-width: 700px;
  margin: 0;
  left: 15%;
  right: auto;
  backdrop-filter: none;
  animation: fadeInUp 1s ease;
  border-left: 5px solid #ffffff;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: 30px;
}

/* Carousel Caption Responsive Adjustments */
@media (max-width: 1536px) {
  .hero-title {
    font-size: 2.4rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }
}

@media (max-width: 1366px) {
  .carousel-caption {
    bottom: 25%;
    left: 12%;
    max-width: 650px;
    padding: 25px;
    padding-left: 40px;
  }

  .hero-title {
    font-size: 2.2rem;
    margin-bottom: 12px;
  }

  .hero-subtitle {
    font-size: 1.15rem;
    margin-bottom: 25px;
  }
}

@media (max-width: 992px) {
  .carousel-caption {
    bottom: 20%;
    left: 10%;
    max-width: 80%;
    padding: 20px;
    padding-left: 30px;
    border-left-width: 4px;
  }

  .hero-title {
    font-size: 2rem;
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .carousel-caption {
    top: 50%;
    bottom: auto;
    left: 5%;
    right: 5%;
    transform: translateY(-50%);
    max-width: 90%;
    padding: 15px;
    padding-left: 20px;
    border-left-width: 3px;
    animation: none;
  }

  .hero-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 15px;
  }

  .btn-outline-custom {
    padding: 8px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .carousel-caption {
    top: 50%;
    bottom: auto;
    left: 3%;
    right: 3%;
    transform: translateY(-50%);
    max-width: 94%;
    padding: 12px;
    padding-left: 15px;
    border-left-width: 2px;
    animation: none;
  }

  .hero-title {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }

  .hero-subtitle {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .btn-outline-custom {
    padding: 6px 16px;
    font-size: 0.85rem;
  }
}

.btn-outline-custom {
  background: var(--dark-gray);
  border: 2px solid var(--dark-gray);
  color: var(--bg-white);
  padding: 10px 30px;
  font-weight: 700;
  border-radius: 50px;
  transition: var(--transition);
}

.btn-outline-custom:hover {
  background: var(--dark-gray);
  color: var(--bg-white);
  transform: translateY(-3px);
}

/* Carousel arrows */
.carousel-control-prev,
.carousel-control-next {
  width: 60px;
  height: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

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

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

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(0, 0, 0, 0.5);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-size: 70%;
}

/* Surface Treatment Section  */
.silicon-sealing-section {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.silicon-sealing-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 20%,
      rgba(76, 29, 149, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(139, 92, 246, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 1;
}

.silicon-sealing-section > .container {
  position: relative;
  z-index: 2;
}

/* Header Animations */
.section-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: #4c1d95;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease forwards;
}

.animate-title {
  animation-delay: 0.2s;
}

.title-underline {
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #4c1d95, #8b5cf6);
  margin: 0 auto 2rem;
  border-radius: 2px;
  transform: scaleX(0);
  animation: scaleX 1s ease forwards;
  animation-delay: 0.8s;
}

.section-description {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #555;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
}

.animate-text {
  animation-delay: 1s;
}

/* Machine Grid */
.machines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.machine-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(50px);
  animation: fadeInUp 0.8s ease forwards;
  background: white;
}

.animate-card:nth-child(1) {
  animation-delay: 0.1s;
}
.animate-card:nth-child(2) {
  animation-delay: 0.2s;
}
.animate-card:nth-child(3) {
  animation-delay: 0.3s;
}
.animate-card:nth-child(4) {
  animation-delay: 0.4s;
}
.animate-card:nth-child(5) {
  animation-delay: 0.5s;
}
.animate-card:nth-child(6) {
  animation-delay: 0.6s;
}

.machine-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 50px rgba(76, 29, 149, 0.2);
}

.machine-image-container {
  position: relative;
  height: 280px;
  overflow: hidden;
}

.machine-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.machine-card:hover .machine-image {
  transform: scale(1.1);
}

.machine-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(76, 29, 149, 0.8),
    rgba(139, 92, 246, 0.6)
  );
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.machine-card:hover .machine-overlay {
  opacity: 1;
}

.machine-info {
  color: white;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.machine-card:hover .machine-info {
  transform: translateY(0);
}

.machine-info h4 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.machine-info p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.view-details-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.view-details-btn:hover {
  background: white;
  color: #4c1d95;
  transform: scale(1.05);
}

.view-details-btn i {
  margin-right: 0.5rem;
}

/* Modal Styles */
.machine-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  background-color: white;
  margin: 2% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 25px;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background: rgba(255, 0, 0, 0.7);
  transform: scale(1.1);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 80vh;
}

.modal-image-container {
  position: relative;
  overflow: hidden;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info {
  padding: 2rem;
  overflow-y: auto;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.modal-info h3 {
  color: #4c1d95;
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.modal-info p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 1.5rem;
}

.modal-specs,
.modal-features {
  margin-bottom: 2rem;
}

.modal-specs h4,
.modal-features h4 {
  color: #4c1d95;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.modal-specs ul,
.modal-features ul {
  list-style: none;
  padding: 0;
}

.modal-specs li,
.modal-features li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
  position: relative;
  padding-left: 1.5rem;
}

.modal-specs li::before,
.modal-features li::before {
  content: "💧";
  position: absolute;
  left: 0;
  color: #4c1d95;
  font-weight: bold;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleX {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .section-title {
    font-size: 2.5rem;
  }

  .machines-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .machine-card {
    margin: 0 1rem;
  }

  .modal-body {
    grid-template-columns: 1fr;
    height: auto;
  }

  .modal-image-container {
    height: 300px;
  }

  .modal-info {
    max-height: 400px;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 2rem;
  }

  .section-description {
    font-size: 1rem;
  }

  .modal-content {
    width: 95%;
    margin: 5% auto;
  }
}

/* Dark theme support */
.navbar-dark ~ * .silicon-sealing-section {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.3),
    rgba(76, 29, 149, 0.2)
  );
}

.navbar-dark ~ * .section-title {
  color: #8b5cf6;
}

.navbar-dark ~ * .section-description {
  color: #e9ecef;
}

.navbar-dark ~ * .machine-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.navbar-dark ~ * .modal-info {
  background: linear-gradient(135deg, #2d3748, #4a5568);
  color: #e9ecef;
}

.navbar-dark ~ * .modal-info h3,
.navbar-dark ~ * .modal-specs h4,
.navbar-dark ~ * .modal-features h4 {
  color: #8b5cf6;
}
