/* ============================================
   Waygate Technologies - Aircraft Inspection Infographic
   ============================================ */

/* Poppins Font - Local */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/poppins-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/poppins-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/poppins-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/poppins-700.woff2') format('woff2');
}

/* CSS Variables for CI (can be customized later) */
:root {
  --primary-color: #00a19c;
  --primary-dark: #008580;
  --primary-light: #33b4b0;
  --secondary-color: #1a1a2e;
  --accent-color: #f7931e;
  --text-color: #333;
  --text-light: #666;
  --background-color: #f5f5f5;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.25);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --zoom-duration: 0.8s;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* ============================================
   Filter Bar
   ============================================ */
.filter-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--white);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-image {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.filter-nav {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid transparent;
  border-radius: 25px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: var(--primary-light);
  color: var(--white);
}

.filter-btn.active {
  background: var(--primary-color);
  color: var(--white);
}

/* ============================================
   Infographic Container
   ============================================ */
.infographic-wrapper {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #cbcde2 0%, #a0afc6 100%);
}

.infographic-container {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform;
}

/* Pan & Zoom Controls */
.pan-zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.pz-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--white);
  color: var(--text-color);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pz-btn:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: scale(1.05);
}

.pz-btn:active {
  transform: scale(0.95);
}

/* Cursor when panning is possible */
.infographic-wrapper {
  cursor: grab;
}

.infographic-wrapper:active {
  cursor: grabbing;
}

.infographic-container.zoomed {
  /* Transform will be set via JavaScript */
}

.background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.overlay-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.5s linear, filter 0.5s linear, transform 0.5s linear;
}

/* Crossfade: Current layer (sichtbar, oben) */
.overlay-image.overlay-current {
  z-index: 11;
  opacity: 1;
}

/* Crossfade: Next layer (darunter, startet unsichtbar) */
.overlay-image.overlay-next {
  z-index: 10;
}

/* Transition: Current fades out */
.overlay-image.overlay-current.fade-out {
  opacity: 0;
}


/* ============================================
   Hotspots
   ============================================ */
.hotspots-container {
  position: absolute;
  /* Dimensions and position set by JavaScript to match actual image */
  /* This compensates for object-fit: cover cropping */
  z-index: 20;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: all var(--transition-normal);
  z-index: 20;
}

.hotspot.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Invisible clickable area over the overlay icons */
.hotspot-area {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: transparent;
  transition: all var(--transition-normal);
}

.hotspot:hover .hotspot-area {
  background: rgba(0, 161, 156, 0.2);
  box-shadow: 0 0 20px rgba(0, 161, 156, 0.4);
}

/* Highlighted hotspots when filter is active */
.hotspot.highlighted .hotspot-area {
  background: rgba(0, 161, 156, 0.25);
  box-shadow: 0 0 25px rgba(0, 161, 156, 0.6);
}


/* ============================================
   Popup
   ============================================ */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  background: var(--white);
  border-radius: 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transition: all var(--transition-slow);
}

.popup-overlay.active .popup-container {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--background-color);
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.popup-close:hover {
  background: var(--primary-color);
  color: var(--white);
}

.popup-header {
  display: flex;
  gap: 25px;
  padding: 30px;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--white) 100%);
  border-bottom: 1px solid #eee;
}

.popup-image {
  flex-shrink: 0;
  width: 150px;
  height: 150px;
  background: var(--white);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.popup-image img {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
}

.popup-title-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.popup-tagline {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.popup-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 10px;
}

.popup-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.popup-category,
.popup-technology {
  padding: 4px 12px;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 500;
}

.popup-category {
  background: var(--primary-color);
  color: var(--white);
}

.popup-technology {
  background: var(--accent-color);
  color: var(--white);
}

.popup-body {
  padding: 25px 30px 30px;
  max-height: calc(85vh - 220px);
  overflow-y: auto;
}

.popup-description {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.7;
  margin-bottom: 25px;
}

.popup-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.popup-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
}

.popup-list {
  list-style: none;
}

.popup-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.popup-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .filter-bar {
    flex-direction: column;
    height: auto;
    padding: 15px;
    gap: 15px;
  }

  .filter-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .infographic-wrapper {
    top: 130px;
  }

  .hotspot-area {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 768px) {
  .popup-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .popup-sections {
    grid-template-columns: 1fr;
  }

  .popup-meta {
    justify-content: center;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* ============================================
   Zoom State Adjustments
   ============================================ */
body.zoomed .filter-bar {
  transform: translateY(-100%);
  opacity: 0;
}

body.zoomed .hotspot:not(.active) {
  opacity: 0.3;
}

body.popup-open .infographic-container {
  filter: blur(2px);
}

/* ============================================
   Popup Tabs
   ============================================ */
.popup-tabs {
  display: flex;
  background: var(--background-color);
  border-bottom: 1px solid #ddd;
}

.popup-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.popup-tab:hover {
  background: rgba(0, 161, 156, 0.1);
  color: var(--primary-color);
}

.popup-tab.active {
  color: var(--primary-color);
  background: var(--white);
}

.popup-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
}

.popup-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.popup-tab-content {
  display: none;
}

.popup-tab-content.active {
  display: block;
}

/* Video Container */
.video-container {
  position: relative;
  width: 100%;
  min-height: 300px;
}

.video-container video {
  width: 100%;
  max-height: 400px;
  background: #000;
  border-radius: 4px;
}

/* Gallery Container */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  min-height: 200px;
}

.gallery-item {
  aspect-ratio: 4/3;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 2rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 2rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* Downloads Container */
.downloads-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--background-color);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-color);
  transition: all var(--transition-fast);
}

.download-item:hover {
  background: var(--primary-light);
  color: var(--white);
}

.download-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.download-info {
  flex: 1;
}

.download-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.download-type {
  font-size: 0.8rem;
  opacity: 0.7;
}

.download-action {
  font-size: 1.5rem;
  opacity: 0.5;
}

.download-item:hover .download-action {
  opacity: 1;
}

/* No Content State */
.no-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-light);
  text-align: center;
}

.no-content-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.5;
}

.no-content p {
  font-size: 1rem;
}
