/* Layout Styles */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-sm {
  max-width: var(--container-sm);
}

.container-md {
  max-width: var(--container-md);
}

.container-lg {
  max-width: var(--container-lg);
}

.container-2xl {
  max-width: var(--container-2xl);
}

.container-fluid {
  max-width: 100%;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

.grid-cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

.grid-cols-12 {
  grid-template-columns: repeat(12, 1fr);
}

/* Flexbox */
.flex {
  display: flex;
}

.flex-inline {
  display: inline-flex;
}

.flex-row {
  flex-direction: row;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

/* Justify Content */
.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.justify-evenly {
  justify-content: space-evenly;
}

/* Align Items */
.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.items-baseline {
  align-items: baseline;
}

.items-stretch {
  align-items: stretch;
}

/* Align Content */
.content-start {
  align-content: flex-start;
}

.content-center {
  align-content: center;
}

.content-end {
  align-content: flex-end;
}

.content-between {
  align-content: space-between;
}

.content-around {
  align-content: space-around;
}

/* Gap */
.gap-0 {
  gap: 0;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-5 {
  gap: var(--space-5);
}

.gap-6 {
  gap: var(--space-6);
}

.gap-8 {
  gap: var(--space-8);
}

/* Page Layout */
.page-content {
  min-height: calc(100vh - var(--header-height));
  padding: var(--space-8) 0;
}

.page-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  text-align: center;
}

.page-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-8);
}

.content-section {
  margin-bottom: var(--space-12);
}

.content-section h2 {
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.content-section h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

/* App Layout */
.app-body {
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: calc(100vh - var(--header-height));
  background-color: var(--bg-secondary);
}

.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  transition: width var(--transition-base) var(--ease-in-out);
}

.app-sidebar.collapsed {
  width: var(--sidebar-width-collapsed);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-primary);
}

.app-preview {
  width: var(--preview-width);
  background-color: var(--bg-primary);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  transition: width var(--transition-base) var(--ease-in-out);
}

.app-preview.collapsed {
  width: 0;
  border: none;
}

/* Sidebar Layout */
.sidebar-section {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* Main Content Layout */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-secondary);
}

.results-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.results-actions {
  display: flex;
  gap: var(--space-2);
}

.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-primary);
}

.results-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.results-table-wrapper {
  height: 100%;
  overflow: auto;
}

/* Preview Layout */
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-secondary);
}

.preview-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.preview-content {
  flex: 1;
  overflow: auto;
  padding: var(--space-4);
}

.preview-info {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  background-color: var(--bg-secondary);
  font-size: var(--text-sm);
}

.preview-actions {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  background-color: var(--bg-primary);
}

/* Position */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
}

/* Display */
.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.inline {
  display: inline;
}

.hidden {
  display: none;
}

/* Width and Height */
.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.min-w-0 {
  min-width: 0;
}

.min-h-0 {
  min-height: 0;
}

/* Overflow */
.overflow-auto {
  overflow: auto;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-visible {
  overflow: visible;
}

.overflow-scroll {
  overflow: scroll;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-auto {
  overflow-y: auto;
}

/* Z-Index */
.z-0 {
  z-index: var(--z-0);
}

.z-10 {
  z-index: var(--z-10);
}

.z-20 {
  z-index: var(--z-20);
}

.z-30 {
  z-index: var(--z-30);
}

.z-40 {
  z-index: var(--z-40);
}

.z-50 {
  z-index: var(--z-50);
}