#root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-header {
  background: var(--panel-bg);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.app-header h1 {
  margin: 0;
  color: var(--text-color);
}

/* Connection Type Selector */
.connection-type-selector {
  background: var(--panel-bg);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.connection-type-title {
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

.connection-type-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
  max-width: 900px;
}

.connection-type-button {
  aspect-ratio: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  padding: var(--spacing-sm);
}

.connection-type-button:hover {
  border-color: var(--primary-blue);
  background: #f0f8ff;
}

.connection-type-button.active {
  border-color: var(--primary-blue);
  background: #e6f2ff;
  box-shadow: 0 0 0 1px var(--primary-blue);
}

.connection-type-label {
  margin-top: var(--spacing-xs);
  font-size: var(--font-size-md);
  font-weight: 500;
}

/* Main Tabs */
.main-tabs {
  display: flex;
  background: var(--panel-bg);
  border-bottom: 2px solid var(--border-color);
  padding: 0 var(--spacing-md);
  gap: 4px;
}

.main-tab {
  padding: 12px 24px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--font-size-md);
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.main-tab:hover {
  background: var(--bg-color);
  color: var(--text-color);
}

.main-tab.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
  font-weight: 600;
}

.app-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-color);
  padding: var(--spacing-lg);
}

.tab-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: var(--spacing-md);
}

/* Radio button groups */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

/* Steel database button */
.steel-database-btn {
  background-color: var(--success-green);
  color: white;
  border-color: var(--success-green);
  font-size: var(--font-size-sm);
  padding: 4px 12px;
}

.steel-database-btn:hover {
  background-color: #0e6b0e;
}

/* Results and diagrams */
.diagram-container {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.diagram-title {
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--text-color);
}

.diagram-svg-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xl);
}

.diagram-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}

.diagram-view-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
}

/* Load combination section */
.load-combos-section {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.load-combos-title {
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

.design-method-section {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.design-method-title {
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: var(--font-size-lg);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--bg-color);
}

.modal-body {
  padding: var(--spacing-md);
  overflow-y: auto;
  flex: 1;
}

.search-input {
  width: 100%;
  padding: 10px;
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
}

.shapes-table-container {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.shapes-table {
  width: 100%;
  border-collapse: collapse;
}

.shapes-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-color);
  z-index: 1;
}

.shapes-table th {
  text-align: left;
  padding: 10px;
  border-bottom: 2px solid var(--border-dark);
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.shapes-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
}

.shapes-table tbody tr:hover {
  background: var(--bg-color);
}

.select-btn {
  padding: 4px 12px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.select-btn:hover {
  background: #0066b8;
}