/* responsive-plane.css */

/* Hauptbereich: Simulation bekommt mehr Platz */
.main-column {
    min-width: 0;
  }
  
  .main-visual-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
    min-width: 0;
  }
  
  /* Canvas-Karte */
  .canvas-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
  }
  
  /* Toolbar bleibt oben, Canvas nimmt den restlichen Platz */
  .canvas-sim-toolbar {
    flex: 0 0 auto;
  }
  
  /* Der eigentliche Rahmen der Flugzeug-Simulation */
  .canvas-frame {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 400px;
    max-height: none;
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    padding: 12px 16px;
    overflow: hidden;
  
    background: linear-gradient(
      160deg,
      #f0f4f8 0%,
      #e8eef4 45%,
      #f5f8fb 100%
    );
  
    border: 1px solid #cdd8e4;
    border-radius: var(--radius-md);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.75),
      0 2px 8px rgba(15, 35, 55, 0.06);
  
    container-type: size;
    container-name: planeFrame;
  }
  
  /* Canvas selbst proportional einpassen */
  .canvas-frame canvas {
    display: block;
  
    max-width: 100%;
    max-height: 100%;
  
    width: auto;
    height: auto;
  
    object-fit: contain;
    object-position: center;
  
    border: none;
    border-radius: 0;
    background: transparent;
  }
  
  /* Desktop-Layout: Simulation links größer, Vorschau rechts kleiner */
  @media (min-width: 1025px) {
    .main-visual-row {
      grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.6fr);
      gap: 8px;
      align-items: stretch;
  
      min-height: calc(100vh - 120px);
    }
  
    .canvas-panel.main-card.card.card--primary {
      height: calc(100vh - 20px);
      min-height: 700px;
      padding: 8px 10px;
    }
  
    .canvas-frame {
      flex: 1 1 auto;
      height: 100%;
      min-height: 0;
      max-height: none;
    }
  
    .algorithm-preview-section.main-card.card.card--primary {
      height: calc(100vh - 20px);
      min-height: 700px;
  
      display: flex;
      flex-direction: column;
      min-width: 0;
      min-height: 0;
  
      padding: 8px 10px;
    }
  
    .algorithm-preview-section .preview-cabin-wrap {
      flex: 1 1 auto;
      min-height: 0;
      max-height: none;
      overflow: auto;
    }
  }
  
  /* Moderne Browser: Canvas exakt ins verfügbare Rechteck einpassen */
  @media (min-width: 1025px) {
    @supports (width: 1cqi) {
      .canvas-frame canvas {
        /*
          Seitenverhältnis deiner Simulation:
          BASE_WIDTH  = 1200
          BASE_HEIGHT = 980
        */
        width: min(100cqi, calc(100cqb * 1200 / 980));
        height: min(100cqb, calc(100cqi * 980 / 1200));
  
        max-width: none;
        max-height: none;
      }
    }
  }
  
  /* Mittlere Bildschirme */
  @media (max-width: 1024px) {
    .main-visual-row {
      grid-template-columns: 1fr;
      align-items: start;
    }
  
    .canvas-panel.main-card.card.card--primary {
      min-height: 520px;
    }
  
    .canvas-frame {
      min-height: 460px;
      height: auto;
    }
  
    .canvas-frame canvas {
      max-width: 100%;
      max-height: 100%;
    }
  
    .algorithm-preview-section.main-card.card.card--primary {
      height: auto;
      min-height: 0;
    }
  }
  
  /* Kleine Bildschirme */
  @media (max-width: 600px) {
    .canvas-panel.main-card.card.card--primary {
      min-height: 420px;
    }
  
    .canvas-frame {
      min-height: 360px;
      padding: 8px;
    }
  
    .canvas-frame canvas {
      max-width: 100%;
      max-height: 100%;
    }
  }