/* Reset and 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: #f9fafb;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

h1, h2, h3, h4, h5, h6 {
    color: #1e293b;
    margin-bottom: 0.35rem;
}

h2 {
    font-size: 1rem;
    margin-top: 0.5rem;
}

p {
    margin-bottom: 0.5rem;
}

/* Header Styles */
.header {
    background-color: #ffffff;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.header p {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 0;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-navigation::-webkit-scrollbar {
    display: none;
}

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

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-button:hover:not(.active) {
    color: #1e293b;
    background-color: #f1f5f9;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-grow: 1;
    gap: 0.5rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.form-panel {
    flex: 1;
    padding: 0.35rem;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.preview-panel {
    flex: 1;
    border-left: 1px solid #e2e8f0;
    padding: 1rem;
    background-color: #f8fafc;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.preview-content {
    white-space: pre-wrap;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-y: auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 0.35rem;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #1e293b;
}

.label-description {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    transition: border-color 0.3s ease;
    height: 24px;
}

textarea {
    width: 100%;
    padding: 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    transition: border-color 0.3s ease;
    height: 32px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
}

.radio-group {
    margin-bottom: 0.25rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.radio-option input[type="radio"] {
    width: 1rem;
    height: 1rem;
}

.radio-option label {
    margin-bottom: 0;
    font-weight: normal;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid #e2e8f0;
}

.nav-button {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-button:hover:not(.disabled) {
    background-color: #f1f5f9;
}

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

.prev-button {
    padding-left: 1rem;
}

.next-button {
    padding-right: 1rem;
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.next-button:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* Document Preview */
.document-preview {
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.4;
    color: #000;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 0.65rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    white-space: pre-wrap;
}

.document-preview p {
    margin-bottom: 0.5rem;
}

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

@keyframes highlight {
    0% { background-color: #fef08a; }
    100% { background-color: #fef9c3; }
}

/* Risk Assessment Colors */
.risk-low {
    color: #16a34a;
}

.risk-medium {
    color: #f59e0b;
}

.risk-high {
    color: #dc2626;
}

.assessment-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
}

.assessment-low {
    background-color: #dcfce7;
    border-left: 4px solid #16a34a;
}

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

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

/* Responsive Styles */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .preview-panel {
        border-left: none;
        border-top: 1px solid #e2e8f0;
    }
    
    .form-panel, .preview-panel {
        max-height: none;
    }
    
    .navigation-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-button {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}