:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Global site header - consistent across all pages */
.site-header-wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

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

.site-header .logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
}

.site-header .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.site-header .logo-text {
    font-weight: 700;
    font-size: 1.1rem;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-header nav > span {
    margin: 0 0.5rem;
    flex-shrink: 0;
}

.site-header nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.site-header nav a:hover,
.site-header nav a.active,
.dropbtn:hover,
.dropbtn.active {
    color: var(--primary);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: transparent;
    color: var(--text-light);
    padding: 0;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--surface);
    min-width: 160px;
    box-shadow: var(--shadow);
    border-radius: 8px;
    border: 1px solid var(--border);
    z-index: 1000;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0;
}

.dropdown-content a {
    color: var(--text);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background-color: var(--bg);
    color: var(--primary);
}

.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
    display: block;
}

/* Mobile-friendly dropdown */
@media (max-width: 768px) {
    .dropdown-content {
        left: 0;
        transform: none;
        min-width: 200px;
    }
}

/* Bootstrap dropdown styling override */
.dropdown-menu {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text);
}

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

.dropdown-toggle::after {
    margin-left: 0.5rem;
}

/* Site Navigation (for pages with container layout) */
.site-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.site-nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--primary);
}

/* Global container for all pages - matches header/footer width */
.app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

/* Full-width container for pages like RAG chat */
.app-container.full-width {
    max-width: 100%;
    padding: 0 2rem;
}

