/* AWP Invoice Validation System - Custom Styles
   Following Flask Application Style Guide */

/* Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-title {
    font-weight: 700;
    margin-bottom: 0;
}

/* Card Styling - Apply shadow to all cards */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Upload Area Styling */
.upload-area {
    border: 2px dashed #007bff;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #0056b3;
    background-color: #e3f2fd;
}

.upload-area.drag-over {
    border-color: #28a745;
    background-color: #d4edda;
}

/* File Input Styling */
.custom-file-input {
    cursor: pointer;
}

.custom-file-input:focus ~ .custom-file-label {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Interactive Elements */
.btn {
    transition: all 0.2s ease;
}

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

/* Progress Bar Animation */
.progress-bar-animated {
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}

/* Table Enhancements */
.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f5f5f5;
}

/* Badge Styling */
.badge {
    transition: transform 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* Footer Styling */
.version-footer {
    background-color: #f8f9fa;
    padding: 20px 0;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .version-footer small {
        font-size: 0.7rem;
    }
    
    .card-header h2, .card-header h3 {
        font-size: 1.2rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .upload-area {
        padding: 20px;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Alert Enhancements */
.alert {
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #28a745;
}

.alert-danger {
    border-left-color: #dc3545;
}

.alert-warning {
    border-left-color: #ffc107;
}

.alert-info {
    border-left-color: #17a2b8;
}

/* Form Control Focus */
.form-control:focus,
.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Navigation Enhancement */
.navbar-brand {
    font-weight: 600;
}

.nav-link {
    transition: color 0.2s ease;
}

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

/* Dropdown Menu */
.dropdown-menu {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: none;
}

.dropdown-item {
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Customer Card (for future use) */
.customer-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.customer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Progress Tracker Styles */
.progress-tracker {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.progress-tracker:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-title {
    margin: 0;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
}

.progress-cancel-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.progress-cancel-btn:hover {
    background: #c82333;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,.15) 50%,
        rgba(255,255,255,.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 20px 0;
    }
    100% {
        background-position: 0 0;
    }
}

.progress-percentage {
    font-weight: 600;
    color: #495057;
    min-width: 50px;
    text-align: right;
}

.progress-info {
    margin-bottom: 15px;
}

.progress-current-operation {
    font-size: 1rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.progress-current-file {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
    margin-bottom: 5px;
    word-break: break-all;
}

.progress-steps {
    font-size: 0.875rem;
    color: #6c757d;
}

.progress-details {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.875rem;
}

.progress-elapsed-time,
.progress-estimated-time {
    color: #495057;
    margin-bottom: 5px;
}

.progress-stats {
    color: #6c757d;
}

.progress-messages {
    margin-bottom: 15px;
}

.progress-errors,
.progress-warnings {
    margin-bottom: 10px;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 4px solid #dc3545;
    margin-bottom: 5px;
    font-size: 0.875rem;
}

.warning-message {
    background-color: #fff3cd;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
    margin-bottom: 5px;
    font-size: 0.875rem;
}

.progress-results {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 15px;
}

.progress-results h5 {
    color: #155724;
    margin-bottom: 10px;
    font-size: 1rem;
}

.progress-results-content {
    color: #155724;
}

.result-item {
    margin-bottom: 5px;
    font-size: 0.875rem;
}

.result-item strong {
    color: #0c5460;
}

/* Mobile responsiveness for progress tracker */
@media (max-width: 768px) {
    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .progress-cancel-btn {
        align-self: flex-end;
    }
    
    .progress-bar-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-percentage {
        min-width: auto;
        text-align: left;
    }
    
    .progress-current-file {
        word-break: break-word;
    }
    
    .progress-tracker {
        padding: 15px;
        margin: 15px 0;
    }
}