/**
 * Fillr - CSS Styles
 * © 2024 Fillr - www.fillr.net
 * Matching the React/shadcn design system exactly
 */

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

:root {
    /* Colors - HSL format matching React design system */
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;
    
    --highlight: 48 96% 53%;
    --highlight-foreground: 28 73% 26%;
    
    --success: 142 76% 36%;
    
    --radius: 0.5rem;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== HEADER ==================== */
.header {
    border-bottom: 1px solid hsl(var(--border));
    background-color: hsl(var(--card));
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: transparent;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-outline:hover {
    background-color: hsl(var(--accent));
}

.btn-text {
    display: none;
}

@media (min-width: 640px) {
    .btn-text {
        display: inline;
    }
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: transparent;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.2s;
}

.lang-switch:hover {
    background-color: hsl(var(--accent));
}

/* ==================== MAIN CONTENT ==================== */
.main {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

/* ==================== UPLOAD STATE ==================== */
.upload-state {
    max-width: 42rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ==================== CARDS ==================== */
.card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.card-header {
    padding: 1.5rem;
    padding-bottom: 0;
}

.card-header-center {
    text-align: center;
}

.card-header-bordered {
    padding-bottom: 1rem;
    border-bottom: 1px solid hsl(var(--border));
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: hsl(var(--card-foreground));
}

.card-title-sm {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--card-foreground));
}

.card-description {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.card-content {
    padding: 1.5rem;
}

.card-content-scroll {
    max-height: 60vh;
    overflow-y: auto;
}

.card-content-preview {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

/* ==================== INFO ICON ==================== */
.info-icon {
    color: hsl(var(--muted-foreground));
    cursor: help;
    display: inline-flex;
}

/* ==================== UPLOAD AREA ==================== */
.upload-area {
    border: 2px dashed hsl(var(--border));
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.05);
}

.upload-icon-wrapper {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background-color: hsl(var(--muted));
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.upload-area:hover .upload-icon-wrapper,
.upload-area.dragover .upload-icon-wrapper {
    background-color: hsl(var(--primary) / 0.1);
}

.upload-icon {
    width: 2rem;
    height: 2rem;
    color: hsl(var(--muted-foreground));
    transition: color 0.2s;
}

.upload-area:hover .upload-icon,
.upload-area.dragover .upload-icon {
    color: hsl(var(--primary));
}

.upload-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-bottom: 0.25rem;
}

.upload-text {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

#fileInput {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ==================== FORMAT GRID ==================== */
.format-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .format-grid {
        grid-template-columns: 1fr;
    }
}

.format-box {
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
}

.format-box-muted {
    background-color: hsl(var(--muted) / 0.5);
}

.format-box-primary {
    background-color: hsl(var(--primary) / 0.1);
}

.format-code {
    font-size: 1.125rem;
    font-weight: 500;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

.format-description {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.format-description-primary {
    color: hsl(var(--primary));
}

.format-example {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

/* ==================== EDITOR STATE ==================== */
.editor-state {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ==================== FILE INFO BAR ==================== */
.file-info-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    color: hsl(var(--primary));
}

.file-name {
    font-weight: 500;
    color: hsl(var(--foreground));
}

.file-meta {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.file-info-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

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

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== SPLIT VIEW ==================== */
.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .split-view {
        grid-template-columns: 1fr;
    }
}

.card-form,
.card-preview {
    display: flex;
    flex-direction: column;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid transparent;
}

.badge-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-replaced {
    background-color: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    border-color: hsl(var(--primary) / 0.2);
}

.badge-open {
    background-color: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
    border-color: hsl(var(--destructive) / 0.2);
}

.badge-active {
    background-color: hsl(var(--highlight) / 0.3);
    color: hsl(var(--highlight-foreground));
    border-color: hsl(var(--highlight));
    display: none;
}

.badge-active.visible {
    display: inline-flex;
}

/* ==================== TEMPLATE MANAGER ==================== */
.template-manager {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid hsl(var(--border));
}

.btn-template {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background-color: transparent;
    color: hsl(var(--foreground));
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-template:hover {
    background-color: hsl(var(--accent));
    border-color: hsl(var(--primary) / 0.3);
}

.btn-template svg {
    color: hsl(var(--muted-foreground));
}

.template-dropdown {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.template-empty {
    padding: 0.75rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    text-align: center;
}

.template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: background-color 0.2s;
}

.template-item:hover {
    background-color: hsl(var(--accent));
}

.template-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.template-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
}

.template-date {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.template-delete {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    background-color: transparent;
    color: hsl(var(--muted-foreground));
    font-size: 1.125rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.template-delete:hover {
    background-color: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
}

.template-save-dialog {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: hsl(var(--muted) / 0.5);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}

.template-save-dialog .form-input {
    margin-bottom: 0.75rem;
}

.template-save-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-cancel {
    padding: 0.375rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background-color: transparent;
    color: hsl(var(--muted-foreground));
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-cancel:hover {
    background-color: hsl(var(--accent));
}

.btn-confirm {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: var(--radius);
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-confirm:hover {
    opacity: 0.9;
}

/* ==================== FORM FIELDS ==================== */
.form-group {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    flex-shrink: 0;
    width: 120px;
    padding-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    text-align: left;
    word-break: break-word;
}

.input-wrapper {
    flex: 1;
    display: flex;
    gap: 0.5rem;
}

.form-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    background-color: transparent;
    color: hsl(var(--foreground));
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
    color: hsl(var(--muted-foreground));
}

.form-input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.1);
}

.form-input.active {
    border-color: hsl(var(--highlight));
    box-shadow: 0 0 0 2px hsl(var(--highlight) / 0.3);
}

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

/* Responsive: Stack on small screens */
@media (max-width: 640px) {
    .form-group {
        flex-direction: column;
        gap: 0.375rem;
    }
    
    .form-label {
        width: auto;
        padding-top: 0;
    }
}

.btn-save {
    padding: 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background-color: hsl(var(--background));
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    transition: all 0.2s;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-save:hover {
    background-color: hsl(var(--secondary));
    color: hsl(var(--foreground));
}

.btn-save.saved {
    background-color: hsl(var(--success));
    color: white;
    border-color: hsl(var(--success));
}

/* ==================== WORD DOCUMENT PREVIEW ==================== */
.word-document-preview {
    background-color: white;
    border-radius: 0.375rem;
    min-height: 400px;
}

.word-document-content {
    padding: 2rem;
    font-family: 'Calibri', 'Segoe UI', sans-serif;
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
}

/* Headings */
.word-document-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2b579a;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.word-document-content h1:first-child {
    margin-top: 0;
}

.word-document-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2b579a;
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
}

.word-document-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f4e79;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.word-document-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f4e79;
    margin-bottom: 0.5rem;
    margin-top: 0.75rem;
}

/* Paragraphs */
.word-document-content p {
    margin-bottom: 0.75rem;
}

/* Lists */
.word-document-content ul,
.word-document-content ol {
    margin-bottom: 0.75rem;
    padding-left: 2rem;
}

.word-document-content ul {
    list-style-type: disc;
}

.word-document-content ol {
    list-style-type: decimal;
}

.word-document-content li {
    margin-bottom: 0.25rem;
}

/* Tables */
.word-document-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.word-document-content th,
.word-document-content td {
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.word-document-content th {
    background-color: #f3f4f6;
    font-weight: 600;
}

/* Text formatting */
.word-document-content strong,
.word-document-content b {
    font-weight: 700;
}

.word-document-content em,
.word-document-content i {
    font-style: italic;
}

.word-document-content u {
    text-decoration: underline;
}

/* ==================== PLACEHOLDER HIGHLIGHTS ==================== */
.doc-highlight {
    padding: 0.125rem 0.25rem;
    border-radius: 0.1875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.doc-highlight-replaced {
    background-color: hsl(var(--primary) / 0.2);
    color: hsl(var(--primary));
}

.doc-highlight-placeholder {
    background-color: hsl(var(--destructive) / 0.2);
    color: hsl(var(--destructive));
}

.doc-highlight-active {
    background-color: hsl(var(--highlight));
    color: hsl(var(--highlight-foreground));
    box-shadow: 0 0 0 2px hsl(var(--highlight));
}

/* ==================== FOOTER ==================== */
.footer {
    border-top: 1px solid hsl(var(--border));
    background-color: hsl(var(--card));
    margin-top: auto;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

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

.footer-links a {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: hsl(var(--foreground));
}

.footer-copyright {
    text-align: center;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 50;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ==================== CONTENT PAGES ==================== */
.content-page {
    max-width: 42rem;
    margin: 0 auto;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;
}

.page-intro {
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;
    line-height: 1.6;
}

.page-meta {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;
}

/* Accordion for FAQ */
.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.accordion-item {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background-color: hsl(var(--card));
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.accordion-trigger:hover {
    background-color: hsl(var(--accent) / 0.5);
}

.accordion-icon {
    flex-shrink: 0;
    color: hsl(var(--muted-foreground));
    transition: transform 0.2s;
}

.accordion-item.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 0 1.25rem 1rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
}

.accordion-item.open .accordion-content {
    display: block;
}

/* Steps for Instructions */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.step-card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
}

.step-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 9999px;
}

.step-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.25rem;
}

.step-text {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.step-details {
    margin-left: 3.5rem;
    padding-left: 1rem;
    list-style-type: disc;
}

.step-details li {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.tips-section {
    background-color: hsl(var(--muted) / 0.5);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
}

.tips-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;
}

.tips-list {
    padding-left: 1.25rem;
    list-style-type: disc;
}

.tips-list li {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Legal Content (Privacy, Imprint) */
.legal-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.legal-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.75rem;
}

.legal-section p,
.legal-text {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.7;
}

/* Imprint Card */
.imprint-card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.imprint-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 1.5rem;
}

.imprint-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .imprint-grid {
        grid-template-columns: 1fr;
    }
}

.imprint-item h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.375rem;
}

.imprint-item p {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
}

/* Accessibility Cards */
.accessibility-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.accessibility-card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.25rem;
}

.accessibility-card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
}

.accessibility-card p {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
}

/* Licenses */
.licenses-card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
}

.licenses-list {
    display: flex;
    flex-direction: column;
}

.license-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid hsl(var(--border));
    transition: background-color 0.2s;
}

.license-item:last-child {
    border-bottom: none;
}

.license-item:hover {
    background-color: hsl(var(--muted) / 0.5);
}

.license-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.license-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: hsl(var(--foreground));
}

