/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1e40af;
    --primary-blue-dark: #1e3a8a;
    --primary-blue-light: #3b82f6;
    --secondary-blue: #dbeafe;
    --accent-blue: #60a5fa;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --success: #10b981;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 50%, #bfdbfe 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    background: var(--white);
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid var(--primary-blue);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
}

.language-toggle {
    display: flex;
    gap: 10px;
    background: var(--bg-light);
    padding: 5px;
    border-radius: 8px;
}

.lang-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.lang-btn:hover:not(.active) {
    background: var(--secondary-blue);
    color: var(--primary-blue);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-section,
.preview-section {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

/* Form Styles */
.form-group {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--secondary-blue);
}

.section-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-field input[type="text"],
.form-field input[type="date"],
.form-field select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-field input[type="text"]:focus,
.form-field input[type="date"]:focus,
.form-field input[type="password"]:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-field input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    font-family: monospace;
}

.form-help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.form-field input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-field input[type="file"]:hover {
    border-color: var(--primary-blue);
    background: var(--secondary-blue);
}

.logo-preview {
    margin-top: 15px;
    max-width: 200px;
    max-height: 200px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    display: none;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Report Sections */
.report-section-wrapper {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ai-enhance-btn {
    padding: 8px 16px;
    background: var(--accent-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ai-enhance-btn:hover {
    background: var(--primary-blue-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ai-enhance-btn:active {
    transform: translateY(0);
}

/* Rich Text Editor */
.rich-text-editor {
    min-height: 200px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.rich-text-editor .ql-container {
    min-height: 200px;
    font-size: 1rem;
}

.rich-text-editor .ql-editor {
    min-height: 200px;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

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

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--text-light);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--text-dark);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Preview Section */
.preview-content {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    min-height: 400px;
    max-height: 800px;
    overflow-y: auto;
}

.preview-placeholder {
    text-align: center;
    color: var(--text-light);
    padding: 100px 20px;
    font-style: italic;
}

.preview-content h3 {
    color: var(--primary-blue);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.preview-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.preview-content .preview-header {
    text-align: center;
    border-bottom: 3px solid var(--primary-blue);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.preview-content .preview-header h2 {
    color: var(--primary-blue);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.preview-content .preview-logo {
    max-width: 150px;
    margin: 0 auto 20px;
}

.preview-content .preview-logo img {
    max-width: 100%;
    height: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .title {
        font-size: 1.8rem;
    }

    .form-section,
    .preview-section {
        padding: 25px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ai-enhance-btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Loading and Status Messages */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--secondary-blue);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.success-message {
    background: var(--success);
    color: var(--white);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

.error-message {
    background: var(--error);
    color: var(--white);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

