/* Document Workspace Design System (Aligned with DBT and GOV.UK Branding) */
:root {
    --bg-main: #f1f5f9; /* Slate 100 */
    --bg-sidebar: #002f6c; /* DBT Navy Blue */
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --border-color: #cbd5e1; /* Slate 300 */
    
    --color-primary: #002554; /* Deep Navy */
    --color-accent: #1d70b8; /* GOV.UK Blue */
    --color-success: #00703c; /* GOV.UK Green */
    --color-warning: #f47738; /* GOV.UK Orange */
    --color-text-main: #1e293b; /* Slate 800 */
    --color-text-muted: #475569; /* Slate 600 */
    --color-tailored: #d97706; /* Amber 600 */
    --bg-tailored: #fef3c7; /* Amber 100 */
    
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --radius-lg: 6px;
    --radius-md: 4px;
    --radius-sm: 2px;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'Lora', Georgia, Cambria, serif;
    --font-header: 'Outfit', sans-serif;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg-main);
    color: var(--color-text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ---------------------------------- */
/* Sidebar Panel (Parameters Form)    */
/* ---------------------------------- */
.sidebar {
    width: 380px;
    min-width: 380px;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 30px;
    z-index: 10;
    box-shadow: 4px 0 20px rgba(0,0,0,0.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 2px solid #ffffff;
    border-radius: var(--radius-sm);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo::after {
    content: 'DBT';
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.brand-text h1 {
    font-family: var(--font-header);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ffffff;
}

.brand-text .subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
}

.generator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for form */
.generator-form::-webkit-scrollbar {
    width: 4px;
}
.generator-form::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    opacity: 0.9;
}

select, textarea {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: #0b0c0c;
    padding: 11px 14px;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-smooth);
}

select:focus, textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(29, 112, 184, 0.25);
}

textarea {
    resize: none;
    height: 90px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.submit-btn {
    background: var(--color-success);
    border: none;
    border-bottom: 3px solid #004d2a;
    color: white;
    padding: 13px 20px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.submit-btn:hover {
    background: #005a30;
    border-bottom: 3px solid #003b20;
}

.submit-btn:active {
    transform: translateY(2px);
    border-bottom: 1px solid #003b20;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.65rem;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 15px;
}

/* ---------------------------------- */
/* Main Viewer Panel                  */
/* ---------------------------------- */
.main-viewer {
    flex-grow: 1;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.view-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.view-state.active {
    opacity: 1;
    pointer-events: auto;
}

/* Empty State */
.empty-state-content {
    text-align: center;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
}

.empty-illustration {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
}

.empty-illustration .orb {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
    top: 10px;
    left: 10px;
    opacity: 0.12;
    filter: blur(8px);
    animation: pulse 4s infinite ease-in-out;
}

.card-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.card {
    position: absolute;
    width: 65px;
    height: 80px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.card-1 { top: 15px; left: 28px; transform: rotate(-8deg); z-index: 3; }
.card-2 { top: 20px; left: 42px; transform: rotate(4deg); z-index: 2; opacity: 0.85; }
.card-3 { top: 22px; left: 14px; transform: rotate(-18deg); z-index: 1; opacity: 0.5; }

.empty-state-content h2 {
    font-family: var(--font-header);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--color-primary);
}

.empty-state-content p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Loading State */
.loader-container {
    text-align: center;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.spinner-ring {
    width: 70px;
    height: 70px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.spinner-core {
    width: 34px;
    height: 34px;
    border: 2px dashed var(--color-primary);
    border-radius: 50%;
    animation: spin-reverse 2s linear infinite;
}

.loader-container h2 {
    font-family: var(--font-header);
    font-size: 1.4rem;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.loader-subtitle {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 30px;
}

.stepper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 320px;
    text-align: left;
}

.step {
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0.25;
    transition: var(--transition-smooth);
}

.step.active { opacity: 1; }
.step.completed { opacity: 0.7; }

.step-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--color-text-muted);
    position: relative;
    transition: var(--transition-smooth);
}

.step.active .step-icon {
    border-color: var(--color-accent);
    background: var(--color-accent);
}

.step.completed .step-icon {
    border-color: var(--color-success);
    background: var(--color-success);
}

.step-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-main);
}

/* ---------------------------------- */
/* Document Workspace State           */
/* ---------------------------------- */
#view-document {
    justify-content: flex-start;
    align-items: stretch;
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 30px;
    height: 70px;
    z-index: 5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.doc-info {
    display: flex;
    flex-direction: column;
}

#doc-title-display {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
}

