@import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Playfair+Display:wght@400;500;600;700&display=swap");

:root {
  /* Color palette */
  --primary-color: #0a1c2e;  
  --primary-light: #0f2c4b; 
  --secondary-color: #06121f; 
  --background-color: #f8f8f8;
  --card-color: #ffffff;
  --text-color: #333333;
  --text-color-light: #666666;
  --text-color-muted: #888888;
  --text-c-highlight: #3399ff;  
  --accent-c-1: #a3d9a5;
  --accent-c-2: #f1f1f1;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --shadow-color-strong: rgba(0, 0, 0, 0.15);
  --overlay-color: rgba(0, 0, 0, 0.5);
  --transition-speed: 0.3s;
  --border-radius: 12px;
  --focus-outline: 2px solid #0a1c2e; 
  --tooltip-bg: rgba(0, 0, 0, 0.8);
}

body {
  font-family: "Lato", sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  min-height: 100vh;
  background-color: #fff6ec;
  /* color: var(--text-color); */
}

.page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
  font-weight: 600;
  color: var(--primary-color);
}

.page-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
}

.page-title::after {
  content: "";
  display: block;
  width: 100px;
  height: 3px;
  background: var(--text-c-highlight);
  margin: 15px auto 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: var(--text-color-light);
}

.breadcrumb-separator {
  margin: 0 10px;
  font-size: 0.8rem;
}

#breadcrumb-item {
  font-weight: 600;
  color: var(--primary-color);
}

.content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 25px;
  min-height: 600px;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel {
  position: relative;
  width: 100%;
  height: 600px;
  overflow: hidden;
  background: var(--card-color);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 30px var(--shadow-color);
  transition: transform var(--transition-speed);
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius);
  transition: all 0.5s ease-in-out;
  cursor: zoom-in;
  max-width: 100%; /* Ensure image doesn't exceed container width */
}

.carousel.zoomed img {
  cursor: zoom-out;
  transform: scale(1.5);
}

/* Enhanced image caption */
.image-caption {
  position: absolute;
  bottom: 120px;
  left: 0;
  right: 0;
  padding: 12px 20px;
  background: var(--overlay-color);
  color: white;
  font-size: 0.9rem;
  text-align: center;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.carousel:hover .image-caption {
  transform: translateY(0);
  opacity: 1;
}

/* Image counter */
.image-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 8px 12px;
  background: var(--overlay-color);
  color: white;
  font-size: 0.85rem;
  border-radius: 20px;
  z-index: 10;
}

#currentImageNum {
  font-weight: 700;
}

/* Enhanced loading states */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-top: 6px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
  z-index: 5;
}

.loading-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--accent-c-2) 25%,
    #e0e0e0 50%,
    var(--accent-c-2) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--border-radius);
  display: none;
  z-index: 4;
}

/* Overlay carousel controls */
/* Overlay carousel controls */
.carousel-controls-overlay {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px; /* Add spacing between buttons */
  padding: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 20;
  pointer-events: none;
}

.carousel:hover .carousel-controls-overlay {
  opacity: 1;
}

.carousel-button-circle {
  background: var(--overlay-color);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
  pointer-events: auto;
  position: relative;
}

.slideshow-toggle {
  /* Remove absolute positioning to align with flex layout */
  position: static;
  transform: none;
}

/* .carousel-button-circle:hover {
  background: var(--primary-color);
} */

.carousel-button-circle:focus {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Top control buttons */
.top-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.control-button {
  background: var(--overlay-color);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.control-button:hover {
  background: var(--primary-color);
  transform: scale(1.1);
}

.control-button:focus {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Tooltips for better discoverability */
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 100;
}

/* Swipe indicators for touch devices */
.swipe-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--overlay-color);
  color: white;
  width: 40px;
  height: 80px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 15;
}

.left-swipe {
  left: 10px;
}

.right-swipe {
  right: 10px;
}

