/* General Styles */
:root {
  --primary-color: #4f46e5;
  --secondary-color: #2563eb;
  --highlight-color: #ffeb3b;
  --highlight-fade: #fff9c4;
  --text-color: #333;
  --light-gray: #f3f4f6;
  --border-color: #e5e7eb;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f9fafb;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

h1, h2, h3, h4 {
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

/* Form Styles */
.form-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

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

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.checkbox-group {
  margin-top: 0.5rem;
}

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

.checkbox-label input {
  margin-right: 0.5rem;
}

.radio-group {
  margin-top: 0.5rem;
}

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

.radio-label input {
  margin-right: 0.5rem;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

button {
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  transition: all 0.2s;
}

button:hover {
  opacity: 0.9;
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

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

.button-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.button-success {
  background-color: var(--success-color);
  color: white;
}

.button-danger {
  background-color: var(--danger-color);
  color: white;
}

.button-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

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

/* Tab Navigation */
.tab-navigation {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.tab-button {
  padding: 0.75rem 1.25rem;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.875rem;
}

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

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

/* Navigation Buttons */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  gap: 1rem;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.prev-button, .next-button {
  min-width: 120px;
}

/* Preview Panel */
.preview-container {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.form-panel {
  flex: 1;
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.preview-panel {
  flex: 1;
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 2rem;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.preview-content {
  white-space: pre-wrap;
  font-size: 0.875rem;
  line-height: 1.7;
}

.document-preview {
  font-family: 'Times New Roman', Times, serif;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.highlighted-text {
  background-color: var(--highlight-fade);
  display: inline;
  padding: 2px 0;
  animation: highlight 2s;
}

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

/* Analysis Section */
.analysis-container {
  margin-bottom: 20px;
}

.analysis-score {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.score-high {
  background-color: #d1fae5;
  color: #065f46;
}

.score-medium {
  background-color: #fef3c7;
  color: #92400e;
}

.score-low {
  background-color: #fee2e2;
  color: #991b1b;
}

.analysis-issues {
  background-color: #fee2e2;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.analysis-warnings {
  background-color: #fef3c7;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.analysis-strengths {
  background-color: #d1fae5;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.analysis-issues h3, 
.analysis-warnings h3, 
.analysis-strengths h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.analysis-issues ul, 
.analysis-warnings ul, 
.analysis-strengths ul {
  margin: 0;
  padding-left: 20px;
}

/* Helper Classes */
.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .preview-container {
    flex-direction: column;
  }
  
  .form-panel, .preview-panel {
    width: 100%;
  }
  
  .preview-panel {
    position: static;
    max-height: 500px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .tab-button {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
}