/* APP SHELL */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
#content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* HEADER */
#header {
  height: var(--header-h);
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}
.header-logo {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--app-accent), var(--app-accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.header-sep {
  width: 1px;
  height: 24px;
  background: var(--app-border);
  flex-shrink: 0;
}
.header-spacer {
  flex: 1;
}
.project-name-display {
  font-size: 13px;
  color: var(--app-text-2);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* MODE TABS */
.mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--app-bg);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--app-border);
}
.mode-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--app-text-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--ease);
  white-space: nowrap;
}
.mode-tab:hover {
  color: var(--app-text);
  background: var(--app-surface-3);
}
.mode-tab.active {
  background: var(--app-accent);
  color: #fff;
}

/* EDIT MODE */
#mode-edit {
  display: flex;
  height: 100%;
}

#edit-sidebar {
  width: var(--sidebar-w);
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
}
.sidebar-section {
  padding: 16px;
  border-bottom: 1px solid var(--app-border);
}
.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--app-text-3);
  margin-bottom: 12px;
}

/* FORM FIELDS */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field-group:last-child {
  margin-bottom: 0;
}
.field-label {
  font-size: 12px;
  color: var(--app-text-2);
  font-weight: 500;
}
.field-input {
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 100%;
  transition: var(--ease);
  font-family: var(--font);
}
.field-input:focus {
  outline: none;
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}
textarea.field-input {
  resize: vertical;
  min-height: 60px;
}
.select-input {
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  width: 100%;
  cursor: pointer;
  transition: var(--ease);
}
.select-input:focus {
  outline: none;
  border-color: var(--app-accent);
}
.range-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-input {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--app-border);
  border-radius: 2px;
  outline: none;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--app-accent);
  cursor: pointer;
}
.range-val {
  font-size: 12px;
  color: var(--app-text-2);
  font-family: monospace;
  min-width: 36px;
  text-align: right;
}

/* MODULE LIST */
.module-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.module-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--ease);
  border: 1px solid transparent;
}
.module-item:hover {
  background: var(--app-surface-2);
}
.module-item.active {
  background: var(--app-surface-3);
  border-color: var(--app-border);
}
.module-toggle {
  width: 32px;
  height: 18px;
  background: var(--app-border);
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  transition: var(--ease);
  flex-shrink: 0;
}
.module-toggle::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: var(--ease);
}
.module-toggle.on {
  background: var(--app-accent);
}
.module-toggle.on::after {
  left: 17px;
}
.module-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--app-text-3);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.module-label {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}

/* EDIT PANEL */
#edit-panel {
  border-top: 1px solid var(--app-border);
  max-height: 45vh;
  overflow-y: auto;
}
.edit-panel-header {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--app-text-3);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  z-index: 1;
}
.edit-panel-content {
  padding: 16px;
}

/* PREVIEW */
#edit-preview {
  flex: 1;
  background: var(--app-bg);
  overflow-y: auto;
  position: relative;
}
.preview-inner {
  padding: 32px;
  max-width: 900px;
  margin: 0 auto;
}

/* PRESENT MODE */
#mode-present {
  display: flex;
  height: 100%;
}
#present-nav {
  width: 220px;
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  flex-shrink: 0;
  overflow-y: auto;
  padding: 16px 0;
}
.nav-title {
  padding: 0 16px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--app-text-3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: var(--ease);
  color: var(--app-text-2);
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: var(--app-surface-2);
  color: var(--app-text);
}
.nav-item.active {
  color: var(--app-accent);
  border-left-color: var(--app-accent);
  background: rgba(108, 99, 255, 0.08);
}
.nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--app-text-3);
  width: 22px;
}
.nav-actions {
  margin-top: 16px;
  padding: 16px;
  border-top: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--app-border);
  background: var(--app-surface-2);
  color: var(--app-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--ease);
  width: 100%;
  justify-content: center;
  font-family: var(--font);
}
.btn-action:hover {
  border-color: var(--app-accent);
  color: var(--app-accent);
}
.btn-action.primary {
  background: var(--app-accent);
  border-color: var(--app-accent);
  color: #fff;
}
.btn-action.primary:hover {
  background: #5a52e0;
}
#present-content {
  flex: 1;
  overflow-y: auto;
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px;
  color: var(--app-text-3);
  font-size: 13px;
  text-align: center;
}
.empty-state-icon {
  font-size: 32px;
}