/* Only show on touch devices */
@media (hover: none) {
  .carousel:active .swipe-indicator {
    opacity: 0.7;
    transform: translateY(-50%) scale(1.1);
  }
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
  padding: 8px 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 30px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.indicator:hover {
  transform: scale(1.3);
  background: rgba(255, 255, 255, 0.8);
}

.indicator.active {
  background: white;
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Selection list improvements */
.selection-list {
  background: var(--primary-color);
  padding: 25px;
  height: 600px;
  width: auto;
  overflow-y: auto;
  box-shadow: 0 8px 30px var(--shadow-color);
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  scrollbar-width: none; /* For Firefox */
  -ms-overflow-style: none; /* For Internet Explorer and Edge */
}

.gallery-items-container {
  list-style-type: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.gallery-item {
  display: grid;
  grid-template-columns: 1fr 80px;
  grid-template-areas:
    "title thumbnail"
    "desc thumbnail";
  gap: 8px;
  padding: 12px;
  cursor: pointer;
  background: var(--secondary-color);
  margin: 15px;
  border-radius: 10px;
  transition: all 0.2s;
  text-align: left;
  border-left: 5px solid var(--text-color);
  box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.3);
  color: white;
  position: relative;
  overflow: hidden; /* This prevents content from leaking out */
  align-items: start; /* Aligns grid items at the start of the container */
}

/* Ensure text content doesn't push layout in unexpected ways */
.room-title,
.event-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: white;
  font-size: 1.1em;
  grid-area: title;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden; /* Prevent text overflow */
  text-overflow: ellipsis; /* Add ellipsis for overflowing text */
  /* white-space: nowrap; Keep title on one line */
}.room-description,
.event-description {
  font-size: 0.95em;
  color: white;
  line-height: 1.5;
  grid-area: desc;
  overflow: hidden; /* Prevent text overflow */
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  line-clamp: 2; /* Standard property for compatibility */
  -webkit-box-orient: vertical;
  text-overflow: ellipsis; /* Add ellipsis for overflowing text */
}

.gallery-item:hover {
  transform: translateX(4px);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.gallery-item.active {
  border-left: 4px solid var(--text-c-highlight);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.gallery-item:focus {
  outline-offset: 2px;
}

.selection-list::-webkit-scrollbar {
  display: none; /* For Chrome, Safari, and Opera */
}
.category-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.category-button {
  background: var(--secondary-color);
  border: none;
  padding: 12px 25px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  color: white;
  box-shadow: 0 4px 10px var(--shadow-color);
  flex: 1;
  text-align: center;
  transition: all 0.3s;
}

.category-button:hover {
  color: var(--text-c-highlight);
  transform: translateY(-2px);
}

.category-button.active {
  color: var(--text-c-highlight);
}


/* Search filter */
.filter-search {
  position: relative;
  margin-bottom: 20px;
}

#searchFilter {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border: 1px solid var(--accent-c-2);
  border-radius: 30px;
  font-size: 0.9rem;
  transition: all 0.3s;
}

#searchFilter:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(76, 0, 0, 0.1);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-color-muted);
}

/* Enhanced list items */
.selection-list ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.selection-list li {
  display: grid;
  grid-template-columns: 1fr 80px; /* Increase the thumbnail column width */
  grid-template-areas:
    "title thumbnail"
    "desc thumbnail";
  gap: 8px; /* Reduce the gap */
  padding: 12px; /* Adjust padding */
  /* other properties remain the same */


  cursor: pointer;
  background: var(--secondary-color);
  margin: 15px;
  border-radius: 10px;
  transition: all 0.2s;
  text-align: left;
  border-left: 5px solid var(--text-color);
  box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.3);
  color: white;
  display: grid;
  position: relative;
  
}

.selection-list li:hover {
  transform: translateX(4px);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.selection-list li.active {
  border-left: 4px solid var(--text-c-highlight);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.selection-list li:focus {
  /* outline: var(--focus-outline); */
  outline-offset: 2px;
}

.room-title,
.event-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: white;
  font-size: 1.1em;
  grid-area: title;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.room-description,
.event-description {
  font-size: 0.95em;
  color: white;
  line-height: 1.5;
  grid-area: desc;
  overflow: hidden; /* Prevent text overflow */
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  line-clamp: 2; 
  -webkit-box-orient: vertical;
  text-overflow: ellipsis; /* Add ellipsis for overflowing text */
}

/* Badge for image count */
.badge {
  background: var(--primary-color);
  color: white;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 15px;
  font-weight: normal;
  margin-left: 8px;
}

/* Thumbnail for list items */
.thumbnail {
  width: 70px;  /* Match the grid column size */
  height: 70px;
  overflow: hidden;
  border-radius: 6px;
  grid-area: thumbnail;
  justify-self: end;
  align-self: center;
  position: relative; /* Ensures the container controls the image positioning */
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s;
  position: relative; /* Keep image positioned relative to its container */
  max-width: 100%; /* Ensure image doesn't exceed container width */
  max-height: 100%; /* Ensure image doesn't exceed container height */
}

.selection-list li:hover .thumbnail img {
  transform: scale(1.1);
}

/* Grid view for all images */
.grid-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--card-color);
  border-radius: var(--border-radius);
  z-index: 30;
  padding: 20px;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
}

.grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.grid-header h3 {
  margin: 0;
}

.grid-close {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-close:hover {
  background: var(--primary-light);
}

.grid-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  overflow-y: auto;
}

.grid-item {
  height: 150px;
  border-radius: 8px;
  overflow: hidden; /* Prevent content leaking */
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s;
}

.grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px var(--shadow-color-strong);
}

.grid-item:hover img {
  transform: scale(1.1);
}

.grid-item.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 3px solid var(--primary-color);
  border-radius: 8px;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Media Queries - Responsive Improvements */
@media (min-width: 993px) and (max-width: 1200px) {
  .content {
    grid-template-columns: 1fr 280px;
  }

  .carousel {
    height: 550px;
  }

  .selection-list {
    height: 550px;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  .content {
    grid-template-columns: 2fr 1fr;
    gap: 20px;
  }

  .carousel {
    height: 500px;
  }

  .selection-list {
    height: 500px;
  }
}

@media (max-width: 768px) {
  .content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .carousel {
    height: 50vh;
    min-height: 350px;
  }

  .selection-list {
    height: auto;
    max-height: 500px;
  }

  .page-title {
    font-size: 2rem;
  }

  .carousel-button-circle {
    width: 40px;
    height: 40px;
  }

  .image-caption {
    bottom: 80px;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .page-container {
    padding: 15px;
  }

  .carousel {
    height: 300px;
  }

  .carousel-button-circle {
    width: 35px;
    height: 35px;
  }

  .control-button {
    width: 35px;
    height: 35px;
  }

  .carousel-indicators {
    padding: 5px 10px;
  }

  .indicator {
    width: 10px;
    height: 10px;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .page-title::after {
    width: 70px;
    height: 2px;
  }

  .category-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .selection-list li {
    padding: 12px;
    margin: 10px 0;
  }

  .room-title,
  .event-title {
    font-size: 1em;
  }

  .thumbnail {
    width: 50px;
    height: 50px;
  }

  .grid-images {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .grid-item {
    height: 120px;
  }
}

/* Animation for slideshow and transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.carousel img.animate {
  animation: fadeIn 0.5s ease-in-out;
}

/* Accessibility focus styles */
:focus {
  /* outline: var(--focus-outline); */
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Print styles */
@media print {
  .carousel-controls-overlay,
  .carousel-indicators,
  .top-controls,
  .image-counter,
  .selection-list,
  .swipe-indicator {
    display: none !important;
  }

  .content {
    grid-template-columns: 1fr;
  }

  .carousel {
    box-shadow: none;
    height: auto;
    page-break-inside: avoid;
  }

  .page-title::after {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  h1,
  h2,
  h3,
  h4 {
    color: black;
  }

  .image-caption {
    position: static;
    background: none;
    color: black;
    opacity: 1;
    transform: none;
    padding: 10px 0;
    text-align: center;
    font-style: italic;
  }
}

/* Fallback styles for older browsers */
.no-js .carousel-controls-overlay,
.no-js .carousel-indicators,
.no-js .loading-spinner,
.no-js .loading-skeleton {
  display: none;
}

.no-js .carousel img {
  cursor: default;
}

/* CSS for section title */
.section-title {
  font-family: "Inter", sans-serif;
  text-align: center;
  font-size: 2rem;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 1rem;
  font-weight: 600;
  margin-top: 5rem !important; /* Adding !important to override other styles */
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--text-c-highlight)
  );
  border-radius: 2px;
}

/* Scroll Animation for reveal effect */
.reveal {
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
