/* PDF Container Styles */
.pdf-container {
  background: var(--corporate-dark);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

#pdf-viewer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Canvas Container Styles */
#pdf-canvas-container,
#pdf-canvas-container-fs {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 600px;
  overflow: auto;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-sizing: border-box;
  margin: 0;
}

.canvas-wrapper {
  position: relative;
  display: inline-block;
  min-width: min-content;
  min-height: min-content;
  margin: auto;
}

#pdf-canvas,
#pdf-canvas-fs {
  display: block;
  max-width: none;
  height: auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Toolbar Styles */
.pdf-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  background: transparent;
  z-index: 1001;
  margin: 0;
  width: 100%;
}

/* Nur für Fullscreen-Modus den dunklen Hintergrund beibehalten */
.pdf-fullscreen .pdf-toolbar {
  background: var(--corporate-dark);
}

.pdf-toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.page-controls,
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Control Button Styles */
.control-button {
  background: white;
  border: 1px solid var(--corporate-orange);
  color: var(--corporate-orange);
  min-width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.control-button:hover {
  /* Setze Hover-Hintergrund auf 30% corporate-orange */
  background: color-mix(in srgb, var(--corporate-orange) 30%, transparent);
  /* Ändere Textfarbe auf weiß */
  color: white;
}

/* Stelle sicher, dass auch das Icon im Button weiß wird */
.control-button:hover i {
  color: white;
}

.control-button i {
  font-size: 18px;
  color: var(--corporate-orange);
}

/* Info Display Styles */
#page-info,
#page-info-fs {
  color: var(--corporate-orange);
  font-size: 14px;
  min-width: 40px;
  text-align: center;
  padding: 0;
  margin: 0;
}

#zoom-level,
#zoom-level-fs {
  color: var(--corporate-orange);
  font-size: 14px;
  min-width: 60px;
  text-align: center;
}

/* Fullscreen Styles */
.pdf-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--corporate-dark);
  z-index: 9999;
  display: none;
  flex-direction: column;
}

.pdf-fullscreen.active {
  display: flex;
}

/* Desktop Fullscreen Styles */
@media (min-width: 769px) {
  .pdf-fullscreen .pdf-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1101;
  }

  .pdf-fullscreen #pdf-canvas-container-fs {
    flex: 1;
    margin: 44px 0 60px 0;
    padding: 0;
  }

  .pdf-fullscreen .pdf-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1101;
  }
}

/* Mobile Fullscreen Styles */
@media (max-width: 768px) {
  #pdf-canvas-container {
    height: 400px;
    padding: 10px;
  }

  .pdf-container {
    padding: 10px 0;
  }

  .pdf-toolbar {
    padding: 8px 0;
    margin-top: 0;
  }

  .pdf-toolbar-group {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 0;
    margin: 0;
  }

  .toolbar-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
  }

  .page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  /* Verstecke Zoom-Controls und Fit-to-View in mobiler Ansicht */
  .zoom-controls,
  #zoom-fit {
    display: none !important;
  }

  #page-info {
    min-width: 40px;
    padding: 0;
    margin: 0;
  }

  .control-button {
    min-width: 32px;
    height: 32px;
    padding: 0;
  }

  .control-button i {
    font-size: 16px;
  }

  /* Spezifische Anordnung für die Toolbar-Sections */
  .toolbar-section:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .toolbar-section:last-child {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  /* Hide normal toolbar in fullscreen mode */
  .pdf-fullscreen ~ .media-section .pdf-toolbar {
    display: none !important;
  }

  .pdf-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--corporate-dark);
    z-index: 9999;
    padding: 0;
    margin: 0;
  }

  .pdf-fullscreen .pdf-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 170, 58, 0.2);
    padding: env(safe-area-inset-top) 16px 0 16px;
    z-index: 10000;
  }

  .pdf-fullscreen #pdf-canvas-container-fs {
    flex: 1;
    margin: 44px 0 80px 0;
    padding: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    background: var(--corporate-dark);
  }

  .pdf-fullscreen .pdf-toolbar {
    position: fixed;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    right: 0;
    height: 70px;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 170, 58, 0.2);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .pdf-fullscreen .pdf-toolbar-group {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
  }

  .pdf-fullscreen .toolbar-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }

  .pdf-fullscreen .control-button {
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid var(--corporate-orange);
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
  }

  .pdf-fullscreen .control-button i {
    font-size: 18px;
  }

  /* Verstecke Zoom-Level im mobilen Vollbild */
  .pdf-fullscreen #zoom-level-fs {
    display: none;
  }

  /* Anpassung des Canvas-Containers für die neue Toolbar-Höhe */
  .pdf-fullscreen #pdf-canvas-container-fs {
    margin-bottom: 70px;
  }

  /* Verstecke alle anderen Elemente im Vollbildmodus */
  .pdf-fullscreen.active ~ * {
    display: none !important;
    z-index: -1 !important;
  }

  /* Verstecke die Browser-UI */
  .pdf-fullscreen.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
  }

  .page-controls {
    gap: 8px;
  }

  .toolbar-section {
    gap: 12px;
  }

  .pdf-toolbar-group {
    gap: 12px;
  }
}

