/* Additional styles to complement the inline styles in index.html */
/* Most styling is handled by inline styles in the HTML for the dark theme */

/* File name display */
.file-name {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--surface-light);
}

/* Optional label styling */
.optional {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.85em;
}

/* Book card selected state for dark theme */
.book-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

/* Meta badge styling for dark theme */
.meta-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.meta-badge.type {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.meta-badge.confidence {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Source item styling for dark theme */
.source-item {
    background: rgba(15, 23, 42, 0.4);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.source-item:hover {
    background: rgba(15, 23, 42, 0.6);
    border-left-color: var(--primary-light);
}

.source-level {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.source-excerpt {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.75rem;
    line-height: 1.7;
    padding-left: 0.5rem;
    border-left: 2px solid var(--surface-light);
}

/* Loading spinner for dark theme */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status indicator pulse animation */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-name {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .source-item {
        padding: 0.75rem 1rem;
    }
    
    .meta-badge {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    #upload-section,
    #books-section {
        display: none;
    }
    
    .answer-content {
        background: white;
        color: black;
        border: 1px solid #ccc;
    }
}
