/* 
 * PDFAnalytics Design System - Refined Professional
 * Theme: Clean Light + Deep Purple Accents
 * Font: Plus Jakarta Sans
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Base Colors - Clean White */
    --bg-root: #ffffff;
    --bg-surface: #f8fafc; /* Cool grey 50 */
    --bg-surface-hover: #f1f5f9; /* Cool grey 100 */
    
    /* Text Colors - High Contrast */
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --text-tertiary: #94a3b8; /* Slate 400 */
    
    /* Brand Colors - Sophisticated Purple */
    --brand-primary: rgb(136, 42, 255);
    --brand-primary-hover: rgb(110, 20, 220);
    --brand-surface: rgba(136, 42, 255, 0.04); /* Very subtle tint */
    
    /* UI Elements */
    --border-subtle: #e2e8f0; /* Slate 200 */
    --border-focus: #cbd5e1; /* Slate 300 */
    
    /* Shadows - Soft & Professional */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-focus: 0 0 0 4px rgba(136, 42, 255, 0.1);
    
    /* Animation */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 0.2s var(--ease-out);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-root);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--brand-primary);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    box-sizing: border-box; /* Ensure padding doesn't add to width */
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    background: white;
    border-bottom: 1px solid var(--bg-surface);
}

.nav-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--text-primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    margin-right: -8px;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    width: 100%;
    background: white;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}

.mobile-menu.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: slideDown 0.2s ease-out;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    height: 44px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--text-primary); /* Slate 900 - Classic Black/Dark Grey */
    color: white;
}

.btn-primary:hover {
    background: black;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

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

/* Hero Section - Clean */
.hero-section {
    padding: 20px 0 100px;
    text-align: center;
    background: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--brand-surface);
    color: var(--brand-primary);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 32px;
}

.hero-title {
    font-size: 3.75rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.hero-desc {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
    line-height: 1.6;
}

/* Upload Widget - Refined */
.upload-widget-container {
    max-width: 640px;
    margin: 0 auto;
}

.upload-zone {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.upload-zone:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-focus);
    transform: translateY(-2px);
}

.upload-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--bg-surface);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.upload-zone:hover .upload-icon-wrapper {
    color: var(--brand-primary);
    background: var(--brand-surface);
}

/* Feature Sections */
.section {
    padding: 100px 0;
}

.section-alt {
    background: var(--bg-surface);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 120px;
}

.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.feature-row.reverse {
    direction: rtl;
}

.feature-row.reverse > * {
    direction: ltr;
}

.feature-content h2 {
    font-size: 2.25rem;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.feature-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.feature-image {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
}

.feature-image img {
    width: 100%;
    display: block;
    object-fit: contain;
}

/* Testimonials - Grid */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    margin-top: 64px;
}

.testimonial-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.t-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.t-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.t-meta h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.t-meta span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
}

.t-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.t-footer {
    padding-top: 16px;
    border-top: 1px solid var(--bg-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.t-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--brand-primary);
    font-weight: 500;
}

/* Blog - Clean List */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
    margin: 40px auto 0;
}

.blog-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.blog-item:hover {
    border-color: var(--brand-primary);
}

.blog-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.blog-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

.blog-arrow {
    color: var(--text-tertiary);
}

/* Modal */
.modal-overlay {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 540px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
}

.preview-img-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    margin: 24px 0;
}

.feature-check-list {
    text-align: left;
    margin: 24px 0 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-surface);
    border-radius: 8px;
}

.feature-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.check-circle {
    width: 20px;
    height: 20px;
    background: var(--brand-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.dashboard-filters {
    background: white;
    border: 1px solid var(--border-subtle);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    gap: 24px;
}

.filter-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex: 1;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    display: block; 
    font-size: 0.8rem; 
    font-weight: 600; 
    color: var(--text-secondary); 
    margin-bottom: 4px;
}

.filter-item select {
    width: 100%;
    height: 40px; 
    padding: 0 8px; 
    border: 1px solid var(--border-subtle); 
    border-radius: 6px; 
    font-family: inherit; 
    font-size: 0.95rem;
}

.doc-select-container {
    width: 240px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.time-select-container {
    width: 200px;
}

.view-links-btn {
    height: 40px; 
    padding: 0 16px;
}

.icon-btn {
    height: 40px; 
    width: 40px; 
    padding: 0; 
    display: none; 
    align-items: center; 
    justify-content: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.chart-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 24px;
    gap: 16px;
}

.metric-select {
    height: 32px; 
    padding: 0 8px; 
    border: 1px solid var(--border-subtle); 
    border-radius: 6px; 
    font-family: inherit; 
    font-size: 0.85rem; 
    color: var(--text-secondary);
}

.doc-card {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.doc-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.doc-preview {
    height: 160px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 3rem;
}

.doc-info {
    padding: 20px;
}

/* Compact Document List */
.doc-list-compact {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: 32px;
    scrollbar-width: thin;
}

.doc-item-compact {
    min-width: 220px;
    max-width: 220px;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
}

.doc-item-compact:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.doc-item-compact.active {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(136, 42, 255, 0.1);
    background-color: #fcfaff;
}

.doc-item-compact h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.doc-item-compact .doc-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Chart Placeholder */
.chart-container-relative {
    position: relative;
    height: 300px; 
    width: 100%;
}

.chart-placeholder-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
}

.chart-placeholder-icon {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.chart-placeholder-text {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* Footer */
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

/* Use Cases Grid */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* Mobile */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .mobile-menu-btn { display: block; }
    .feature-row { grid-template-columns: 1fr; gap: 40px; }
    .nav-links { display: none; }

    /* Dashboard Mobile */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .dashboard-header .btn {
        width: 100%;
    }

    .dashboard-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .doc-select-container, .time-select-container {
        width: 100%;
    }
    
    .view-links-btn {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr; /* Stack metrics vertically on mobile */
        gap: 16px;
    }

    /* Chart Header Mobile */
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .metric-select {
        width: 100%;
    }

    /* Footer responsive design */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .footer-grid > div:first-child {
        margin-bottom: 16px;
    }

    /* Footer Copyright Section */
    footer .container > div:last-child {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    /* Use Cases responsive */
    .use-cases-grid {
        grid-template-columns: 1fr;
    }

    /* Prevent horizontal scrolling */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .doc-card, .chart-container-relative {
        min-width: unset;
    }

    /* Make feature content more mobile-friendly */
    .feature-content h2 {
        font-size: 1.5rem;
    }

    .feature-content p {
        font-size: 1rem;
    }

    /* Adjust step flow for mobile */
    .feature-content > div:first-of-type + div {
        flex-direction: column;
        gap: 16px;
    }

    .feature-content > div:first-of-type + div > div {
        min-width: unset;
        flex: 1;
    }
}