/* CSS Variables - Matching Court Bundle Builder */
:root {
    --color-primary-dark: #14532D;
    --color-primary: #1B4D3E;
    --color-primary-light: #40916C;
    --color-accent: #10b981;
    --color-accent-light: #34d399;
    --color-success: #10b981;
    --color-success-light: #34d399;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #f8fafc;
    --color-bg-white: #ffffff;
    --color-border: #e5e7eb;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px 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);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.auth-modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal-content {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    opacity: 0.9;
    font-size: 1rem;
}

#loginRegisterView,
#resetPasswordView {
    padding: 2rem;
}

#loginRegisterView h2,
#resetPasswordView h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.auth-description {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.1);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.disclaimer-box {
    background: #ecfdf5;
    border: 1px solid var(--color-primary-light);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.checkbox-label {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.875rem;
    cursor: pointer;
}

.checkbox-label input {
    margin-top: 0.25rem;
}

.auth-error {
    background: #fef2f2;
    color: var(--color-danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    border: 1px solid #fecaca;
}

.auth-success {
    background: #ecfdf5;
    color: var(--color-success);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    border: 1px solid #a7f3d0;
}

.hidden {
    display: none !important;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-text-light);
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: var(--color-primary-dark);
}

.auth-benefits {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.auth-benefits h3 {
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.auth-benefits ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-benefits li {
    font-size: 0.9rem;
    color: var(--color-text-light);
    padding-left: 1.5rem;
    position: relative;
}

.auth-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

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

.btn-primary:hover {
    background: var(--color-primary-light);
}

.btn-primary:disabled {
    background: var(--color-text-light);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}

.btn-success:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.btn-icon.delete:hover {
    background: #fef2f2;
    color: var(--color-danger);
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

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

.btn-outline:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
}

.btn-outline:disabled {
    border-color: #9ca3af;
    color: #9ca3af;
    cursor: not-allowed;
}

.btn-close {
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.btn-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.logo-link h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 1rem;
    opacity: 0.9;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-initial {
    width: 32px;
    height: 32px;
    background: white;
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.chevron {
    width: 1rem;
    height: 1rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    overflow: hidden;
    z-index: 100;
}

.dropdown-header {
    padding: 1rem;
    background: var(--color-bg);
    font-size: 0.875rem;
    color: var(--color-text-light);
    word-break: break-all;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--color-bg);
}

.dropdown-item svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Cards */
.card {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.25rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.5rem;
}

.section-description {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin-bottom: 0.25rem;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Parties Section */
.parties-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.parties-section h3 {
    font-size: 1.1rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.5rem;
}

.parties-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.parties-header h3 {
    font-size: 1.1rem;
    color: var(--color-primary-dark);
}

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

.party-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.party-group-header h4 {
    font-size: 0.95rem;
    color: var(--color-text);
}

.add-party-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.add-party-btn:hover {
    background: var(--color-primary-light);
}

.party-entry {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.party-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.party-name-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.party-designation-select {
    width: 150px;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.remove-party-btn {
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.remove-party-btn:hover {
    background: #fef2f2;
    color: var(--color-danger);
}

.party-separator {
    text-align: center;
    padding: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 1.1rem;
}

.party-name {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
}

.party-name:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.1);
}

.party-designation {
    width: 160px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
}

.party-designation:focus {
    outline: none;
    border-color: var(--color-primary);
}

.litigation-friend {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    font-style: italic;
    color: var(--color-text-light);
}

.litigation-friend:focus {
    outline: none;
    border-color: var(--color-primary);
    color: var(--color-text);
}

.proceeding-type-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.proceeding-type-row > label {
    font-weight: 600;
    color: var(--color-text);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.radio-label input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--color-primary);
}

.party-entries:empty::after {
    content: "No parties added yet. Click 'Add' to add a party.";
    display: block;
    padding: 1rem;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.85rem;
    font-style: italic;
}

/* Options Row */
.options-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.option-checkbox input {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

/* Table */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

#chronologyTable {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

#chronologyTable th,
#chronologyTable td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

#chronologyTable th {
    background: var(--color-bg);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#chronologyTable tbody tr:hover {
    background: #f8fafc;
}

#chronologyTable tbody tr.dragging {
    opacity: 0.5;
    background: #ecfdf5;
}

.col-drag {
    width: 40px;
}

.col-date {
    width: 160px;
    min-width: 160px;
}

.col-event {
    min-width: 300px;
}

.col-source {
    width: 180px;
}

.col-page {
    width: 100px;
}

.col-actions {
    width: 50px;
}

.drag-handle {
    cursor: grab;
    color: var(--color-text-light);
    padding: 0.5rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle svg {
    width: 1.25rem;
    height: 1.25rem;
}

#chronologyTable input,
#chronologyTable textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    background: transparent;
    transition: all 0.2s;
}

#chronologyTable input:hover,
#chronologyTable textarea:hover {
    border-color: var(--color-border);
    background: var(--color-bg-white);
}

#chronologyTable input:focus,
#chronologyTable textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-bg-white);
    box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.1);
}

