/* McMaster Scraper Web App Styles */

body {
    overflow: hidden;
}

/* Tree panel */
#category-tree {
    min-height: 200px;
}

.jstree-default-dark .jstree-anchor {
    font-size: 0.875rem;
}

/* Detail panel */
#detail-panel h5 {
    word-break: break-word;
}

.attr-table th {
    width: 200px;
    white-space: nowrap;
}

.attr-values {
    max-height: 200px;
    overflow-y: auto;
}

.attr-value-badge {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Status badges */
.status-completed { color: #198754; }
.status-pending { color: #6c757d; }
.status-error { color: #dc3545; }
.status-redirect { color: #0dcaf0; }

/* Log panel (always visible) */
.log-output {
    flex: 1;
    overflow-y: auto;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.75rem;
    padding: 8px 12px;
    line-height: 1.6;
    background: #0d1117;
}

.log-output .log-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.log-output .log-info { color: #8b949e; }
.log-output .log-warning { color: #d29922; }
.log-output .log-error { color: #f85149; }
.log-output .log-success { color: #3fb950; }
.log-output .log-scrape { color: #58a6ff; }

/* Queue panel */
#queue-panel {
    background: #161b22;
}

.queue-item {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 8px;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.queue-item .qi-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.queue-item .qi-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item .qi-status {
    flex-shrink: 0;
    font-size: 0.7rem;
}

.queue-item .qi-detail {
    flex-shrink: 0;
    color: #8b949e;
    font-size: 0.7rem;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item.qi-active {
    background: rgba(56, 139, 253, 0.06);
}

.queue-item.qi-completed {
    opacity: 0.6;
}

.queue-item.qi-error {
    background: rgba(248, 81, 73, 0.06);
}

/* Search results */
#search-results .list-group-item {
    cursor: pointer;
    padding: 6px 12px;
    font-size: 0.85rem;
}

#search-results .list-group-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Saved page iframe */
.page-iframe {
    width: 100%;
    height: 400px;
    border: 1px solid #444;
    border-radius: 4px;
    background: white;
}

/* Instance slider */
.form-range::-webkit-slider-thumb {
    cursor: grab;
}

/* Progress animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Spinning icon for nodes being scraped */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning::before {
    display: inline-block;
    animation: spin 1s linear infinite;
}
