/* ==========================================
   Preview Slide-out Panel
   ========================================== */

.preview-panel {
  position: fixed;
  top: 60px;
  bottom: 0;
  right: 0;
  width: 780px;
  background-color: #ffffff;
  border-left: 1px solid #e5e5e7;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-panel.open {
  transform: translateX(0);
}

body.dark-mode .preview-panel {
  background-color: #1e1e1e;
  border-left-color: #333;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.45);
}

.preview-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e5e7;
  flex-shrink: 0;
}

body.dark-mode .preview-panel-header {
  border-bottom-color: #333;
}

.preview-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1d1d1f;
}

body.dark-mode .preview-panel-title {
  color: #e5e5e7;
}

.preview-panel-subtitle {
  flex-shrink: 0;
  padding: 0.5rem 1.5rem;
  font-size: 0.8125rem;
  color: #6e6e73;
  background-color: #fafafa;
  border-bottom: 1px solid #e5e5e7;
  margin: 0;
}

body.dark-mode .preview-panel-subtitle {
  color: #999;
  background-color: #252525;
  border-bottom-color: #333;
}

.preview-close-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #e5e5e7;
  border-radius: 6px;
  cursor: pointer;
  color: #6e6e73;
  font-size: 0.75rem;
  line-height: 1;
  transition: background-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.preview-close-btn:hover {
  background-color: #f0f0f2;
  color: #1d1d1f;
}

body.dark-mode .preview-close-btn {
  border-color: #444;
  color: #999;
}

body.dark-mode .preview-close-btn:hover {
  background-color: #333;
  color: #e5e5e7;
}

.preview-content {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.preview-content > .mock-site {
  flex: 1 0 auto;
}

/* Toggle Tab */
.preview-toggle-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1099;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 0.4rem;
  background-color: #406ba0;
  border: 1px solid #e5e5e7;
  border-right: none;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  color: #e5e5e7;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.15s,
              color 0.15s;
}

.preview-toggle-tab:hover {
  background-color: #f0f0f2;
  color: #e5e5e7;
}

body.dark-mode .preview-toggle-tab {
  background-color: #396191;
  border-color: #444;
  color: #efeff1;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .preview-toggle-tab:hover {
  background-color: #406ba0;
  color: #e5e5e7;
}

.preview-toggle-tab.panel-open {
  right: 780px;
}

.preview-tab-chevron {
  font-size: 1.125rem;
  line-height: 1;
  display: block;
}

.preview-tab-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  display: block;
}

.preview-toggle-tab.hidden {
  display: none;
}

/* ==========================================
   Mock Website Preview
   ========================================== */

.mock-site {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e5e7;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.mock-navbar {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 36px;
  gap: 8px;
}

.mock-navbar-brand {
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.mock-brand-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.mock-navbar-links {
  display: flex;
  gap: 12px;
  flex: 1;
  padding: 0 8px;
}

.mock-navbar-links span {
  font-size: 9px;
  font-weight: 500;
  display: inline-block;
}

.mock-navbar-cta {
  font-size: 9px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 4px;
  flex-shrink: 0;
}

.mock-layout {
  display: flex;
  flex: 1;
}

.mock-sidebar {
  width: 82px;
  flex-shrink: 0;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.mock-sidebar-logo {
  padding: 5px 8px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.mock-sidebar-item {
  padding: 6px 8px;
  font-size: 9px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: default;
  line-height: 1;
}

.mock-sidebar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.mock-main {
  flex: 1;
  padding: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mock-stats {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mock-stat-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 5px;
  padding: 7px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mock-stat-label {
  font-size: 8px;
  font-weight: 500;
  margin-bottom: 4px;
  opacity: 0.7;
}

.mock-stat-value {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.mock-section-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  flex-shrink: 0;
}

.mock-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.mock-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  padding: 6px 8px 6px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mock-list-title {
  font-size: 9px;
  font-weight: 500;
}

.mock-list-badge {
  font-size: 7px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mock-buttons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mock-btn {
  font-size: 9px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: default;
  line-height: 1;
}

.mock-btn-outline {
  background: transparent !important;
}

/* Role legend below the mock site */
.preview-role-legend {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.875rem;
}

.preview-role-legend-title {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6e6e73;
  margin-bottom: 0.125rem;
}

body.dark-mode .preview-role-legend-title {
  color: #999;
}

.preview-role-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: #6e6e73;
}

body.dark-mode .preview-role-badge {
  color: #999;
}

.preview-role-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

body.dark-mode .preview-role-dot {
  border-color: rgba(255, 255, 255, 0.15);
}

@media (max-width: 600px) {
  .preview-panel {
    width: 100vw;
  }

  .preview-toggle-tab.panel-open {
    right: 100vw;
  }
}