#doc-meta-display {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.doc-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.doc-utilities {
    display: flex;
    align-items: center;
    gap: 15px;
    border-right: 1px solid #e2e8f0;
    padding-right: 20px;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.zoom-control input[type="range"] {
    width: 90px;
    height: 4px;
    accent-color: var(--color-accent);
    cursor: pointer;
}

#zoom-value {
    min-width: 35px;
    text-align: right;
}

.utility-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--color-text-main);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.utility-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.action-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--color-text-main);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.action-btn.primary-action {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
}

.action-btn.primary-action:hover {
    background: #155a96;
    border-color: #155a96;
}

.doc-layout {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    height: calc(100vh - 70px);
}

/* Document Outline / Table of Contents Sidebar */
.doc-outline-sidebar {
    width: 260px;
    min-width: 260px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.outline-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 0.8px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

#outline-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.outline-item {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text-muted);
    transition: var(--transition-smooth);
    line-height: 1.4;
    border-left: 2px solid transparent;
}

.outline-item:hover {
    background: #f1f5f9;
    color: var(--color-text-main);
}

.outline-item.active {
    background: rgba(29, 112, 184, 0.08);
    color: var(--color-accent);
    font-weight: 600;
    border-left-color: var(--color-accent);
}

/* Scroll Container and Canvas */
.doc-viewer-scroll {
    flex-grow: 1;
    background: #e2e8f0;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.doc-canvas {
    width: 100%;
    max-width: 820px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    transform-origin: top center;
    transition: transform 0.15s ease-out;
}

/* Page/Sheet Styles (Continuous vs. Print) */
.document-sheet {
    background: var(--bg-card);
    transition: var(--transition-smooth);
    box-sizing: border-box;
}

/* Continuous Scroll View Styling */
.doc-canvas:not(.print-mode) {
    background: #ffffff;
    box-shadow: var(--shadow-premium);
    border-radius: var(--radius-lg);
    border: 1px solid #cbd5e1;
    padding: 50px 60px;
}

.doc-canvas:not(.print-mode) .document-sheet {
    border-bottom: 2px dashed #e2e8f0;
    padding-bottom: 40px;
    margin-bottom: 40px;
}

.doc-canvas:not(.print-mode) .document-sheet:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Print Layout View Styling (Simulation of A4 pages) */
.doc-canvas.print-mode .document-sheet {
    width: 8.5in;
    min-height: 11in;
    margin: 0 auto 30px auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.02);
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1.2in 1in 1in 1in;
    position: relative;
    overflow: hidden;
}

/* Cover Page Unique Layout */
.cover-page {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.cover-header-badge {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--color-primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.cover-classification {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-warning);
    letter-spacing: 1.5px;
    text-align: center;
    border-bottom: 1px solid var(--color-warning);
    padding-bottom: 5px;
    margin-bottom: 40px;
    text-transform: uppercase;
}

.cover-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
}

.cover-title {
    font-family: var(--font-serif);
    font-size: 2.3rem;
    color: var(--color-primary);
    line-height: 1.25;
    margin-bottom: 15px;
    font-weight: 700;
}

.cover-subtitle {
    font-size: 1.15rem;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 40px;
}