/* Responsive padding for mobile */
@media (max-width: 768px) {

    .site-header-wrapper,
    .app-container {
        padding: 0 1rem;
    }

    .app-container.full-width {
        padding: 0 1rem;
    }

    .site-header nav {
        gap: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .app-container.full-width {
        padding: 0 0.5rem;
    }
}

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

/* Accessibility Improvements */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    letter-spacing: -0.025em;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.logo .icon {
    font-size: 1.5rem;
    color: var(--primary);
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover,
nav a.active {
    color: var(--primary);
}

/* Main Content */
.main-content {
    max-width: 100%;
    margin: 0 auto;
}

.main-content.wide {
    max-width: 1000px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeIn 0.5s ease;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.badge {
    display: inline-block;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cta-button.secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}

.cta-button.secondary:hover {
    background: var(--bg);
}

.cta-button.large {
    width: auto;
    padding: 1rem 3rem;
    font-size: 1.125rem;
}

/* Use Case Rows */
.use-case-row {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-bottom: 6rem;
}

.use-case-row.reverse {
    flex-direction: row-reverse;
}

.use-case-text {
    flex: 1;
}

.use-case-text h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.use-case-text p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.use-case-visual {
    flex: 1;
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Diagrams & Animations */
.diagram-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node {
    background: white;
    border: 2px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

/* RAG Diagram */
.rag-diagram {
    flex-direction: column;
    gap: 2rem;
}

.doc-node {
    position: absolute;
    left: 10%;
    animation: moveRight 3s infinite linear;
    opacity: 0;
}

.doc-node.delay-1 {
    animation-delay: 1s;
}

.doc-node.delay-2 {
    animation-delay: 2s;
}

.engine-node {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
}

.md-node {
    position: absolute;
    right: 10%;
    animation: appearRight 3s infinite steps(1);
    opacity: 0;
}

@keyframes moveRight {
    0% {
        left: 10%;
        opacity: 1;
        transform: scale(1);
    }

    40% {
        left: 45%;
        opacity: 1;
        transform: scale(0.5);
    }

    45% {
        left: 50%;
        opacity: 0;
    }

    100% {
        left: 50%;
        opacity: 0;
    }
}

@keyframes appearRight {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    60% {
        transform: scale(1);
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Migration Diagram */
.migration-diagram {
    justify-content: space-between;
    padding: 0 2rem;
}

.cabinet,
.cloud {
    font-size: 3rem;
    z-index: 2;
}

.files-stream {
    position: absolute;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-icon {
    font-size: 1.5rem;
    animation: flyOver 2s infinite linear;
    opacity: 0;
}

.file-icon:nth-child(2) {
    animation-delay: 0.6s;
}

.file-icon:nth-child(3) {
    animation-delay: 1.2s;
}

@keyframes flyOver {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateX(200px) translateY(-20px) rotate(360deg);
        opacity: 0;
    }
}

/* Compliance Diagram */
.compliance-diagram {
    flex-direction: column;
}

.scan-line {
    position: absolute;
    width: 120%;
    height: 2px;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    top: 0;
    animation: scan 2s infinite ease-in-out;
}

.status-badge {
    margin-top: 2rem;
    font-weight: bold;
    opacity: 0;
    animation: flashStatus 4s infinite;
}

.status-badge.invalid {
    animation-delay: 2s;
    color: var(--error);
    display: none;
    /* Simple toggle for demo */
}

@keyframes scan {
    0% {
        top: 0;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

@keyframes flashStatus {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    60% {
        transform: scale(1);
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* CTA Section */
.cta-section {
    text-align: center;
    margin-top: 4rem;
    padding: 4rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.cta-section h2 {
    margin-bottom: 2rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s;
}

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

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Card */
.upload-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.upload-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
    transform: scale(1.01);
}

.drop-zone.drag-over {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.icon-container {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.file-info {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.supported-formats {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Form Elements */
.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Options */
.options {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

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

/* Buttons */
.cta-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.cta-button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.cta-button:active:not(:disabled) {
    transform: translateY(0);
}

.cta-button:hover:not(:disabled) {
    background: var(--primary-dark);
}

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

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

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

.remove-file {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-light);
    cursor: pointer;
}

/* Status Message */
.status-message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
}

.status-message.success {
    background: #dcfce7;
    color: #166534;
}

.status-message.error {
    background: #fee2e2;
    color: #991b1b;
}

.status-message.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.status-message.info {
    background: #dbeafe;
    color: #1e40af;
}

.status-message.hidden {
    display: none;
}

/* ========================================
   RESULT SECTION & NEW FEATURES
   ======================================== */

/* Result Section */
.result-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.result-section.hidden {
    display: none;
}

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

.result-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success);
}

.close-result {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.close-result:hover {
    color: var(--text);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
}

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

.action-btn.primary:hover {
    background: var(--primary-dark);
}

.action-btn.highlight {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: var(--primary);
    color: var(--primary);
}

.action-btn.highlight:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.action-btn svg {
    flex-shrink: 0;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    background: var(--bg);
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.view-btn.active {
    background: white;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Content Display */
.content-display {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.content-view {
    padding: 1rem;
    background: #fafafa;
}

.content-view.hidden {
    display: none;
}

.content-view pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text);
}

/* Rendered Markdown */
.rendered-markdown {
    font-size: 0.9rem;
    line-height: 1.6;
}

.rendered-markdown h1,
.rendered-markdown h2,
.rendered-markdown h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.rendered-markdown h1:first-child,
.rendered-markdown h2:first-child {
    margin-top: 0;
}

.rendered-markdown p {
    margin-bottom: 1rem;
}

.rendered-markdown ul,
.rendered-markdown ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.rendered-markdown code {
    background: #e2e8f0;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.rendered-markdown pre code {
    display: block;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* File Info Bar */
.file-info-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Modal Styles */
.modal {
    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: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

.modal-content.analysis-modal {
    max-width: 600px;
}

.modal-content.chunk-modal {
    max-width: 900px;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Chunk Controls */
.chunk-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.chunk-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.chunk-controls select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.chunk-stats {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    font-size: 0.85rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.chunk-stats span {
    color: var(--text);
}

.chunk-stats strong {
    color: var(--primary);
}

/* Chunks Container */
.chunks-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chunk-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.chunk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

.chunk-index {
    font-weight: 600;
    color: var(--primary);
}

.chunk-tokens {
    color: var(--text-light);
}

.chunk-text {
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text);
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chunk-section {
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    background: #fefce8;
}

/* Analysis Results */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.analysis-card {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
}

.analysis-card h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.analysis-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.analysis-card .label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.analysis-section {
    margin-bottom: 1.5rem;
}

.analysis-section h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-tag {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.readability-score {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

.readability-gauge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) calc(var(--score) * 3.6deg), #e2e8f0 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.readability-gauge::before {
    content: '';
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    position: absolute;
}

.readability-gauge span {
    position: relative;
    z-index: 1;
}

.structure-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.structure-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: 6px;
    font-size: 0.8rem;
}

.structure-item .count {
    font-weight: 600;
    color: var(--primary);
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading-spinner::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

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

/* Warning color */
.warning {
    color: #f59e0b;
}

/* ========================================
   CONSISTENT CARD HOVER EFFECTS
   ======================================== */

/* Generic Card - Base styles for consistent hover */
.card,
.feature-card,
.use-case-card,
.stats-card,
.info-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover,
.feature-card:hover,
.use-case-card:hover,
.stats-card:hover,
.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

/* Upload card hover (lighter effect) */
.upload-card {
    transition: box-shadow 0.2s ease;
}

.upload-card:hover {
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

/* Analysis card hover */
.analysis-card {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.analysis-card:hover {
    transform: translateY(-2px);
    background-color: #f1f5f9;
}

/* Chunk item hover */
.chunk-item {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chunk-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

/* Link card hover (for cards with anchor tags) */
a.card,
a.feature-card,
a.use-case-card {
    text-decoration: none;
    color: inherit;
}

a.card:hover,
a.feature-card:hover,
a.use-case-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
}

/* Interactive icon hover in cards */
.card .icon,
.feature-card .icon,
.use-case-card .icon {
    transition: transform 0.2s ease, color 0.2s ease;
}

.card:hover .icon,
.feature-card:hover .icon,
.use-case-card:hover .icon {
    transform: scale(1.1);
    color: var(--primary);
}

/* Badge hover enhancement */
.badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
}

/* Footer link hover */
footer a {
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary) !important;
}

/* Result section action buttons enhancement */
.result-section .action-btn {
    transition: all 0.2s ease;
}

.result-section .action-btn:hover {
    transform: translateY(-1px);
}

/* Modal content subtle animation */
.modal-content {
    transition: transform 0.2s ease;
}

/* Tab button enhancement */
.tab-btn {
    transition: all 0.2s ease;
}

.tab-btn:hover:not(.active) {
    background: var(--bg);
    color: var(--text);
}

/* View toggle button enhancement */
.view-btn {
    transition: all 0.2s ease;
}

.view-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
}