/* Base styles are for desktop */
#custom-card-carousel {
  /* --- Customization Variables --- */
  --ccc-width: 90vw;
  --ccc-height: 40vh;
  --ccc-min-height: 400px; /* Prevents it from getting too small */
  --ccc-transition-speed: 0.6s;
  --ccc-shadow-idle: 0 15px 35px rgba(0, 0, 0, 0.2);
  --ccc-shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.15);
  /* --- End Customization --- */
  position: relative;
  width: var(--ccc-width);
  max-width: var(--ccc-max-width);
  height: var(--ccc-height);
  min-height: var(--ccc-min-height);
  margin: 2rem auto;
  perspective: 1500px;
  box-shadow: var(--ccc-shadow-idle);
  border-radius: 16px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  transform: translateY(0);
}

#custom-card-carousel:hover {
  box-shadow: var(--ccc-shadow-hover);
  transform: translateY(2px);
}

.ccc-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--bs-border-radius);
}

.ccc-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  opacity: 0;
  transition: transform var(--ccc-transition-speed) ease-in-out, opacity var(--ccc-transition-speed) ease;
  transform-style: preserve-3d;
}

/* Page States for Animation */
.ccc-page.ccc-active {
  opacity: 1;
  transform: translateX(0) rotateY(0);
  z-index: 10;
}

.ccc-page.ccc-next {
  transform: translateX(100%) rotateY(-45deg);
  z-index: 11;
}

.ccc-page.ccc-prev {
  transform: translateX(-100%) rotateY(45deg);
  z-index: 11;
}

/* Area layout */
.ccc-image-area, .ccc-description-area {
  width: 50%;
  height: 100%;
  padding: 3rem;
  box-sizing: border-box;
}

/* Alternating Layout Logic for desktop */
.ccc-page:nth-child(odd) {
  flex-direction: row;
}

.ccc-page:nth-child(even) {
  flex-direction: row-reverse;
}

/* Image Area Styling */
.ccc-image-area {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
  background-size: cover;
  background-position: center;
  color: white;
}

.ccc-image-area::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
  border-radius: inherit; /* Ensures overlay respects container's border radius */
}

.ccc-image-area h2 {
  position: relative;
  z-index: 2;
  font-size: 2.8rem;
  font-weight: bold;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}

/* Description Area Styling */
.ccc-description-area {
  background: #ffffff;
  color: #333;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Navigation Arrows */
.ccc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px; /* Made smaller */
  height: 40px; /* Made smaller */
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background-color 0.2s, transform 0.2s;
  font-size: 18px; /* Made smaller */
  display: flex;
  align-items: center;
  justify-content: center;
}

.ccc-arrow:hover {
  background-color: #fff;
  transform: translateY(-50%) scale(1.1);
}

.ccc-arrow-prev {
  left: -15px;
} /* Moved closer */
.ccc-arrow-next {
  right: -15px;
} /* Moved closer */
/* --- Pagination Styling --- */
.ccc-pagination {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 6px 8px;
  border-radius: 1px;
  display: flex;
  gap: 8px;
}

.ccc-dot {
  width: 14px;
  height: 14px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 1px;
  transition: background-color 0.3s ease;
}

.ccc-dot.active {
  background-color: #ffffff;
}

/* --- RESPONSIVE STYLES --- */
/* Tablet Portrait (and below) */
@media (max-width: 992px) {
  .ccc-image-area h2 {
    font-size: 2.4rem;
  }
  .ccc-description-area {
    font-size: 1rem;
  }
  .ccc-image-area, .ccc-description-area {
    padding: 2rem;
  }
}
/* Mobile Landscape & Large Phones (and below) */
@media (max-width: 768px) {
  #custom-card-carousel {
    --ccc-height: 75vh;
    --ccc-width: 90vw;
    --ccc-min-height: 400px;
  }
  /* Stack image and description vertically */
  .ccc-page, .ccc-page:nth-child(even), .ccc-page:nth-child(odd) {
    flex-direction: column;
  }
  .ccc-image-area, .ccc-description-area {
    width: 100%;
  }
  .ccc-image-area {
    height: 45%;
    justify-content: center;
    align-items: center;
    text-align: center;
  }
  .ccc-description-area {
    height: 55%;
    padding: 1.5rem 2rem;
  }
  .ccc-arrow {
    top: 45%; /* Move arrows to vertical center of image area */
    width: 45px;
    height: 45px;
  }
  .ccc-pagination {
    bottom: calc(55% - 25px); /* Position pagination in the description area */
  }
}
/* Mobile Portrait (and below) */
@media (max-width: 500px) {
  #custom-card-carousel {
    --ccc-height: 70vh;
    --ccc-min-height: 450px;
  }
  .ccc-image-area h2 {
    font-size: 2rem;
  }
  .ccc-description-area {
    font-size: 0.95rem;
  }
  .ccc-arrow {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .ccc-arrow-prev {
    left: -5px;
  }
  .ccc-arrow-next {
    right: -5px;
  }
}