/* =====================================================
   MODERN DESIGN TAB LAYOUT - DEDICATED STYLESHEET
   ===================================================== */

/* Design Cards - Main containers - Ultra Compact */
#design-tab .design-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

#design-tab .design-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Card Headers - Ultra Compact */
#design-tab .design-card-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#design-tab .design-card-icon {
  color: #3b82f6;
  font-size: 14px;
}

#design-tab .design-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

#design-tab .design-card-content {
  padding: 10px 12px;
}

/* Modern Button System */
#design-tab .design-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  justify-content: center;
  min-height: 28px;
  box-sizing: border-box;
}

#design-tab .design-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button Variants */
#design-tab .design-btn-primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}
#design-tab .design-btn-primary:hover:not(:disabled) {
  background: #2563eb;
  border-color: #2563eb;
}

#design-tab .design-btn-secondary {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}
#design-tab .design-btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

#design-tab .design-btn-success {
  background: #10b981;
  border-color: #10b981;
  color: white;
}
#design-tab .design-btn-success:hover:not(:disabled) {
  background: #059669;
  border-color: #059669;
}

#design-tab .design-btn-warning {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
}
#design-tab .design-btn-warning:hover:not(:disabled) {
  background: #d97706;
  border-color: #d97706;
}

/* Drawing Toolbar - Ultra Compact Layout */
#design-tab .drawing-toolbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

#design-tab .tool-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

#design-tab .design-tool {
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  color: #6b7280;
}

#design-tab .design-tool:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
  transform: translateY(-1px);
}

#design-tab .design-tool.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* Enforcing state - when waiting for user to click near main drain */
#design-tab .design-tool.enforcing {
  background: #f59e0b;
  border-color: #f59e0b;
  color: white;
  animation: enforcing-pulse 2s infinite;
}

@keyframes enforcing-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

#design-tab .design-tool-danger {
  color: #dc2626;
}

#design-tab .design-tool-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

#design-tab .design-tool[data-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  /* Note: removing pointer-events: none to allow tooltips */
}

/* Settings Toggle */
#design-tab .tool-settings {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

#design-tab .design-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

#design-tab .design-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#design-tab .toggle-label {
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

/* Profile Controls */
#design-tab .profile-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#design-tab .profile-selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#design-tab .profile-label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}

#design-tab .profile-selector {
  display: flex;
  gap: 8px;
  align-items: center;
}

#design-tab .profile-dropdown {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  color: #374151;
}

#design-tab .profile-action-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 12px;
}

#design-tab .profile-action-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
}

#design-tab .profile-tools {
  display: flex;
  gap: 8px;
}

/* Parameter Sections - Ultra Compact */
#design-tab .param-section {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

#design-tab .param-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

#design-tab .param-section-header {
  margin-bottom: 6px;
}

#design-tab .param-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

#design-tab .param-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

#design-tab .param-input-row:last-child {
  margin-bottom: 0;
}

#design-tab .param-label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

#design-tab .param-input {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}

#design-tab .param-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Depth Constraints */
#design-tab .depth-constraints {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px;
}

#design-tab .depth-input-pair {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  justify-content: center;
}

#design-tab .depth-input-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#design-tab .depth-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  text-align: center;
}

/* Grade Analysis */
#design-tab .grade-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

#design-tab .grade-primary-actions,
#design-tab .grade-secondary-actions {
  display: flex;
  gap: 6px;
}

#design-tab .grade-primary-actions .design-btn {
  flex: 1;
}

#design-tab .grade-secondary-actions .design-btn {
  flex: 1;
}

#design-tab .grade-display {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px;
  min-height: 30px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #374151;
  overflow-y: auto;
  max-height: 80px;
}

#design-tab .grade-display:empty::before {
  content: "Grade analysis results will appear here...";
  color: #9ca3af;
  font-style: italic;
}