/* Token Purchase Agreement Generator Styles */

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #2563eb;
  --secondary-hover: #1d4ed8;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --light-bg: #f9fafb;
  --border-color: #e5e7eb;
  --highlight-color: #fff9c4;
  --highlight-animation: #ffeb3b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  color: var(--text-dark);
  background-color: var(--light-bg);
}

#root {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
}

.generator-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.generator-header {
  padding: 1rem;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
}

.generator-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.generator-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.generator-body {
  display: flex;
  height: 600px; /* Fixed height for both panels */
  max-height: 70vh;
}

.form-panel {
  flex: 1;
  padding: 1rem;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  height: 100%;
}

.preview-panel {
  flex: 1;
  padding: 1rem;
  background-color: var(--light-bg);
  overflow-y: auto;
  height: 100%;
}

.preview-content {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  min-height: 100%;
}

.preview-content h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.document-preview {
  white-space: pre-wrap;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Highlighted text in preview */
.highlighted-text {
  background-color: var(--highlight-color);
  display: inline;
  padding: 2px 0;
  animation: highlight 2s;
}

@keyframes highlight {
  0% { background-color: var(--highlight-animation); }
  100% { background-color: var(--highlight-color); }
}

/* Tab navigation */
.tab-navigation {
  display: flex;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  padding: 0 1rem;
}

.tab-button {
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.875rem;
  position: relative;
}

.tab-button:hover {
  color: var(--primary-color);
}

.tab-button.active {
  color: var(--primary-color);
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
}

/* Form styles */
.form-section {
  margin-bottom: 1.5rem;
}

.form-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--text-dark);
}

.form-group .input-wrapper {
  position: relative;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-dark);
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-control.has-error {
  border-color: var(--danger-color);
}

select.form-control {
  padding-right: 2rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
}

textarea.form-control {
  min-height: 5rem;
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--danger-color);
}

/* Info tooltip */
.info-tooltip {
  display: inline-block;
  position: relative;
  margin-left: 0.25rem;
  color: var(--text-muted);
  cursor: help;
}

.info-tooltip svg {
  width: 1rem;
  height: 1rem;
  vertical-align: middle;
}

.info-tooltip .tooltip-content {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  padding: 0.5rem 0.75rem;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  font-size: 0.75rem;
  color: var(--text-dark);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.info-tooltip .tooltip-content::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid white;
}

.info-tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* Input with icon */
.input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.input-icon.left {
  left: 0.75rem;
}

.input-icon.right {
  right: 0.75rem;
}

.input-with-icon-left {
  padding-left: 2.5rem;
}

.input-with-icon-right {
  padding-right: 2.5rem;
}

/* Checkbox and radio styles */
.checkbox-group, .radio-group {
  margin-bottom: 0.5rem;
}

.checkbox-label, .radio-label {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-dark);
  cursor: pointer;
  padding: 0.375rem 0;
}

.checkbox-input, .radio-input {
  margin-right: 0.5rem;
  width: 1rem;
  height: 1rem;
}

/* Navigation buttons */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background-color: white;
  border-top: 1px solid var(--border-color);
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.nav-button svg {
  width: 1rem;
  height: 1rem;
}

.nav-button:hover {
  background-color: var(--light-bg);
}

.nav-button.prev-button {
  padding-left: 0.75rem;
}

.nav-button.next-button {
  padding-right: 0.75rem;
  color: white;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.nav-button.next-button:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.nav-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Percentage input */
.percentage-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.percentage-input-container input {
  padding-right: 2.5rem;
}

.percentage-sign {
  position: absolute;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Number controls */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.number-controls {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  height: 70%;
}

.number-controls button {
  background: none;
  border: none;
  padding: 0;
  height: 50%;
  width: 1.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.number-controls button:hover {
  color: var(--primary-color);
}

.number-controls button:focus {
  outline: none;
}

/* Preset selector */
.preset-selector {
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.preset-button {
  background-color: var(--light-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-dark);
}

.preset-button:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Warning indicator */
.warning-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
  color: var(--warning-color);
}

.warning-indicator svg {
  width: 1rem;
  height: 1rem;
}

/* Regulatory info box */
.regulatory-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: var(--info-color);
}

.regulatory-info strong {
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

/* Responsive styles */
@media (max-width: 900px) {
  .generator-body {
    flex-direction: column;
  }
  
  .form-panel, .preview-panel {
    flex: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .form-panel {
    order: 1;
  }
  
  .preview-panel {
    order: 2;
  }
}

@media (max-width: 640px) {
  .tab-navigation {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  
  .tab-button {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .navigation-buttons {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .action-buttons {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  
  .prev-button {
    order: 1;
  }
  
  .next-button {
    order: 2;
  }
}