/* 
 * Invoice AI - Modern UI Stylesheet
 * A clean, minimalist design for invoice processing application
 */

 :root {
    /* Color Variables */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Typography */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 70px;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease;
}

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

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: var(--gray-50);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--gray-900);
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: white;
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 18px;
    color: var(--primary);
}

.app-logo i {
    font-size: 24px;
}

.sidebar-content {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    padding: 0 20px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--gray-600);
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link i {
    font-size: 18px;
    opacity: 0.8;
}

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

.nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
    border-left-color: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 15px 20px;
    border-top: 1px solid var(--gray-200);
    background-color: white;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.footer-content p {
    margin: 0;
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
}

.footer-content .copyright {
    font-weight: 500;
}

.footer-content .version {
    font-size: 11px;
    color: var(--gray-400);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    transition: var(--transition);
    width: calc(100% - var(--sidebar-width));
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile Menu Toggle */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 99;
    background-color: white;
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.mobile-sidebar-toggle i {
    font-size: 22px;
    color: var(--gray-700);
}

/* Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.section-header {
    margin-bottom: 24px;
}

.section-header h1 {
    font-size: 24px;
    margin-bottom: 4px;
}

.section-description {
    color: var(--gray-500);
    font-size: 14px;
}

/* Cards */
.section-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 18px;
    margin: 0;
}

.card-content {
    padding: 20px;
}

/* Stat Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-content h2 {
    font-size: 28px;
    margin: 0;
    line-height: 1.2;
}

.stat-content p {
    color: var(--gray-500);
    margin: 0 0 4px 0;
}

.stat-change {
    font-size: 12px;
    color: var(--success);
}

/* Empty States */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--gray-500);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 500;
    color: var(--gray-500);
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

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

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
}

.btn-outline-secondary {
    background-color: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline-secondary:hover {
    background-color: var(--gray-100);
}

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

.view-all {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
}

/* Upload Area */
.upload-area {
    margin-bottom: 30px;
}

.dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    background-color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.dropzone-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: var(--primary-light);
    border-radius: 50%;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
}

.dropzone:hover .dropzone-icon {
    transform: scale(1.1);
}

.dropzone h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-800);
}

.dropzone p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.dropzone #browseButton {
    margin-top: 15px;
    min-width: 140px;
    transition: all 0.3s ease;
}

.dropzone #browseButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.file-preview {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-icon {
    font-size: 24px;
    color: var(--primary);
}

.file-details h4 {
    margin: 0 0 4px 0;
}

.file-details p {
    color: var(--gray-500);
    margin: 0;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.upload-progress {
    padding: 20px;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--gray-200);
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
}

/* Guide Steps */
.guide-step {
    margin-bottom: 24px;
}

.guide-step:last-child {
    margin-bottom: 0;
}

.guide-step h3 {
    margin-bottom: 8px;
}

/* Result Details */
.extraction-details {
    margin-bottom: 24px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item label {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    margin-bottom: 4px;
}

.detail-value {
    font-weight: 500;
}

.editable {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.editable:hover {
    background-color: var(--gray-100);
}

.result-actions {
    display: flex;
    gap: 12px;
}

.confidence-badge {
    background-color: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Redesigned Help & Documentation Section */
#help {
    padding: 30px;
    background-color: var(--gray-100);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-bottom: 30px;
}

#help .section-header h1 {
    font-size: 28px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
}

#help .section-description {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 25px;
    line-height: 1.6;
}

#help a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

#help a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

#help .content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#help .content-item {
    padding: 15px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

#help .content-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* View Extraction Button */
.view-extraction {
    background-color: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.view-extraction:hover {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.25);
}

.view-extraction i {
    font-size: 14px;
}

/* Alert Container */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    animation: slideInRight 0.3s ease;
    background-color: white;
    border-left: 4px solid var(--gray-400);
}

.alert-success {
    border-left-color: var(--success);
}

.alert-warning {
    border-left-color: var(--warning);
}

.alert-danger {
    border-left-color: var(--danger);
}

.alert-info {
    border-left-color: var(--primary);
}

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

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-sidebar-toggle {
        display: flex;
    }
}
