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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 24px;
}

.header p {
    color: #6c757d;
    font-size: 14px;
}

.main-content {
    display: flex;
    gap: 20px;
    flex: 1;
    height: calc(100vh - 200px);
}
.form-panel, .preview-panel {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    overflow-x: auto;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: white;
}

/* Form Content */
.form-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group.small {
    flex: 0 0 120px;
}

.form-group.medium {
    flex: 0 0 200px;
}

/* Checkboxes and Radio buttons */
.checkbox-group, .radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input, .radio-item input {
    width: auto;
    margin: 0;
}
/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1px solid #ced4da;
    background: white;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

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

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

.nav-button.primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.nav-button.primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.nav-button.success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.nav-button.success:hover {
    background: #1e7e34;
    border-color: #1e7e34;
}
.nav-button.info {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.nav-button.info:hover {
    background: #117a8b;
    border-color: #117a8b;
}

/* Preview Panel */
.preview-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    background: white;
}

.preview-content h2 {
    color: #2c3e50;
    margin-bottom: 16px;
    font-size: 18px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.document-preview {
    font-family: 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.8;
    color: #000;
    white-space: pre-line;
    background: #fafafa;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    min-height: 400px;
}

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

@keyframes highlight {
    0% { background-color: #ffeb3b; }
    100% { background-color: #fff9c4; }
}
/* Chatbox */
.chatbox {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chatbox-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,123,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
}

.chatbox-toggle:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.chatbox-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    height: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
    transition: all 0.3s;
}

.chatbox-window.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chatbox-header {
    background: #007bff;
    color: white;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 14px;
}
.chatbox-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.message.assistant {
    background: #f1f3f5;
    color: #333;
    align-self: flex-start;
}

.message.user {
    background: #007bff;
    color: white;
    align-self: flex-end;
}

.chatbox-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
}

.chatbox-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.chatbox-input button {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbox-input button:hover:not(:disabled) {
    background: #0056b3;
}

.chatbox-input button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.chatbox-input input:disabled {
    background: #f8f9fa;
    color: #6c757d;
}
/* Notice Type Selection */
.notice-type-selection {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.notice-type-card {
    flex: 1;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.notice-type-card:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.notice-type-card.selected {
    border-color: #007bff;
    background: #e7f1ff;
}

.notice-type-card h3 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 16px;
}

.notice-type-card p {
    color: #6c757d;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .form-panel, .preview-panel {
        height: 50vh;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group.small,
    .form-group.medium {
        flex: 1;
    }
    
    .chatbox-window {
        width: 280px;
        height: 350px;
    }
}
/* Loading and disabled states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}