/**
 * TaxonResultWidget Styles
 * Styles for the taxon result card widget
 */

/* Result card base styles */
.taxon-result-card {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Compact mode */
.taxon-result-card.compact {
    padding: 12px 16px;
    margin-bottom: 10px;
}

.taxon-result-card.compact .result-header {
    margin-bottom: 8px;
}

.taxon-result-card.compact .result-title {
    font-size: 14px;
}

.taxon-result-card.compact .result-meta {
    margin-bottom: 8px;
}

.taxon-result-card.compact .result-actions {
    margin-top: 8px;
}

/* Header with title and similarity badge */
.taxon-result-card .result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.taxon-result-card .result-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    line-height: 1.3;
}

.taxon-result-card .similarity-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Metadata section */
.taxon-result-card .result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
    font-size: 13px;
}

.taxon-result-card .meta-item {
    display: flex;
    gap: 4px;
    color: #666;
}

.taxon-result-card .meta-label {
    font-weight: 500;
    color: #888;
}

/* Description */
.taxon-result-card .result-description {
    color: #555;
    line-height: 1.6;
    font-size: 14px;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

/* Action buttons */
.taxon-result-card .result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.taxon-result-card .view-pdf-btn {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.taxon-result-card .view-pdf-btn:hover {
    opacity: 0.9;
}

.taxon-result-card .toggle-json {
    padding: 6px 14px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: background 0.2s ease;
}

.taxon-result-card .toggle-json:hover {
    background: #e0e0e0;
}

/* JSON display */
.taxon-result-card .result-json {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    overflow-x: auto;
}

.taxon-result-card .result-json pre {
    margin: 0;
    font-size: 12px;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Loading state */
.taxon-result-loading {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Error state */
.taxon-result-error {
    background: #fff5f5;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid #fed7d7;
}

.taxon-result-error .error-title {
    font-weight: 600;
    color: #c53030;
    margin-bottom: 4px;
}

.taxon-result-error .error-message {
    font-size: 13px;
    color: #9b2c2c;
}

/* Results container header */
.taxon-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #666;
}

.taxon-results-header .results-count {
    font-size: 14px;
}

.taxon-results-header .collection-status {
    color: #667eea;
    font-size: 14px;
}

/* No results state */
.taxon-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 15px;
}

/* Expand/collapse button for history results */
.taxon-results-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: background 0.2s ease;
    margin-top: 8px;
}

.taxon-results-toggle:hover {
    background: #e8e8e8;
}

.taxon-results-toggle .arrow {
    transition: transform 0.2s ease;
}

.taxon-results-toggle.expanded .arrow {
    transform: rotate(180deg);
}

/* Results list in history view */
.search-results-list {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.search-results-list.collapsed {
    display: none;
}

/* Fallback state for unavailable taxon records */
.taxon-result-fallback {
    background: #fefce8;
    border: 1px solid #fef08a;
}

.taxon-result-fallback:hover {
    box-shadow: 0 4px 16px rgba(202, 138, 4, 0.15);
}

.taxon-result-fallback .result-title {
    color: #854d0e;
}

.taxon-result-fallback .result-description {
    color: #a16207;
    font-style: italic;
}
