/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Edera color palette */
:root {
  --color-edera-teal-light: #a1f1e7;
  --color-edera-teal-primary: #00f5d6;
  --color-edera-teal-dark: #016b66;
  --color-edera-teal-deep: #013a3b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #00f5d6 0%, #016b66 100%);
  color: #ffffff;
  overflow: hidden;
  height: 100vh;
}

/* Gallery header with Edera branding */
.gallery-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-edera-teal-light);
  border-bottom: 1px solid rgba(1, 107, 102, 0.2);
  padding: 1rem 1.5rem;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.built-by-text {
  font-size: 0.875rem;
  color: var(--color-edera-teal-deep);
  font-weight: 500;
}

.edera-logo {
  height: 1.5rem;
  width: auto;
  transition: opacity 0.2s;
}

.header-branding a:hover .edera-logo {
  opacity: 0.8;
}

.header-branding a:focus {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--color-edera-teal-dark);
}

#gallery-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  padding-top: 60px; /* Account for fixed header */
}

/* Loading spinner */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 100;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: #ffffff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading p {
  font-size: 1.2rem;
  color: #ffffff;
}

/* Error state */
.error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background-color: rgba(220, 38, 38, 0.9);
  padding: 2rem;
  border-radius: 8px;
  z-index: 100;
}

.error p {
  font-size: 1.2rem;
}

.hidden {
  display: none;
}

/* Slideshow container */
.slideshow {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* Fit entire image within viewport without cropping */
  object-position: center; /* Keep image centered */
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  transform-origin: center center; /* Ensure transforms happen from center */
}

.gallery-image.active {
  opacity: 1;
  z-index: 1;
}

.gallery-image.next {
  z-index: 0;
}

/* Ken Burns effect variations - centered scaling that stays within viewport */
/* Image stays centered, only scale changes create the effect */
@keyframes kenburns-zoom-in {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

@keyframes kenburns-zoom-pan-left {
  0% {
    transform: scale(1) translateX(2%);
  }
  100% {
    transform: scale(1.05) translateX(-2%);
  }
}

@keyframes kenburns-zoom-pan-right {
  0% {
    transform: scale(1) translateX(-2%);
  }
  100% {
    transform: scale(1.05) translateX(2%);
  }
}

@keyframes kenburns-zoom-pan-up {
  0% {
    transform: scale(1) translateY(2%);
  }
  100% {
    transform: scale(1.05) translateY(-2%);
  }
}

@keyframes kenburns-zoom-pan-down {
  0% {
    transform: scale(1) translateY(-2%);
  }
  100% {
    transform: scale(1.05) translateY(2%);
  }
}

@keyframes kenburns-zoom-pan-diagonal-tl {
  0% {
    transform: scale(1) translate(2%, 2%);
  }
  100% {
    transform: scale(1.05) translate(-2%, -2%);
  }
}

@keyframes kenburns-zoom-pan-diagonal-tr {
  0% {
    transform: scale(1) translate(-2%, 2%);
  }
  100% {
    transform: scale(1.05) translate(2%, -2%);
  }
}

@keyframes kenburns-zoom-pan-diagonal-bl {
  0% {
    transform: scale(1) translate(2%, -2%);
  }
  100% {
    transform: scale(1.05) translate(-2%, 2%);
  }
}

@keyframes kenburns-zoom-pan-diagonal-br {
  0% {
    transform: scale(1) translate(-2%, -2%);
  }
  100% {
    transform: scale(1.05) translate(2%, 2%);
  }
}

/* Zoom out variations - start at scale 1.05, zoom out to 1 */
@keyframes kenburns-zoom-out {
  0% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes kenburns-zoom-out-left {
  0% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes kenburns-zoom-out-right {
  0% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes kenburns-zoom-out-up {
  0% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes kenburns-zoom-out-down {
  0% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Subtle zoom variations - very gentle motion */
@keyframes kenburns-pan-left-right {
  0% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1.03);
  }
}

@keyframes kenburns-pan-right-left {
  0% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1.02);
  }
}

@keyframes kenburns-pan-up-down {
  0% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1.03);
  }
}

