/* General Styles */
* {
  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.6;
  color: #333;
  background-color: #f8f9fa;
}

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

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 600;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Header */
.app-header {
  padding: 1.5rem;
  background-color: #214291;
  color: white;
  border-bottom: 1px solid #ddd;
}

.app-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.app-header p {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  opacity: 0.9;
}

/* Tabs Navigation */
.tab-navigation {
  display: flex;
  overflow-x: auto;
  background-color: #f1f5f9;
  border-bottom: 1px solid #ddd;
}

.tab-button {
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: #64748b;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-button:hover {
  background-color: #e2e8f0;
  color: #334155;
}

.tab-button.active {
  color: #214291;
  border-bottom-color: #214291;
  background-color: #e2e8f0;
}

/* Main Content Area */
.main-content {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  height: auto;
}

/* Tabs Content */
.tab-content {
  display: flex;
  gap: 1.5rem;
  height: 450px; /* Fixed exact height */
}

@media (max-width: 768px) {
  .tab-content {
    flex-direction: column;
    height: auto;
  }
}

/* Form Panel */
.form-panel {
  width: 50%;
  background-color: #f8fafc;
  border-radius: 6px;
  padding: 1.5rem;
  overflow-y: auto;
  height: 100%;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #334155;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Form Row for Multiple Fields in One Line */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* Preview Panel */
.preview-panel {
  width: 50%;
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow-y: auto;
  position: relative;
  height: 100%;
}

.preview-content {
  padding: 1.5rem;
}

.preview-content h2 {
  margin-bottom: 1rem;
  color: #334155;
  font-size: 1.25rem;
}

.document-preview {
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 100%;
  overflow-y: auto;
}

/* Highlighted Text */
.highlighted-text {
  background-color: #fff9c4;
  display: inline;
  padding: 2px 0;
  animation: highlight 2s;
}

@keyframes highlight {
  0% { background-color: #ffeb3b; }
  100% { background-color: #fff9c4; }
}

/* Navigation Buttons */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background-color: #f1f5f9;
  border-top: 1px solid #e2e8f0;
}

.nav-button {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: white;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #334155;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-button:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

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

.next-button {
  background-color: #214291;
  color: white;
  border: none;
}

.next-button:hover {
  background-color: #1e3a8a;
  color: white;
}

/* Risk Evaluation */
.risk-evaluation {
  margin-top: 1.5rem;
}

.risk-card {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.risk-high {
  background-color: #fee2e2;
  border-left: 4px solid #ef4444;
}

.risk-medium {
  background-color: #fef3c7;
  border-left: 4px solid #f59e0b;
}

.risk-low {
  background-color: #d1fae5;
  border-left: 4px solid #10b981;
}

.risk-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Checkbox & Radio Styles */
.checkbox-group, .radio-group {
  margin-bottom: 1rem;
}

.checkbox-label, .radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

input[type="checkbox"], input[type="radio"] {
  margin: 0;
}