/* Ocular app-specific styles — layout is provided by aecs4u-theme */

/* CSS Custom Properties (app-level overrides) */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --border-radius: 0.5rem;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.display-4 {
    font-weight: 700;
    color: var(--bs-body-color, #2c3e50);
}

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

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

.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.nav-pills .nav-link {
    border-radius: var(--border-radius);
    font-weight: 600;
    color: var(--bs-secondary-color, #6c757d);
    transition: all 0.3s ease;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

#markdown-content {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: var(--bs-tertiary-bg, #f8f9fa) !important;
    border: 2px solid #e9ecef !important;
}

/* Animations */
.success-animation {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* File input */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: block;
    padding: 0.75rem 1rem;
    border: 2px dashed #e9ecef;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bs-tertiary-bg, #f8f9fa);
}

.file-input-label:hover {
    border-color: var(--primary-color);
    background-color: #e7f3ff;
}

.file-input-label.dragover {
    border-color: var(--success-color);
    background-color: #d1e7dd;
}

/* Results */
.result-container {
    max-height: 600px;
    overflow-y: auto;
    border-radius: var(--border-radius);
}

.copy-button {
    position: relative;
    overflow: hidden;
}

.copy-button .copy-text {
    transition: all 0.3s ease;
}

.copy-button.copied .copy-text {
    transform: translateY(-100%);
}

.copy-button .copied-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 100%);
    transition: all 0.3s ease;
}

.copy-button.copied .copied-text {
    transform: translate(-50%, -50%);
}

/* Sidebar nav overrides (active link indicator) */
.sidebar-nav .nav-link {
    color: var(--bs-secondary-color, #495057);
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover {
    background-color: #e9ecef;
    border-left-color: #0d6efd;
    color: #0d6efd;
}

.sidebar-nav .nav-link.active {
    background-color: #e7f1ff;
    border-left-color: #0d6efd;
    color: #0d6efd;
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 10px;
}

.sidebar-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

/* Navbar extras */
.user-menu {
    min-width: 200px;
}

.language-selector {
    width: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Document tracking page */
#document-tracking-page .stat-card {
    border-left: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}

#document-tracking-page .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#document-tracking-page .stat-card.primary { border-color: #0d6efd; }
#document-tracking-page .stat-card.success { border-color: #198754; }
#document-tracking-page .stat-card.warning { border-color: #ffc107; }
#document-tracking-page .stat-card.info { border-color: #0dcaf0; }

#document-tracking-page .hash-text {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background: var(--bs-tertiary-bg, #f8f9fa);
    padding: 2px 6px;
    border-radius: 3px;
}

#document-tracking-page .duplicate-badge {
    animation: document-duplicate-pulse 2s infinite;
}

@keyframes document-duplicate-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#document-tracking-page .timeline-item {
    border-left: 2px solid #dee2e6;
    padding-left: 20px;
    margin-bottom: 15px;
    position: relative;
}

#document-tracking-page .timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0d6efd;
}

/* Batch processing page */
#batch-processing-page .job-card {
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
}

#batch-processing-page .job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#batch-processing-page .job-card.pending { border-left-color: #6c757d; }
#batch-processing-page .job-card.queued { border-left-color: #17a2b8; }
#batch-processing-page .job-card.processing { border-left-color: #ffc107; }
#batch-processing-page .job-card.completed { border-left-color: #28a745; }
#batch-processing-page .job-card.failed { border-left-color: #dc3545; }
#batch-processing-page .job-card.cancelled { border-left-color: #6c757d; }

#batch-processing-page .priority-badge.urgent { background-color: #dc3545; }
#batch-processing-page .priority-badge.high { background-color: #fd7e14; }
#batch-processing-page .priority-badge.normal { background-color: #17a2b8; }
#batch-processing-page .priority-badge.low { background-color: #6c757d; }

#batch-processing-page .schedule-card {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

#batch-processing-page .schedule-card.enabled {
    border-left: 4px solid #28a745;
}

#batch-processing-page .schedule-card.disabled {
    border-left: 4px solid #dc3545;
    opacity: 0.7;
}

#batch-processing-page .file-list {
    max-height: 200px;
    overflow-y: auto;
}

#batch-processing-page .progress-ring {
    width: 60px;
    height: 60px;
}

#batch-processing-page .tab-content {
    padding-top: 20px;
}

#batch-processing-page .stat-card {
    border-radius: 10px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#batch-processing-page .stat-card.success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#batch-processing-page .stat-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

#batch-processing-page .stat-card.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

#batch-processing-page .stat-card.primary {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* OLMocr processor page */
#olmocr-processor-page #markdown-content {
    max-height: 500px;
    overflow-y: auto;
}

/* User profile page */
#user-profile-page .avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
}

#user-profile-page .avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#user-profile-page .quota-card {
    border-left: 4px solid #0d6efd;
}

#user-profile-page .api-key-prefix {
    font-family: 'Courier New', monospace;
    background: var(--bs-tertiary-bg, #f8f9fa);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Billing page */
#billing-page .cost-card {
    border-left: 4px solid #0d6efd;
}

#billing-page .alert-card {
    transition: all 0.3s ease;
}

#billing-page .alert-card.triggered {
    border-color: #dc3545;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

/* Upload dashboard */
#upload-dashboard .file-upload-area {
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

#upload-dashboard .file-upload-area:hover,
#upload-dashboard .file-upload-area.dragover {
    border-color: #0a58ca;
    background-color: var(--bs-tertiary-bg, #f8f9ff);
}

#upload-dashboard .provider-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

#upload-dashboard .provider-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#upload-dashboard .provider-card.selected {
    border-color: var(--primary-color);
    background-color: #e7f3ff;
}

#upload-dashboard .processing-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
}

#upload-dashboard .result-card {
    margin-bottom: 20px;
    border-left: 4px solid #198754;
}

#upload-dashboard .error-card {
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

#upload-dashboard .file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

#upload-dashboard .file-item .file-icon {
    margin-right: 10px;
    color: var(--primary-color);
}

#upload-dashboard .file-item .file-name {
    flex: 1;
    font-weight: 500;
}

#upload-dashboard .file-item .file-size {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.9rem;
    margin-right: 10px;
}

#upload-dashboard .file-item .remove-file {
    color: #dc3545;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1.1rem;
}

#upload-dashboard .file-item .remove-file:hover {
    color: #a71e2a;
}

#upload-dashboard #results pre {
    white-space: pre-wrap;
    font-size: 0.95rem;
}