@keyframes kenburns-pan-down-up {
  0% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1.02);
  }
}

/* Apply animation to all images (not just active) */
/* Animation starts immediately but only visible images are seen */
/* Animation duration matches rotation interval (7s) for smooth transitions */
.gallery-image.kb-zoom-in {
  animation: kenburns-zoom-in 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-pan-left {
  animation: kenburns-zoom-pan-left 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-pan-right {
  animation: kenburns-zoom-pan-right 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-pan-up {
  animation: kenburns-zoom-pan-up 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-pan-down {
  animation: kenburns-zoom-pan-down 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-pan-diagonal-tl {
  animation: kenburns-zoom-pan-diagonal-tl 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-pan-diagonal-tr {
  animation: kenburns-zoom-pan-diagonal-tr 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-pan-diagonal-bl {
  animation: kenburns-zoom-pan-diagonal-bl 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-pan-diagonal-br {
  animation: kenburns-zoom-pan-diagonal-br 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-out {
  animation: kenburns-zoom-out 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-out-left {
  animation: kenburns-zoom-out-left 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-out-right {
  animation: kenburns-zoom-out-right 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-out-up {
  animation: kenburns-zoom-out-up 7s ease-in-out forwards;
}

.gallery-image.kb-zoom-out-down {
  animation: kenburns-zoom-out-down 7s ease-in-out forwards;
}

.gallery-image.kb-pan-left-right {
  animation: kenburns-pan-left-right 7s ease-in-out forwards;
}

.gallery-image.kb-pan-right-left {
  animation: kenburns-pan-right-left 7s ease-in-out forwards;
}

.gallery-image.kb-pan-up-down {
  animation: kenburns-pan-up-down 7s ease-in-out forwards;
}

.gallery-image.kb-pan-down-up {
  animation: kenburns-pan-down-up 7s ease-in-out forwards;
}

/* Single image view (no animation) */
.gallery-image.single-image {
  animation: none;
  transform: none;
}

/* Call to action button with Edera theme */
.cta-container {
  position: fixed;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: white;
  border: 2px solid var(--color-edera-teal-dark);
  color: var(--color-edera-teal-deep);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cta-button:hover {
  background: var(--color-edera-teal-light);
  border-color: var(--color-edera-teal-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.cta-button:active {
  transform: translateY(0);
}

.cta-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-edera-teal-dark),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
  #gallery-container {
    padding-top: 50px; /* Reduced header height on mobile */
  }

  .gallery-header {
    padding: 0.75rem 1rem;
  }

  .edera-logo {
    height: 1.25rem;
  }

  .cta-container {
    bottom: 2rem;
  }

  .cta-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .built-by-text {
    font-size: 0.75rem;
  }

  .edera-logo {
    height: 1rem;
  }

  .cta-button {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* Cookie consent banner */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(26, 26, 26, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.cookie-consent-content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.cookie-consent-content a {
  color: #60a5fa;
  text-decoration: underline;
}

.cookie-consent-content a:hover {
  color: #93c5fd;
}

.cookie-consent-buttons {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cookie-btn-accept {
  background-color: var(--color-edera-teal-dark);
  color: #ffffff;
}

.cookie-btn-accept:hover {
  background-color: var(--color-edera-teal-deep);
  transform: translateY(-1px);
}

.cookie-btn-reject {
  background-color: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-reject:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

@media (max-width: 768px) {
  .cookie-consent {
    padding: 1rem;
  }

  .cookie-consent-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .cookie-consent-content p {
    font-size: 0.85rem;
  }

  .cookie-consent-buttons {
    width: 100%;
    justify-content: center;
  }

  .cookie-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .gallery-image,
  .cta-button,
  .spinner,
  .cookie-consent {
    animation: none;
    transition: none;
  }
}
