/* ========================================================= */
/* Header principal                                           */
/* ========================================================= */

.top {
  height: 56px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 0 12px;

  background: linear-gradient(
    180deg,
    var(--red),
    #5c1018
  );

  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);

  position: relative;
  z-index: 5;
}

/* ========================================================= */
/* Marque / Logo                                               */
/* ========================================================= */

.brand-block {
  display: flex;
  align-items: center;
  gap: 9px;

  min-width: max-content;
}

.brand-logo {
  display: block;

  width: 40px;
  height: 40px;

  min-width: 32px;
  max-width: 32px;

  flex: 0 0 20px;

  filter: drop-shadow(
    0 1px 1px rgba(0, 0, 0, 0.35)
  );
}

.brand-logo-body,
.brand-logo-wing {
  fill: #f6d89d;
}

.brand-logo-head {
  fill: #fff3d1;
}

.brand-logo-beak {
  fill: #e6b257;
}

.brand-logo-eye {
  fill: #111;
}

.brand-copy {
  line-height: 1.05;
}

.brand {
  font-size: 18px;
  font-weight: 900;
}

.brand-block small {
  color: #f7d9d9;
  font-weight: 600;
}

/* ========================================================= */
/* Menus supérieurs                                            */
/* ========================================================= */

.menu-bar {
  display: flex;
  align-items: center;
  gap: 6px;

  flex: 1;
}

.menu-root {
  background: rgba(255, 255, 255, 0.08);

  border-color: rgba(255, 255, 255, 0.22);

  color: #ffffff;
}

.actions {
  display: flex;
  gap: 6px;
}

.compact-actions button {
  padding: 7px 9px;
}

/* ========================================================= */
/* Barre des modes                                             */
/* ========================================================= */

.mode-strip {
  height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  background: var(--panel);

  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);

  position: relative;
  z-index: 4;
}

.mode-strip button {
  background: var(--button-bg);
  color: var(--button-txt);
}

.mode-strip button.active {
  background: var(--red);

  color: #ffffff;

  border-color: #ffbbbb;
}

.mode-strip kbd {
  margin-left: 4px;

  padding: 1px 5px;

  font-size: 11px;

  background: rgba(255, 255, 255, 0.18);

  border-radius: 5px;
}

/* ========================================================= */
/* Layout principal                                            */
/* ========================================================= */

.app {
  height: calc(
    100vh - 58px - 46px - 28px
  );

  display: grid;

  grid-template-columns:
    310px
    minmax(480px, 1fr)
    360px;

  min-height: 0;
}

.left,
.right {
  background: var(--panel);

  overflow: auto;

  padding: 12px;

  min-height: 0;

  border-right: 1px solid var(--line);
}

.right {
  border-right: 0;
  border-left: 1px solid var(--line);
}

/* ========================================================= */
/* Viewport                                                    */
/* ========================================================= */

#viewport {
  position: relative;

  min-width: 0;
  min-height: 0;

  overflow: hidden;

  background: #050910;
}

.viewport-tools {
  position: absolute;

  top: 12px;
  left: 12px;

  z-index: 3;

  display: flex;
  gap: 8px;
}

.viewport-tools kbd {
  margin-left: 4px;

  padding: 1px 5px;

  font-size: 11px;

  background: rgba(255, 255, 255, 0.18);

  border-radius: 5px;
}

/* ========================================================= */
/* Aide contextuelle                                           */
/* ========================================================= */

.hint {
  position: absolute;

  left: 12px;
  bottom: 12px;

  z-index: 3;

  padding: 7px 10px;

  color: #c6d2e3;

  background: rgba(0, 0, 0, 0.55);

  border-radius: 8px;
}

/* ========================================================= */
/* Barre d'état                                                */
/* ========================================================= */

.status-bar {
  height: 28px;

  display: flex;
  align-items: center;

  padding: 0 12px;

  background: var(--panel);

  border-top: 1px solid var(--line);

  color: var(--muted);

  font-size: 12px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================================= */
/* Cartes de mode                                              */
/* ========================================================= */

.mode-card {
  display: block;
}

/* ========================================================= */
/* Affichage conditionnel des panneaux                         */
/* ========================================================= */

body[data-work-mode="construction"]
[data-mode-panel]:not([data-mode-panel="construction"]),

body[data-work-mode="selection"]
[data-mode-panel]:not([data-mode-panel="selection"]),

body[data-work-mode="library"]
[data-mode-panel]:not([data-mode-panel="library"]),

body[data-work-mode="generation"]
[data-mode-panel]:not([data-mode-panel="generation"]),

body[data-work-mode="variants"]
[data-mode-panel]:not([data-mode-panel="variants"]),

body[data-work-mode="export"]
[data-mode-panel]:not([data-mode-panel="export"]) {
  display: none;
}

/* ========================================================= */
/* Placeholder génération                                      */
/* ========================================================= */

body[data-work-mode="generation"] .left::after {
  content:
    "Mode Génération : les générateurs existants seront regroupés ici en v0.9.x.";

  display: block;

  margin-top: 12px;
  padding: 12px;

  border: 1px dashed var(--line);
  border-radius: 10px;

  color: var(--muted);
}