.license-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border-radius: 9999px;
    width: fit-content;
}

.license-description {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.license-link {
    color: hsl(var(--primary));
    transition: color 0.2s;
}

.license-link:hover {
    color: hsl(var(--primary) / 0.8);
}

.thank-you-text {
    text-align: center;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-top: 1.5rem;
}

/* ==================== SAVED DOCUMENTS ==================== */
.saved-documents-card {
    margin-bottom: 1rem;
}

.saved-documents-card .card-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.saved-documents-card .card-title-sm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.saved-documents-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.saved-document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: hsl(var(--muted) / 0.3);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.saved-document-item:hover {
    background-color: hsl(var(--muted));
    border-color: hsl(var(--ring));
}

.saved-document-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.saved-document-name {
    font-weight: 500;
    font-size: 0.9375rem;
    color: hsl(var(--foreground));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-document-meta {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.saved-document-delete {
    padding: 0.375rem;
    border: none;
    background: transparent;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-document-delete:hover {
    background-color: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
}

.no-saved-documents {
    padding: 1.5rem;
    text-align: center;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* Save Document Section in Upload Area */
.save-document-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid hsl(var(--border));
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Save Document Dialog */
.save-document-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.save-document-dialog-content {
    background: hsl(var(--card));
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.save-document-dialog-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.save-document-dialog-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

/* ==================== DATA MANAGEMENT ==================== */
.data-management-card {
    margin-bottom: 1rem;
}

.data-management-card .card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.data-management-card .card-title-sm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-management-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ==================== CONFIRM DIALOG ==================== */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.15s ease-out;
}

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

.confirm-dialog-content {
    background: hsl(var(--card));
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.15s ease-out;
}

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

.confirm-dialog-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: hsl(var(--foreground));
}

.confirm-dialog-message {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.confirm-dialog-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    transition: opacity 0.2s;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
    display: none !important;
}

/* ==================== ENTRANCE ANIMATIONS ==================== */
@keyframes fade-in {
    0% { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes card-rise {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes dot-glow {
    0%, 100% { box-shadow: 0 0 4px 1px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 12px 4px rgba(245, 158, 11, 0.6); }
}

.animate-fade-in {
    animation: fade-in 0.8s ease-out forwards;
}

.animate-card-rise {
    opacity: 0;
    animation: card-rise 0.9s ease-out forwards;
}

.animate-card-rise-delay-1 {
    animation-delay: 0.4s;
}

.animate-card-rise-delay-2 {
    animation-delay: 0.6s;
}

.logo-icon {
    position: relative;
    overflow: hidden;
}

.logo-dot {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fcd34d, #ea580c);
    animation: dot-glow 2.5s ease-in-out infinite;
}

/* ===== Dezenter Text-Werbelink ===== */
.ad-text-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: hsl(var(--muted) / 0.5);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.ad-text-label {
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
}

.ad-text-anchor {
    color: hsl(var(--primary));
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ad-text-anchor:hover {
    color: hsl(var(--highlight));
    text-decoration: underline;
}

.ad-text-anchor:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
    border-radius: 2px;
}

@media (max-width: 640px) {
    .ad-text-link {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
}