.cover-meta {
    border-top: 2px solid var(--color-primary);
    padding-top: 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.cover-meta-item strong {
    color: var(--color-text-main);
    display: block;
    margin-bottom: 2px;
}

.cover-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

/* Running Header / Footer for Sheet Pages (Print Mode Only) */
.doc-canvas.print-mode .sheet-header {
    position: absolute;
    top: 25px;
    left: 1in;
    right: 1in;
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-canvas.print-mode .sheet-footer {
    position: absolute;
    bottom: 25px;
    left: 1in;
    right: 1in;
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    border-top: 1px solid #e2e8f0;
    padding-top: 5px;
}

.sheet-header, .sheet-footer {
    display: none; /* Hidden in continuous scroll view */
}

.doc-canvas.print-mode .sheet-header,
.doc-canvas.print-mode .sheet-footer {
    display: flex;
}

/* ---------------------------------- */
/* Document Content Formatting       */
/* ---------------------------------- */
.document-sheet h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: var(--color-primary);
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid #cbd5e1;
    font-weight: 700;
}

.document-sheet h3 {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    color: var(--color-primary);
    margin-top: 22px;
    margin-bottom: 10px;
    font-weight: 600;
}

.document-sheet p {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.65;
    color: #1e293b;
    margin-bottom: 15px;
}

.document-sheet ul {
    margin-left: 24px;
    margin-bottom: 18px;
}

.document-sheet li {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1e293b;
    margin-bottom: 6px;
}

.document-sheet strong {
    color: #000000;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Document Tables */
.document-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.document-table th {
    background: #f1f5f9;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 10px 14px;
}

.document-table td {
    border-bottom: 1px solid #e2e8f0;
    font-family: var(--font-serif);
    color: #334155;
    font-size: 0.85rem;
    padding: 11px 14px;
    line-height: 1.45;
    vertical-align: top;
}

.document-table tr:hover td {
    color: #000000;
    background: #f8fafc;
}

/* Warnings and callouts */
.document-callout {
    background: #f8fafc;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-accent);
    margin-top: 20px;
    margin-bottom: 20px;
}

.document-callout p {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-main);
    line-height: 1.5;
}

.document-callout.warning {
    background: #fff7ed;
    border-left-color: var(--color-warning);
}

.document-callout.warning p {
    color: #9a3412;
}

/* Interactive Checklists */
.checklist-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.checklist-item:hover {
    background: #f1f5f9;
}

.checklist-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-text-muted);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    position: relative;
    margin-top: 2px;
    background: white;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.checklist-item input[type="checkbox"]:checked {
    background: var(--color-success);
    border-color: var(--color-success);
}

.checklist-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checklist-item span {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-text-main);
    transition: var(--transition-smooth);
}

.checklist-item input[type="checkbox"]:checked + span {
    color: var(--color-text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

/* ---------------------------------- */
/* AI Customization Highlight System  */
/* ---------------------------------- */
.ai-customized {
    position: relative;
    background: linear-gradient(to right, rgba(217, 119, 6, 0.04), rgba(217, 119, 6, 0.01));
    border-left: 4px solid var(--color-tailored) !important;
    padding: 14px 18px !important;
    margin: 18px 0;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    box-shadow: inset 1px 0 0 rgba(217, 119, 6, 0.05);
}

.ai-customized::after {
    content: 'AI Customized';
    position: absolute;
    top: -9px;
    right: 15px;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-tailored);
    background: var(--bg-tailored);
    border: 1px solid rgba(217, 119, 6, 0.2);
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

/* ---------------------------------- */
/* Core Animations                    */
/* ---------------------------------- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.35; }
    50% { transform: scale(1.1); opacity: 0.55; }
}

/* Responsive Overrides */
@media (max-width: 1200px) {
    .sidebar {
        width: 320px;
        min-width: 320px;
        padding: 20px;
    }
}

/* Presentation Brand Selector styles */
.ppt-brand-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    margin-right: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-normal);
}

.ppt-brand-selector span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.ppt-brand-selector select {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
    padding: 2px 4px;
}

/* Customization Cards and Interactive Review Flow */
.customization-view-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
}