/* Scrollbar Styling */
#pdf-canvas-container::-webkit-scrollbar,
#pdf-canvas-container-fs::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: rgba(255, 170, 58, 0.1);
  border-radius: 4px;
}

#pdf-canvas-container::-webkit-scrollbar-thumb,
#pdf-canvas-container-fs::-webkit-scrollbar-thumb {
  background: var(--corporate-orange);
  border-radius: 4px;
  min-height: 40px;
  min-width: 40px;
}

#pdf-canvas-container::-webkit-scrollbar-corner,
#pdf-canvas-container-fs::-webkit-scrollbar-corner {
  background: rgba(255, 170, 58, 0.1);
} 


.pdf-container {
  
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

#pdf-viewer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#pdf-canvas-container {
  width: 100%;
  height: 600px;
  overflow: auto;
  background: white;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  position: relative;
}

#pdf-canvas-container-fs {
  flex: 1;
  margin: 20px 0;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
}

.canvas-wrapper {
  position: relative;
  display: inline-block;
  min-width: min-content;
  min-height: min-content;
  margin: auto;
}

#pdf-canvas,
#pdf-canvas-fs {
  display: block;
  max-width: none;
  height: auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Scrollbar Styling */
#pdf-canvas-container::-webkit-scrollbar,
#pdf-canvas-container-fs::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: rgba(255, 170, 58, 0.1);
  border-radius: 4px;
}

#pdf-canvas-container::-webkit-scrollbar-thumb,
#pdf-canvas-container-fs::-webkit-scrollbar-thumb {
  background: var(--corporate-orange);
  border-radius: 4px;
  min-height: 40px;
  min-width: 40px;
}

#pdf-canvas-container::-webkit-scrollbar-corner,
#pdf-canvas-container-fs::-webkit-scrollbar-corner {
  background: rgba(255, 170, 58, 0.1);
}

@media (max-width: 768px) {
  #pdf-canvas-container {
    height: 400px;
    padding: 10px;
  }
}

.pdf-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.pdf-toolbar-group {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.page-controls, .zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#page-info, #page-info-fs {
  color: var(--corporate-orange);
  font-size: 14px;
  
  text-align: center;
}

#zoom-level, #zoom-level-fs {
  color: var(--corporate-orange);
  font-size: 14px;
  min-width: 60px;
  text-align: center;
}

.control-button {
  background: white;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--corporate-dark);
  z-index: 9999;
  display: none;
  flex-direction: column;
}

.pdf-fullscreen.active {
  display: flex;
}

/* PDF Loading Animation */
.pdf-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 4px;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s;
}

.pdf-loading.active {
  opacity: 1;
}

.pdf-loading .circle {
  width: 8px;
  height: 8px;
  background: var(--corporate-orange);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.pdf-loading .circle:nth-child(2) {
  animation-delay: 0.2s;
}

.pdf-loading .circle:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(0.5);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Dropdown Styles */
.pdf-toolbar select,
.document-toolbar select {
  width: 150px;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
  .pdf-toolbar select,
  .document-toolbar select {
    width: 120px;
  }
}

/* iOS spezifische Anpassungen */
@supports (-webkit-touch-callout: none) {
  .pdf-toolbar select,
  .document-toolbar select {
    -webkit-appearance: menulist;
    appearance: menulist;
  }
}