/* Custom CSS for Document Extraction System */

/* Root Variables */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Body and Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #ffffff;
    color: #212529;
}

/* Navbar Enhancements */
.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Card Enhancements */
.card {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #212529;
}

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

/* Button Enhancements */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

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

/* Alert Improvements */
.alert {
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    border-left: 4px solid;
    color: #212529;
}

.alert-success {
    border-left-color: var(--success-color);
    background-color: rgba(25, 135, 84, 0.1);
    color: #0f5132;
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.alert-warning {
    border-left-color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
    color: #664d03;
}

.alert-info {
    border-left-color: var(--info-color);
    background-color: rgba(13, 202, 240, 0.1);
    color: #055160;
}

/* Form Enhancements */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #212529;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    background-color: #ffffff;
}

.form-label {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

/* Table Improvements */
.table {
    background-color: #ffffff;
    color: #212529;
}

.table th {
    font-weight: 600;
    color: #212529;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
}

.table td {
    color: #212529;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Badge Enhancements */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Progress Bar */
.progress {
    border-radius: var(--border-radius);
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: var(--border-radius);
    transition: width 0.6s ease;
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed #ced4da;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    color: #212529;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.file-upload-area .upload-content {
    width: 100%;
    text-align: center;
}

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

.file-upload-area.dragover {
    border-style: solid;
}

/* CSP-safe utility classes */
.hidden {
    display: none !important;
}

.progress-bar-initial {
    width: 0% !important;
}

.progress-thin {
    height: 4px !important;
}

.progress-medium {
    height: 20px !important;
}

.icon-circle {
    width: 64px !important;
    height: 64px !important;
}

.progress-width-0 {
    width: 0%;
}

/* Dynamic width classes for progress bars */
.progress-width-full {
    width: 100%;
}

.progress-width-dynamic {
    transition: width 0.3s ease;
}

/* Progress bar classes for CSP compliance */
.progress-0 { width: 0% !important; }
.progress-5 { width: 5% !important; }
.progress-10 { width: 10% !important; }
.progress-15 { width: 15% !important; }
.progress-20 { width: 20% !important; }
.progress-25 { width: 25% !important; }
.progress-30 { width: 30% !important; }
.progress-35 { width: 35% !important; }
.progress-40 { width: 40% !important; }
.progress-45 { width: 45% !important; }
.progress-50 { width: 50% !important; }
.progress-55 { width: 55% !important; }
.progress-60 { width: 60% !important; }
.progress-65 { width: 65% !important; }
.progress-70 { width: 70% !important; }
.progress-75 { width: 75% !important; }
.progress-80 { width: 80% !important; }
.progress-85 { width: 85% !important; }
.progress-90 { width: 90% !important; }
.progress-95 { width: 95% !important; }
.progress-100 { width: 100% !important; }

/* Dynamic width from data attributes */
.progress-bar[data-width="0"] { width: 0% !important; }
.progress-bar[data-width="1"] { width: 1% !important; }
.progress-bar[data-width="2"] { width: 2% !important; }
.progress-bar[data-width="3"] { width: 3% !important; }
.progress-bar[data-width="4"] { width: 4% !important; }
.progress-bar[data-width="5"] { width: 5% !important; }
.progress-bar[data-width="10"] { width: 10% !important; }
.progress-bar[data-width="15"] { width: 15% !important; }
.progress-bar[data-width="20"] { width: 20% !important; }
.progress-bar[data-width="25"] { width: 25% !important; }
.progress-bar[data-width="30"] { width: 30% !important; }
.progress-bar[data-width="35"] { width: 35% !important; }
.progress-bar[data-width="40"] { width: 40% !important; }
.progress-bar[data-width="45"] { width: 45% !important; }
.progress-bar[data-width="50"] { width: 50% !important; }
.progress-bar[data-width="55"] { width: 55% !important; }
.progress-bar[data-width="60"] { width: 60% !important; }
.progress-bar[data-width="65"] { width: 65% !important; }
.progress-bar[data-width="70"] { width: 70% !important; }
.progress-bar[data-width="75"] { width: 75% !important; }
.progress-bar[data-width="80"] { width: 80% !important; }
.progress-bar[data-width="85"] { width: 85% !important; }
.progress-bar[data-width="90"] { width: 90% !important; }
.progress-bar[data-width="95"] { width: 95% !important; }
.progress-bar[data-width="100"] { width: 100% !important; }

.file-item {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
    color: #212529;
}

.file-item .remove-file {
    color: var(--danger-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-item .remove-file:hover {
    color: #b02a37;
    transform: scale(1.1);
}

/* Status Indicators */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-indicator.processing {
    background-color: var(--warning-color);
    animation: pulse 2s infinite;
}

.status-indicator.completed {
    background-color: var(--success-color);
}

.status-indicator.failed {
    background-color: var(--danger-color);
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(13, 110, 253, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Password Strength Indicator */
.password-strength-weak {
    background-color: var(--danger-color) !important;
}

.password-strength-medium {
    background-color: var(--warning-color) !important;
}

.password-strength-strong {
    background-color: var(--success-color) !important;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: #f8f9fa;
    color: #212529;
}

/* Text utilities */
.text-muted {
    color: #6c757d !important;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-start-4 {
    border-left-width: 4px !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #146c43);
}

.bg-gradient-info {
    background: linear-gradient(135deg, var(--info-color), #0aa2c0);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--warning-color), #d39e00);
} 