/* Invoice Extraction - Enterprise Corporate Design */
:root {
    --primary-navy: #1e293b;
    --secondary-navy: #334155;
    --accent-blue: #3b82f6;
    --light-blue: #60a5fa;
    --white: #ffffff;
    --light-gray: #f8fafc;
    --medium-gray: #e2e8f0;
    --border-gray: #d1d5db;
    --dark-gray: #64748b;
    --text-dark: #1e293b;
    --text-medium: #475569;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-gray);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-navy);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 18px;
    padding: 8px;
}

.logo-svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Main Content */
.main {
    padding: 3rem 0;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--dark-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Section */
.upload-section {
    background: var(--white);
    border-radius: 8px;
    padding: 3rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-gray);
}

.upload-area {
    border: 2px dashed var(--border-gray);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--light-gray);
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.02);
    transform: translateY(-1px);
}

.upload-area.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    transform: none;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: var(--dark-gray);
    margin-bottom: 2rem;
}

.file-input {
    display: none;
}

.upload-btn {
    background: var(--primary-navy);
    color: var(--white);
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.upload-btn:hover {
    background: var(--accent-blue);
    box-shadow: var(--shadow-md);
}

.upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Progress Section */
.progress-section {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: none;
}

.progress-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--medium-gray);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent-blue);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* Results Section */
.results-section {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    display: none;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.download-card {
    border: 1px solid var(--medium-gray);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    background: var(--light-gray);
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.download-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.file-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
    font-size: 14px;
}

.csv-icon {
    background: #059669;
    color: var(--white);
}

.json-icon {
    background: var(--accent-blue);
    color: var(--white);
}

.download-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.download-card-description {
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.download-btn {
    width: 100%;
    background: var(--primary-navy);
    color: var(--white);
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: var(--shadow);
}

.download-btn:hover {
    background: var(--accent-blue);
    box-shadow: var(--shadow-md);
}

/* Error Messages */
.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: none;
}

.success-message {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: var(--accent-green);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: none;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .upload-section {
        padding: 2rem 1rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .download-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
}

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

.btn-primary:hover {
    background: var(--accent-blue);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-navy);
    border: 1px solid var(--border-gray);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: var(--light-gray);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: var(--shadow-md);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-gray);
    transition: all 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-gray);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-navy);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 500; }
h5 { font-size: 1.125rem; font-weight: 500; }
h6 { font-size: 1rem; font-weight: 500; }

/* File Info Display */
.file-info {
    background: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: none;
}

.file-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.file-icon {
    width: 24px;
    height: 24px;
    background: var(--primary-navy);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
}

.file-name {
    font-weight: 600;
    color: var(--text-dark);
}

.file-size {
    color: var(--dark-gray);
    font-size: 0.9rem;
}