/* Main Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body {
    background-color: #f5f7fa;
    color: #212529;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Document Cards */
.document-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.document-card .card-img-top {
    height: 160px;
    object-fit: cover;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--secondary-color);
}

.document-card .document-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.document-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-card .card-text {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.document-card .document-meta {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: auto;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

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

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Forms */
.form-control, .form-select {
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Document Preview */
#documentPreviewContent {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#documentPreviewContent img, 
#documentPreviewContent canvas {
    max-width: 100%;
    max-height: 70vh;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    margin-bottom: 1rem;
}

.upload-dropzone:hover, 
.upload-dropzone.dragover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.upload-dropzone i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .document-card .card-img-top {
        height: 120px;
    }
    
    .document-card .document-icon {
        font-size: 2.5rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Document type colors */
.bg-invoice { background-color: #e7f5ff; color: #1864ab; }
.bg-receipt { background-color: #e6fcf5; color: #087f5b; }
.bg-contract { background-color: #fff3bf; color: #5f3dc4; }
.bg-other { background-color: #f3f0ff; color: #5f3dc4; }

/* Drop Zone */
#drop-zone .border-dashed {
    border: 2px dashed #ccc;
    border-radius: 0.5rem;
    transition: border-color 0.2s, background-color 0.2s;
}

#drop-zone.highlight .border-dashed {
    border-color: #0d6efd;
    background-color: #f0f8ff;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}
