/**
 * Gutachter-Ansicht Styles – Remote-Gutachten
 * Desktop-optimiertes Layout für Gutachter
 * Mobile-First mit Desktop-Erweiterungen
 */

/* ========================================
   LAYOUT CONTAINER
   ======================================== */

.gutachter-app {
  /* Vollbild */
  width: 100vw;
  height: 100vh;
  height: 100dvh;

  /* Layout */
  display: flex;
  flex-direction: column;

  /* Verhindert Scrollen */
  overflow: hidden;

  /* Hintergrund */
  background-color: var(--color-bg-primary);
}


/* ========================================
   HEADER
   ======================================== */

.gutachter-header {
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: space-between;

  /* Größe */
  height: 64px;
  padding: 0 var(--spacing-lg);

  /* Farben */
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);

  /* Z-Index */
  z-index: var(--z-controls);

  /* Verhindert Shrink */
  flex-shrink: 0;
}

.gutachter-header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.gutachter-logo {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  text-decoration: none;
}

.gutachter-logo:hover {
  color: var(--color-primary);
}

.gutachter-session-id {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-family: var(--font-family-mono);
  padding: var(--spacing-xs) var(--spacing-sm);
  background-color: var(--color-bg-primary);
  border-radius: var(--radius-sm);
}

.gutachter-header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}


/* ========================================
   STATUS INDICATOR
   ======================================== */

.gutachter-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-full);
  background-color: var(--color-bg-primary);
}

.gutachter-status.online {
  color: var(--color-success);
}

.gutachter-status.offline {
  color: var(--color-error);
}

.gutachter-status.connecting {
  color: var(--color-warning);
}

.gutachter-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  animation: pulse 2s ease-in-out infinite;
}


/* ========================================
   MAIN LAYOUT
   ======================================== */

.gutachter-main {
  /* Layout */
  flex: 1;
  display: flex;
  flex-direction: column;

  /* Overflow */
  overflow: hidden;

  /* Mobile: Stacked Layout */
  gap: 0;
}

/* Desktop: 2-Column Layout */
@media (min-width: 768px) {
  .gutachter-main {
    flex-direction: row;
    gap: 0;
  }
}


/* ========================================
   VIDEO BEREICH (Links/Oben)
   ======================================== */

.gutachter-video-section {
  /* Layout */
  flex: 1;
  display: flex;
  flex-direction: column;

  /* Position */
  position: relative;

  /* Overflow */
  overflow: hidden;

  /* Hintergrund */
  background-color: var(--color-video-bg);
}

.gutachter-video-wrapper {
  /* Nimmt gesamten Platz ein */
  flex: 1;

  /* Position für Overlays */
  position: relative;

  /* Overflow */
  overflow: hidden;
}

.gutachter-video-main {
  /* Vollbild */
  width: 100%;
  height: 100%;

  /* Z-Index */
  position: relative;
  z-index: var(--z-video);

  /* Video-Styles aus base.css */
}

/* Selbst-Vorschau (Picture-in-Picture) */
.gutachter-pip {
  /* Position */
  position: absolute;
  bottom: var(--spacing-md);
  right: var(--spacing-md);
  z-index: var(--z-controls);

  /* Größe */
  width: 120px;
  height: 160px;

  /* Border */
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;

  /* Schatten */
  box-shadow: var(--shadow-xl);

  /* Hintergrund */
  background-color: var(--color-bg-secondary);

  /* Transition */
  transition: all var(--transition-base);
}

.gutachter-pip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gutachter-pip.hidden {
  display: none;
}

@media (min-width: 768px) {
  .gutachter-pip {
    width: 160px;
    height: 213px;
  }
}


/* ========================================
   VIDEO INFO BAR
   ======================================== */

.gutachter-video-info {
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);

  /* Größe */
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: 48px;

  /* Farben */
  background-color: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);

  /* Verhindert Shrink */
  flex-shrink: 0;
}

.gutachter-video-info-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.gutachter-video-info-icon {
  width: 16px;
  height: 16px;
}


/* ========================================
   SIDEBAR (Rechts/Unten)
   ======================================== */

.gutachter-sidebar {
  /* Größe */
  width: 100%;
  flex-shrink: 0;

  /* Layout */
  display: flex;
  flex-direction: column;

  /* Farben */
  background-color: var(--color-bg-secondary);
  border-left: 1px solid var(--color-border);

  /* Overflow */
  overflow: hidden;
}

@media (min-width: 768px) {
  .gutachter-sidebar {
    width: var(--sidebar-width);
  }
}

@media (min-width: 1024px) {
  .gutachter-sidebar {
    width: var(--sidebar-width-lg);
  }
}

/* Mobile: Sidebar unten mit fixer Höhe */
@media (max-width: 767px) {
  .gutachter-sidebar {
    height: 240px;
    border-left: none;
    border-top: 1px solid var(--color-border);
  }
}


/* ========================================
   CONTROLS SECTION
   ======================================== */

.gutachter-controls-section {
  /* Größe */
  padding: var(--spacing-lg);

  /* Border */
  border-bottom: 1px solid var(--color-border);

  /* Verhindert Shrink */
  flex-shrink: 0;
}

