/* PrintPlay Studio — Layout: Shell Grid, Header, Sidebar, Workspace, Right Panel */

/* ════════════════════════════════════
   APP SHELL
   Header + Sidebar + (content) + Preview
   ════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-w);
  height: 100vh;
  overflow: hidden;
}

.app-shell:has(.right-panel.hidden) {
  grid-template-columns: var(--sidebar-w) 1fr 0px;
}

/* ── Header ── */
.app-header {
  grid-column: 1/-1;
  grid-row: 1;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: .75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 100;
}

.hd-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0
}

.hd-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0
}

.proj-input {
  border: none;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  padding: .25rem .45rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition: all .15s;
  max-width: 200px
}

.proj-input:hover {
  border-color: var(--border);
  background: var(--surface2)
}

.proj-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface)
}

.comp-tabs {
  display: flex;
  align-items: center;
  gap: .2rem;
  background: var(--surface2);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border)
}

.comp-tab {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .7rem;
  border-radius: 7px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: .73rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all .15s;
  white-space: nowrap
}

.comp-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .6)
}

.comp-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm)
}

.tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-med);
  flex-shrink: 0;
  transition: background .15s
}

.comp-tab.active .tab-dot {
  background: var(--accent)
}

.hd-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  flex-shrink: 0
}

/* ════════════════════════════════════
   LEFT SIDEBAR — mode switcher
   Data | Design | Assets | --- | Rules | Settings
   ════════════════════════════════════ */
.mode-sidebar {
  grid-column: 1;
  grid-row: 2;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .5rem 0;
  gap: .15rem;
  z-index: 10;
}

.mode-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  color: var(--text-light);
  transition: all .18s;
  position: relative;
}

.mode-btn:hover {
  background: var(--surface2);
  color: var(--text-muted)
}

.mode-btn.active {
  background: var(--accent-bg2);
  color: var(--accent)
}

.mode-btn-icon {
  font-size: 1.15rem;
  line-height: 1
}

.mode-btn-label {
  font-size: .55rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  line-height: 1
}

.mode-spacer {
  flex: 1
}

.mode-divider {
  width: 32px;
  height: 1px;
  background: var(--border);
  margin: .3rem 0
}

/* ════════════════════════════════════
   CENTRE WORKSPACE
   Switches content based on active mode
   ════════════════════════════════════ */
.workspace {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* Workspace topbar — always visible */
.ws-topbar {
  display: flex;
  align-items: center;
  padding: .55rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 1rem;
}

.ws-title {
  font-size: .78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px
}

.ws-meta {
  font-size: .72rem;
  color: var(--text-light);
  margin-left: .5rem
}

/* Mode panels — full height */
.ws-panel {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-height: 0
}

.ws-panel.active {
  display: flex
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.ws-panel.active {
  animation: fadeIn .15s ease
}

.hidden {
  display: none !important;
}