/* Admin Dashboard Styles */

/* Admin Navigation Styles */
.admin-header .navbar {
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.admin-header .navbar-brand {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.admin-header .nav-link {
    padding: 0.75rem 1.25rem;
    border-right: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.admin-header .nav-link:hover {
    background-color: rgba(0,0,0,0.03);
}

.admin-header .nav-link.active {
    background-color: rgba(0,0,0,0.05);
    color: var(--bs-primary) !important;
}

.admin-header .navbar-text {
    font-size: 0.9rem;
}


/* Gene Search Styles */
.admin-gene-search .gene-result {
    cursor: pointer;
    transition: background-color 0.2s;
}

.admin-gene-search .gene-result:hover,
.admin-gene-search .gene-result.selected {
    background-color: #f0f7ff;
}

.admin-gene-search #geneSearchResults.show {
    display: block !important;
}

.admin-user-search {
    min-width: 300px;
}

/* Pipeline Run Logs Styles */
.log-container {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
}

.log-entry {
    transition: background-color 0.2s;
}

.log-entry:hover {
    background-color: #f8f9fa !important;
}

.log-text {
    word-break: break-word;
    white-space: pre-wrap;
}

.badge-sm {
    font-size: 0.7em;
}

/* Pipeline Run Status Badges - Consistent across all admin pages */
.pipeline-status-completed {
    background-color: #6c757d !important;
    color: white !important;
}

.pipeline-status-running {
    background-color: #28a745 !important;
    color: white !important;
}

.pipeline-status-failed,
.pipeline-status-error {
    background-color: #dc3545 !important;
    color: white !important;
}

.pipeline-status-planned {
    background-color: #17a2b8 !important;
    color: white !important;
}

.pipeline-status-starting {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.pipeline-status-unknown {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6;
}

/* Pipeline Run Table Styles */
.pipeline-run-table {
    font-size: 0.9rem;
}

.pipeline-run-table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
}

.pipeline-run-table td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

.pipeline-run-table .genome-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

.pipeline-run-table .processing-state-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    margin-top: 0.25rem;
}

.pipeline-run-table .time-info {
    font-size: 0.8rem;
    color: #6c757d;
}

.pipeline-run-table .log-count {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Pipeline Run Card Styles */
.pipeline-runs-card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.pipeline-runs-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

.pipeline-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
}

.pipeline-empty-state h6 {
    margin-bottom: 0.5rem;
}

.pipeline-empty-state p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Pipeline Run Actions */
.pipeline-action-buttons {
    margin-bottom: 1.5rem;
}

.pipeline-action-buttons .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.pipeline-resume-section {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
}

.pipeline-resume-section h6 {
    margin-bottom: 0.75rem;
    color: #495057;
}

/* Admin General Styles */
.admin-breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
}

.admin-page-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.admin-card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.admin-table {
    font-size: 0.9rem;
}

.admin-table th {
    border-top: none;
    font-weight: 600;
    background-color: #f8f9fa;
}

.admin-status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* User Search Styles */
.search-result-item {
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f1f3f4 !important;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: #f8f9fa;
}

.search-result-item.active {
    background-color: #e9ecef;
}

.search-section-header {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#searchResults {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
}

#userSearch:focus + #searchResults {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#clearSearch {
    border-left: none;
}

#clearSearch:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Admin Header Styles */
.admin-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
}

.admin-nav-links .breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.admin-nav-links .breadcrumb-item a:hover {
    color: #495057;
}

.admin-nav-links .breadcrumb-item a.fw-bold {
    color: #495057;
    font-weight: 600 !important;
}

.admin-user-search {
    min-width: 300px;
}

/* Google Storage Files Styles */
.storage-files-container {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: white;
    margin-top: 0.5rem;
    overflow: hidden;
}

.storage-files-container .table {
    margin-bottom: 0;
    background-color: white;
}

.storage-files-container .table th {
    border-top: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
    padding: 0.5rem;
}

.storage-files-container .table td {
    font-size: 0.85rem;
    vertical-align: middle;
    padding: 0.5rem;
}

.storage-files-container .font-monospace {
    font-size: 0.8rem;
}

.storage-files-container .alert {
    border-radius: 0;
    border: none;
    margin-bottom: 0;
}

.storage-files-container .bg-light {
    background-color: #f8f9fa !important;
}

.storage-files-container .bg-light a {
    color: #495057;
    transition: color 0.2s ease;
}

.storage-files-container .bg-light a:hover {
    color: #007bff;
    text-decoration: underline !important;
}

.storage-files-container .border-bottom {
    border-bottom: 1px solid #dee2e6 !important;
}

#globalSearchResults {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
}

#globalUserSearch:focus + #globalSearchResults {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#clearGlobalSearch {
    border-left: none;
}

#clearGlobalSearch:hover {
    background-color: #e9ecef;
    color: #495057;
}

.cursor-pointer {
    cursor: pointer;
}

/* Editable Fields Styles */
.editable-field-display {
    padding: 0.25rem 0;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.editable-field-display:hover {
    background-color: #f8f9fa;
}

.editable-field-display .field-value {
    font-weight: 500;
    color: #495057;
}

.editable-field-display .edit-btn {
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
    font-size: 0.875rem;
}

.editable-field-display:hover .edit-btn {
    opacity: 1;
}

.editable-field-display .edit-btn:hover {
    color: #0d6efd !important;
    opacity: 1;
}

.editable-field-edit {
    padding: 0.5rem 0;
}

.quality-scores-summary .badge {
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
}

.quality-scores-form {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

.quality-scores-form .form-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.8rem;
}

/* Input group improvements for editable fields */
.editable-field-edit .input-group .btn {
    border-color: #ced4da;
}

.editable-field-edit .input-group .btn:hover {
    z-index: 2;
}

.editable-field-edit .btn-outline-success:hover {
    background-color: #198754;
    border-color: #198754;
}

.editable-field-edit .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Responsive adjustments for admin pages */
@media (max-width: 768px) {
    .log-container {
        font-size: 12px;
    }
    
    .admin-table,
    .pipeline-run-table {
        font-size: 0.8rem;
    }
    
    .badge-sm,
    .processing-state-badge {
        font-size: 0.6em;
    }
    
    .pipeline-run-table .genome-id {
        font-size: 0.75rem;
    }
    
    .pipeline-action-buttons .btn {
        width: 100%;
        margin-right: 0;
    }
    
    /* Admin header responsive adjustments */
    .admin-header .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-user-search {
        min-width: 100%;
        order: -1;
    }
    
    .admin-nav-links .breadcrumb {
        flex-wrap: wrap;
        font-size: 0.85rem;
    }
}
