/* office-ribbon.css — Microsoft Office-style Ribbon & Inspector layout styling */

.office-workspace-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: var(--o-bg, var(--bg));
  color: var(--o-text, var(--text));
  font-family: Calibri, "Segoe UI", -apple-system, sans-serif;
  position: relative;
}

/* Header & title styling */
.unified-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  height: 48px;
  border-bottom: 1px solid var(--o-line);
}
.header-left-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-btn-back {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--o-text);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-btn-back:hover {
  background: var(--o-soft);
}
.header-brand-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
}
.header-suite-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  opacity: 0.85;
}
.header-middle-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ui-title-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--o-text);
  font-size: 15px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  text-align: center;
  min-width: 260px;
  transition: all 0.15s ease;
}
.ui-title-input:hover {
  background: var(--o-soft);
}
.ui-title-input:focus {
  background: var(--o-surface);
  border-color: var(--workspace-color);
  outline: none;
}
.ui-save-indicator {
  font-size: 12px;
  color: var(--o-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.ui-save-indicator i.spin {
  display: inline-block;
  animation: spin-indicator 1.2s infinite linear;
}
@keyframes spin-indicator {
  100% { transform: rotate(360deg); }
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Ribbon Bar */
.office-ribbon-bar {
  display: flex;
  flex-direction: column;
  background: var(--o-surface);
  border-bottom: 1px solid var(--o-line);
}
.ribbon-tabs {
  display: flex;
  gap: 4px;
  padding: 4px 16px 0;
  border-bottom: 1px solid color-mix(in oklab, var(--o-line) 50%, transparent);
}
.ribbon-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--o-muted);
  font-weight: 500;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ribbon-tab-btn:hover {
  color: var(--o-text);
  background: var(--o-soft);
  border-radius: 4px 4px 0 0;
}
.ribbon-tab-btn.active {
  color: var(--workspace-color);
  font-weight: 600;
  border-bottom-color: var(--workspace-color);
}

.ribbon-active-pane {
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 8px 16px;
  min-height: 92px;
  overflow-x: auto;
  scrollbar-width: thin;
}

/* Ribbon Groups */
.ribbon-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid color-mix(in oklab, var(--o-line) 40%, transparent);
  padding-right: 14px;
  margin-right: 2px;
}
.ribbon-group:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}
.ribbon-group-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--o-muted);
  text-align: center;
  letter-spacing: 0.05em;
  margin-top: 6px;
  user-select: none;
  opacity: 0.8;
}
.ribbon-group-content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

/* Ribbon Controls & Buttons */
.ribbon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--o-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  min-width: 52px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.ribbon-btn:hover {
  background: var(--o-soft);
  border-color: color-mix(in oklab, var(--o-line) 50%, transparent);
}
.ribbon-btn i {
  font-size: 18px;
  margin-bottom: 4px;
}
.ribbon-btn span {
  font-size: 11px;
  white-space: nowrap;
}
.ribbon-btn.primary {
  background: color-mix(in oklab, var(--workspace-color) 12%, transparent);
  color: var(--workspace-color);
  border-color: color-mix(in oklab, var(--workspace-color) 30%, transparent);
}
.ribbon-btn.primary:hover {
  background: color-mix(in oklab, var(--workspace-color) 20%, transparent);
}

.ribbon-tool-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--o-text);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  font-size: 13px;
}
.ribbon-tool-btn:hover {
  background: var(--o-soft);
}
.ribbon-tool-btn.active {
  background: color-mix(in oklab, var(--workspace-color) 16%, transparent);
  color: var(--workspace-color);
  border-color: color-mix(in oklab, var(--workspace-color) 25%, transparent);
}

.ribbon-sep {
  width: 1px;
  background: color-mix(in oklab, var(--o-line) 30%, transparent);
  align-self: stretch;
  margin: 4px 2px;
}

/* Font and Paragraph compound rows */
.font-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.paragraph-col {
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.ribbon-btn-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ribbon-select-wrap {
  display: flex;
  gap: 4px;
}
.ribbon-select {
  background: var(--o-surface);
  color: var(--o-text);
  border: 1px solid var(--o-line);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  cursor: pointer;
  max-width: 120px;
}
.ribbon-select.font-size {
  max-width: 55px;
}
.ribbon-select:focus {
  outline: none;
  border-color: var(--workspace-color);
}

/* Style Galleries */
.styles-gallery {
  display: flex;
  gap: 6px;
  max-width: 320px;
  overflow-x: auto;
}
.style-box {
  border: 1px solid var(--o-line);
  border-top: 3px solid var(--o-muted);
  border-radius: 4px;
  background: var(--o-bg);
  min-width: 72px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.style-box:hover {
  border-color: var(--workspace-color);
  background: var(--o-soft);
}
.style-box.active {
  border-color: var(--workspace-color);
  border-top-color: var(--workspace-color);
  background: color-mix(in oklab, var(--workspace-color) 6%, transparent);
}
.style-preview {
  font-size: 14px;
  line-height: 1;
}
.font-p { font-family: sans-serif; }
.font-h1 { font-weight: 700; font-size: 16px; }
.font-h2 { font-weight: 600; font-size: 14px; }
.font-h3 { font-style: italic; }
.style-name {
  font-size: 9px;
  color: var(--o-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ribbon-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--o-muted);
  cursor: pointer;
  user-select: none;
}
.ribbon-checkbox-label input {
  cursor: pointer;
}

/* Middle workspace division */
.office-workspace-middle-container {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
.office-workspace-main-view {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Side Panels */
.office-side-panel {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--o-line);
}
.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--o-line);
  padding: 6px 12px;
}
.side-panel-tabs {
  display: flex;
  gap: 4px;
}
.side-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--o-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
}
.side-tab-btn.active {
  color: var(--workspace-color);
  border-bottom-color: var(--workspace-color);
}
.side-panel-close-btn {
  background: transparent;
  border: none;
  color: var(--o-muted);
  font-size: 18px;
  cursor: pointer;
}
.side-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.side-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--o-muted);
  margin-bottom: 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--o-line) 50%, transparent);
  padding-bottom: 4px;
}
.side-property-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 0;
}
.side-property-row span {
  color: var(--o-muted);
}
.history-list, .selection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}
.history-item.active {
  border-color: var(--workspace-color);
  background: color-mix(in oklab, var(--workspace-color) 6%, transparent);
}
.history-item-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--o-muted);
  margin-top: 4px;
}
.history-item.active .history-item-marker {
  background: var(--workspace-color);
}
.history-version {
  font-size: 12px;
  font-weight: 600;
}
.history-time {
  font-size: 10px;
  color: var(--o-muted);
}
.selection-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--o-line);
  border-radius: 6px;
  background: var(--o-bg);
  cursor: pointer;
}
.selection-item:hover {
  border-color: var(--workspace-color);
}

/* Status Bar */
.office-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  height: 28px;
  border-top: 1px solid var(--o-line);
}
.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-sep {
  opacity: 0.3;
}
.status-btn {
  background: transparent;
  border: none;
  color: var(--o-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.status-btn:hover {
  color: var(--o-text);
}
.status-zoom-container {
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-zoom-btn {
  background: transparent;
  border: none;
  color: var(--o-muted);
  cursor: pointer;
  font-weight: 600;
}
.status-zoom-btn:hover {
  color: var(--o-text);
}
.status-zoom-slider {
  width: 100px;
  cursor: pointer;
}
.status-zoom-percent {
  font-size: 11px;
  min-width: 32px;
  text-align: right;
}