.gutachter-controls-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-md);
}

.gutachter-controls-grid {
  /* Layout */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

@media (min-width: 1024px) {
  .gutachter-controls-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gutachter-control-btn {
  /* Größe */
  min-height: var(--touch-target-optimal);
  padding: var(--spacing-sm);

  /* Layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);

  /* Farben */
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);

  /* Border */
  border-radius: var(--radius-md);

  /* Cursor */
  cursor: pointer;

  /* Transition */
  transition: all var(--transition-fast);

  /* Touch */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.gutachter-control-btn:hover {
  background-color: var(--color-bg-tertiary);
  border-color: var(--color-border-light);
}

.gutachter-control-btn:active {
  transform: scale(0.98);
}

.gutachter-control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gutachter-control-btn.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.gutachter-control-btn.danger {
  background-color: var(--color-error);
  border-color: var(--color-error);
}

.gutachter-control-btn.danger:hover {
  background-color: var(--color-error-hover);
}

.gutachter-control-icon {
  width: 24px;
  height: 24px;
}

.gutachter-control-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-align: center;
}


/* ========================================
   PHOTO GALLERY SECTION
   ======================================== */

.gutachter-gallery-section {
  /* Layout */
  flex: 1;
  display: flex;
  flex-direction: column;

  /* Overflow */
  overflow: hidden;
}

.gutachter-gallery-header {
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: space-between;

  /* Größe */
  padding: var(--spacing-md) var(--spacing-lg);

  /* Border */
  border-bottom: 1px solid var(--color-border);

  /* Verhindert Shrink */
  flex-shrink: 0;
}

.gutachter-gallery-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
}

.gutachter-gallery-count {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
  background-color: var(--color-bg-primary);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-full);
}

.gutachter-gallery-grid {
  /* Layout */
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);

  /* Grid */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--spacing-md);
  align-content: start;

  /* Scrollbar Styling */
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.gutachter-gallery-grid::-webkit-scrollbar {
  width: 8px;
}

.gutachter-gallery-grid::-webkit-scrollbar-track {
  background: transparent;
}

.gutachter-gallery-grid::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: var(--radius-full);
}

.gutachter-gallery-item {
  /* Aspect Ratio */
  position: relative;
  aspect-ratio: 1 / 1;

  /* Border */
  border-radius: var(--radius-md);
  overflow: hidden;

  /* Cursor */
  cursor: pointer;

  /* Transition */
  transition: all var(--transition-fast);
}

.gutachter-gallery-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

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

.gutachter-gallery-empty {
  /* Layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);

  /* Größe */
  padding: var(--spacing-2xl);

  /* Text */
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

.gutachter-gallery-empty-icon {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}


/* ========================================
   FOOTER
   ======================================== */

.gutachter-footer {
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: space-between;

  /* Größe */
  height: 48px;
  padding: 0 var(--spacing-lg);

  /* Farben */
  background-color: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);

  /* Verhindert Shrink */
  flex-shrink: 0;

  /* Z-Index */
  z-index: var(--z-controls);
}

.gutachter-footer-left,
.gutachter-footer-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.gutachter-footer-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.gutachter-footer-item.status-good {
  color: var(--color-success);
}

.gutachter-footer-item.status-warning {
  color: var(--color-warning);
}

.gutachter-footer-item.status-error {
  color: var(--color-error);
}

.gutachter-footer-icon {
  width: 14px;
  height: 14px;
}


/* ========================================
   RESPONSIVE ANPASSUNGEN
   ======================================== */

/* Tablet Portrait */
@media (max-width: 767px) {
  .gutachter-header {
    height: 56px;
    padding: 0 var(--spacing-md);
  }

  .gutachter-session-id {
    display: none; /* Zu klein auf Mobile */
  }

  .gutachter-footer {
    height: 40px;
    padding: 0 var(--spacing-md);
  }

  .gutachter-footer-item {
    font-size: 10px;
  }

  .gutachter-controls-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop Large */
@media (min-width: 1440px) {
  .gutachter-sidebar {
    width: 480px;
  }

  .gutachter-controls-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ========================================
   LANDSCAPE MODE (Mobile)
   ======================================== */

@media (max-width: 767px) and (orientation: landscape) {
  .gutachter-header {
    height: 48px;
  }

  .gutachter-footer {
    height: 36px;
  }

  .gutachter-sidebar {
    height: 180px;
  }

  .gutachter-controls-section {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .gutachter-controls-grid {
    gap: var(--spacing-sm);
  }
}


/* ========================================
   LOADING STATE
   ======================================== */

.gutachter-loading {
  /* Vollbild Overlay */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal);

  /* Layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);

  /* Hintergrund */
  background-color: var(--color-overlay-dark);

  /* Backdrop Blur */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gutachter-loading-text {
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}


/* ========================================
   HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: high) {
  .gutachter-control-btn {
    border-width: 2px;
  }

  .gutachter-header,
  .gutachter-footer,
  .gutachter-sidebar {
    border-width: 2px;
  }
}


/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .gutachter-header,
  .gutachter-footer,
  .gutachter-sidebar {
    display: none;
  }

  .gutachter-video-section {
    flex: 1;
  }
}
