/* ==========================================================================
   Status Badges
   ========================================================================== */

.badge-uploaded {
    background-color: #0d6efd; /* Bootstrap primary blue */
}

.badge-parsing {
    background-color: #ffc107; /* Bootstrap warning yellow */
    animation: badge-pulse 2s ease-in-out infinite;
}

.badge-parsed {
    background-color: #0dcaf0; /* Bootstrap info cyan */
}

.badge-storing {
    background-color: #ffc107; /* Bootstrap warning yellow */
    animation: badge-pulse 2s ease-in-out infinite;
}

.badge-completed {
    background-color: #198754; /* Bootstrap success green */
}

.badge-failed {
    background-color: #dc3545; /* Bootstrap danger red */
}

.badge-lg {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
}

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

/* ==========================================================================
   Processing Timeline
   ========================================================================== */

.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30px;
    height: 100%;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-left: 70px;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1;
    border: 3px solid #fff;
}

.timeline-marker-started {
    background-color: #ffc107;
    color: #000;
}

.timeline-marker-completed {
    background-color: #198754;
    color: #fff;
}

.timeline-marker-failed {
    background-color: #dc3545;
    color: #fff;
}

.timeline-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #0d6efd;
    transition: all 0.3s ease;
}

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

.timeline-header {
    margin-bottom: 10px;
}

/* Mobile responsive timeline */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        padding-left: 60px;
    }

    .timeline-marker {
        left: 0;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* ==========================================================================
   Progress Bars
   ========================================================================== */

.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.5s ease;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 1rem 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* ==========================================================================
   JSON Viewer
   ========================================================================== */

.json-viewer {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.json-key {
    color: #9cdcfe;
}

.json-string {
    color: #ce9178;
}

.json-number {
    color: #b5cea8;
}

.json-boolean {
    color: #569cd6;
}

.json-null {
    color: #569cd6;
}

pre code {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    display: block;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

/* ==========================================================================
   Cards and Panels
   ========================================================================== */

.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

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

.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

/* Sticky table header for long tables */
.table-sticky-header thead th {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Upload UI
   ========================================================================== */

.file-drop-zone {
    border: 2px dashed #0d6efd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.file-drop-zone:hover {
    border-color: #0a58ca;
    background-color: #e7f3ff;
}

.file-drop-zone.drag-over {
    border-color: #198754;
    background-color: #d1e7dd;
}

/* Custom file input styling */
.form-control[type="file"] {
    padding: 10px;
}

.form-control[type="file"]::file-selector-button {
    padding: 8px 15px;
    border: 1px solid #0d6efd;
    border-radius: 5px;
    background-color: #0d6efd;
    color: #fff;
    cursor: pointer;
    margin-right: 10px;
}

.form-control[type="file"]::file-selector-button:hover {
    background-color: #0a58ca;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-muted-light {
    color: #adb5bd !important;
}

.badge-pulse {
    animation: badge-pulse 2s ease-in-out infinite;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    margin-top: 40px;
    border-top: 1px solid #dee2e6;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 15px;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .table thead {
        display: none;
    }

    .table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
    }

    .table td {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-transform: uppercase;
        font-size: 0.8rem;
        color: #6c757d;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #212529;
        --bs-body-color: #dee2e6;
        --bs-card-bg: #343a40;
    }

    .card {
        background-color: var(--bs-card-bg);
        color: var(--bs-body-color);
    }

    .card-header {
        background-color: #495057;
        border-bottom-color: #495057;
    }

    .timeline-content {
        background-color: #495057;
    }

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

/* ==========================================================================
   Animations
   ========================================================================== */

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

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

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

.slide-down {
    animation: slideDown 0.5s ease;
}