.customization-instructions-box {
    background: #f0f5fa;
    border-left: 4px solid var(--color-primary);
    border-radius: 4px 8px 8px 4px;
    padding: 18px 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.customization-instructions-box h3 {
    margin: 0 0 8px 0;
    color: var(--color-primary);
    font-size: 1.15rem;
    font-weight: 600;
}

.customization-instructions-box p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-normal);
}

.customization-cards-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.customization-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.customization-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05), 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Card Reviewed State Styling */
.customization-card.reviewed {
    border-color: #10b981;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}

.card-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.customization-card.reviewed .card-header-bar {
    background: #f0fdf4;
    border-bottom-color: #bbf7d0;
}

.card-meta-badges {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ref-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.customization-card.reviewed .ref-badge {
    color: #15803d;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.btn-review-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn-review-toggle:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: #f0f7ff;
}

.customization-card.reviewed .btn-review-toggle {
    color: #ffffff;
    background: #10b981;
    border-color: #10b981;
}

.customization-card.reviewed .btn-review-toggle:hover {
    background: #059669;
    border-color: #059669;
}

.card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    flex-grow: 1;
}

.card-column {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

.original-column {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.original-column label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.paragraph-text-box {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #475569;
    word-break: break-word;
}

/* Keyword Highlights Styling */
.kw-highlight {
    background-color: rgba(254, 240, 138, 0.7);
    color: #1e293b;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    border-bottom: 2px solid #eab308;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.customized-column {
    background: #ffffff;
    height: 100%;
}

.customized-column label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary);
}

.customized-textarea {
    width: 100%;
    flex-grow: 1;
    min-height: 180px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-normal);
    resize: none;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.customized-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 75, 141, 0.15);
}

@media (max-width: 768px) {
    .customization-card {
        grid-template-columns: 1fr;
    }
    .original-column {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}

/* File Upload Drag Area Premium Styling */
.file-upload-drag-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.file-upload-drag-area:hover {
    border-color: var(--color-primary);
    background-color: #f1f5f9;
}

.file-upload-drag-area.dragover {
    border-color: #10b981;
    background-color: #ecfdf5;
}

.file-upload-drag-area.hidden {
    display: none !important;
}

.upload-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    filter: grayscale(1);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.file-upload-drag-area:hover .upload-icon {
    opacity: 1;
    filter: none;
}

.upload-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.file-name-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    box-sizing: border-box;
}

.file-name-badge span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 30px);
}

.remove-file-btn {
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ef4444;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.remove-file-btn:hover {
    transform: scale(1.2);
}

/* AI Explanation Box Premium Styling */
.card-explanation-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    background: #f0f9ff;
    border-left: 3px solid #0284c7;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #0369a1;
}

.explanation-icon {
    font-size: 1rem;
    line-height: 1;
}

.explanation-text {
    font-weight: 500;
}

/* Ins and Del Visual Diff Premium Colors */
.diff-del {
    background-color: #fee2e2;
    color: #b91c1c;
    text-decoration: line-through;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

.diff-ins {
    background-color: #dcfce7;
    color: #15803d;
    text-decoration: none;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* AI Source Box Styling */
.card-source-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-left: 3px solid #64748b;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #475569;
}

.source-icon {
    font-size: 1rem;
    line-height: 1;
}

.source-label {
    font-weight: 700;
    color: #334155;
    margin-right: 4px;
    white-space: nowrap;
}

.source-link-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    word-break: break-all;
}

.source-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.source-link:hover {
    color: #002244;
    text-decoration: underline;
}

.external-source-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ea580c;
    background: #ffedd5;
    border: 1px solid #fed7aa;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

/* Broken Link Banners and Inputs styling */
.broken-link-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ef4444;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.broken-link-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    background: #fff5f5;
    border-left: 3px solid #ef4444;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #991b1b;
}

.link-replace-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.link-replace-input {
    flex-grow: 1;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #334155;
    outline: none;
    transition: border-color 0.2s;
}

.link-replace-input:focus {
    border-color: var(--color-primary);
}

.btn-save-link {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-save-link:hover {
    background: #002244;
}

.btn-save-link.saved {
    background: #10b981;
}

