/* ==========================================================================
   WebPView layout
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  height: 100vh;
  min-width: 600px;
  min-height: 460px;
  padding: 10px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--header-height);
  padding: 7px 10px 7px 8px;
  background:
    linear-gradient(105deg, rgba(55, 32, 20, 0.80), rgba(25, 15, 10, 0.94)),
    radial-gradient(circle at 82% 8%, rgba(219, 145, 71, 0.10), transparent 35%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 205, 0.04),
    0 14px 34px rgba(0, 0, 0, 0.22);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.app-mark {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.38),
    0 0 12px rgba(222, 150, 77, 0.10);
}

.brand-content {
  min-width: 0;
}

.brand-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.product-name {
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-separator {
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
}

.creative-gen-logo {
  width: auto;
  height: 36px;
  max-width: 120px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(223, 146, 70, 0.08));
}

.version-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.workspace-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(32, 20, 13, 0.95), rgba(18, 11, 7, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(211, 137, 68, 0.08), transparent 44%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 211, 0.035),
    0 18px 52px rgba(0, 0, 0, 0.28);
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 6px 12px;
  background: rgba(52, 31, 19, 0.42);
  border-bottom: 1px solid rgba(229, 168, 99, 0.15);
}

.folder-status {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.folder-status span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--bronze);
  border: 1px solid var(--sand);
  border-radius: 50%;
  box-shadow: 0 0 9px var(--glow);
}

.viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 84% 100%, rgba(186, 105, 46, 0.16), transparent 42%),
    radial-gradient(ellipse at 18% 100%, rgba(113, 61, 31, 0.22), transparent 46%),
    linear-gradient(145deg, #100906, #1b100a 58%, #130b07);
}

.viewer-stage::before,
.viewer-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.viewer-stage::before {
  inset: auto -8% -10% -8%;
  height: 34%;
  opacity: 0.50;
  background:
    radial-gradient(ellipse at 18% 100%, rgba(137, 71, 32, 0.42), transparent 55%),
    radial-gradient(ellipse at 52% 100%, rgba(185, 104, 45, 0.29), transparent 50%),
    radial-gradient(ellipse at 84% 100%, rgba(104, 53, 26, 0.42), transparent 52%);
  filter: blur(4px);
}

.viewer-stage::after {
  inset: 0;
  opacity: 0.20;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 26px 26px;
}

.image-plane {
  position: relative;
  display: block;
  overflow: visible;
  background: #080503;
  border: 1px solid rgba(242, 193, 129, 0.32);
  border-radius: 5px;
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.48),
    0 0 28px rgba(217, 143, 70, 0.08);
  transition:
    width var(--transition-normal),
    height var(--transition-normal),
    opacity var(--transition-fast);
}

.base-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  pointer-events: none;
}

.image-information {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 40px;
  padding: 7px 13px;
  background: rgba(42, 25, 16, 0.72);
  border-top: 1px solid rgba(229, 168, 99, 0.14);
  border-bottom: 1px solid rgba(229, 168, 99, 0.14);
}

.file-information {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 8px;
}

.meta-label {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.file-information strong {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.image-metrics {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.meta-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.navigation-bar {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 12px;
  background: rgba(29, 17, 11, 0.94);
}

.navigation-bar > :last-child {
  justify-self: end;
}

.navigation-hint {
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 760px) {
  .app-header {
    gap: 10px;
  }

  .creative-gen-logo {
    max-width: 92px;
    height: 31px;
  }

  .version-line span:first-child,
  .version-line span:nth-child(2),
  .toolbar .tool-button span {
    display: none;
  }

  .tool-button {
    width: 40px;
    padding-inline: 5px !important;
  }

  .navigation-hint {
    display: none;
  }

  .navigation-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-height: 540px) {
  .app-shell {
    gap: 7px;
    padding: 7px;
  }

  .app-header {
    min-height: 58px;
  }

  .app-mark {
    width: 42px;
    height: 42px;
  }

  .product-name {
    font-size: 18px;
  }

  .workspace-header {
    min-height: 36px;
  }

  .navigation-bar {
    min-height: 46px;
    padding-block: 5px;
  }
}