#chronologyTable textarea {
    resize: vertical;
    min-height: 60px;
}

#chronologyTable input[type="date"] {
    min-width: 140px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--color-text-light);
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.empty-state.hidden {
    display: none;
}

.table-container.hidden {
    display: none;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.row-actions {
    display: flex;
    gap: 0.25rem;
}

/* Export Section */
.export-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.export-options .form-group {
    min-width: 200px;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.export-buttons .btn {
    flex: 1;
    min-width: 150px;
}

/* Save/Load Section */
.save-section {
    background: var(--color-bg);
    border: 2px dashed var(--color-border);
}

.save-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.save-buttons .btn {
    flex: 1;
    min-width: 150px;
}

/* Help Button */
.btn-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.btn-help:hover {
    background: var(--color-primary);
    background: rgba(27, 77, 62, 0.1);
    color: var(--color-primary);
}

/* Help Modal */
.help-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.help-modal.hidden {
    display: none;
}

.help-modal-content {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.help-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.help-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
}

.help-tab {
    padding: 0.5rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.help-tab:hover {
    background: var(--color-border);
}

.help-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.help-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.help-panel.hidden {
    display: none;
}

.help-panel h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.help-panel h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--color-text);
}

.help-notice {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    text-align: center;
}

.help-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.help-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.help-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.help-list li {
    padding-left: 1.5rem;
    position: relative;
}

.help-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.help-tip {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

/* Options Row */
.options-label {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.9rem;
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.preview-modal.hidden {
    display: none;
}

.preview-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.preview-header h3 {
    font-size: 1.1rem;
    color: var(--color-primary-dark);
}

.preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #f0f0f0;
}

.preview-page {
    background: white;
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    font-family: 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.5;
}

.preview-document {
    background: white;
    padding: 2.5rem;
    max-width: 750px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    font-family: 'Century Gothic', 'Segoe UI', sans-serif;
    font-size: 11pt;
    line-height: 1.5;
}

.preview-case-number {
    text-align: right;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.preview-court {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.preview-matter {
    font-weight: bold;
    margin-bottom: 1rem;
}

.preview-matter-of {
    margin: 1rem 0;
    text-align: left;
}

.preview-matter-of strong {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
}

.preview-parties {
    margin: 1.5rem 0;
}

.preview-between {
    font-weight: bold;
    margin-bottom: 0.75rem;
}

.preview-party {
    text-align: center;
    margin: 0.5rem 0;
    position: relative;
}

.preview-party .party-name {
    display: block;
    font-weight: bold;
    font-size: 11pt;
}

.preview-party .litigation-friend {
    display: block;
    font-size: 10pt;
    font-style: italic;
    margin-top: 0.25rem;
    color: var(--color-text);
}

.preview-party .party-designation {
    position: absolute;
    right: 0;
    top: 0;
    font-weight: bold;
    width: auto;
    border: none;
    padding: 0;
}

.preview-separator {
    text-align: center;
    font-weight: bold;
    margin: 0.75rem 0;
}

.preview-line {
    border-bottom: 1px solid black;
    margin: 1rem 0;
}

.preview-title {
    text-align: center;
    font-size: 14pt;
    font-weight: bold;
    margin: 1rem 0;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 10pt;
}

.preview-table th,
.preview-table td {
    border: 1px solid #ccc;
    padding: 0.5rem;
    text-align: left;
    vertical-align: top;
}

.preview-table th {
    background: #e5e7eb;
    font-weight: bold;
}

.preview-footer-text {
    text-align: right;
    margin-top: 2rem;
    font-size: 10pt;
}

.preview-footer-text p {
    margin: 0.25rem 0;
}

.preview-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

/* Footer */
.app-footer {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    padding: 2rem;
    margin-top: auto;
}

.footer-promo {
    max-width: 1200px;
    margin: 0 auto 1.5rem auto;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    text-align: center;
}

.footer-promo a {
    color: white;
    font-weight: 600;
    text-decoration: underline;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.disclaimer {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.copyright {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
}

.footer-links a:hover {
    text-decoration: underline;
    opacity: 1;
}

.footer-links .divider {
    opacity: 0.5;
}

/* Loading Spinner */
.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .main-content {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-header .btn {
        width: 100%;
    }

    .export-options {
        flex-direction: column;
    }

    .export-options .btn-large {
        width: 100%;
    }

    .party-row {
        flex-direction: column;
    }

    .party-designation-select {
        width: 100%;
    }
}
