/* Temperament Similarity Explorer Styles */

body {
    font-family: 'Crimson Text', Georgia, serif;
    background: #fafafa;
    color: #2c2c2c;
    line-height: 1.7;
    margin: 0;
}

/* Site Header / Navigation Styles */
.site-header {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a472a 100%);
    border-bottom: 2px solid #1a472a;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: 'Source Sans Pro', 'Segoe UI', system-ui, sans-serif;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    color: #fff !important;
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none !important;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}

.nav-link.current {
    background: rgba(255,255,255,0.2) !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Experimental Banner */
.experimental-banner {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.experimental-badge {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.experimental-text {
    font-size: 0.95rem;
}

.experimental-text a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

/* Page Header */
.page-header {
    text-align: center;
    margin: 2rem 0 2rem 0;
}

.page-title {
    font-size: 2.2rem;
    color: #1f4788;
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5rem 0;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    margin: 0 0 1rem 0;
}

.page-links {
    margin-top: 1rem;
}

.doc-link {
    color: #1f4788;
    text-decoration: none;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border: 1px solid #1f4788;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.2s ease;
}

.doc-link:hover {
    background: #1f4788;
    color: #fff;
}

/* Sections */
.section {
    background: #fff;
    border: 1px solid #e1e5ea;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.section-title {
    margin: 0 0 1rem 0;
    color: #2c2c2c;
    font-size: 1.4rem;
    font-weight: 600;
}

.section-label {
    display: block;
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c2c2c;
}

/* Source Filters */
.source-filters-section {
    margin-bottom: 1rem;
}

.source-checkboxes {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.source-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
}

.source-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Temperament Autocomplete */
.autocomplete-wrapper {
    position: relative;
    max-width: 600px;
}

.temperament-autocomplete {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: 'Source Sans Pro', sans-serif;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

.temperament-autocomplete:focus {
    outline: none;
    border-color: #1f4788;
    box-shadow: 0 0 0 3px rgba(31, 71, 136, 0.1);
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-result-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.95rem;
}

.autocomplete-result-item:hover,
.autocomplete-result-item.selected {
    background: #f8f9fa;
}

.autocomplete-result-item:last-child {
    border-bottom: none;
}

.autocomplete-result-item strong {
    color: #1f4788;
    font-weight: 600;
}

.autocomplete-result-name {
    font-weight: 500;
    color: #2c2c2c;
}

.autocomplete-result-source {
    font-size: 0.85rem;
    color: #666;
    margin-left: 0.5rem;
}

.loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    color: #1f4788;
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 500;
    background: #f0f7ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #1f4788;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Selected Temperament Display */
.temp-display {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.temp-info {
    flex: 1;
    min-width: 200px;
}

.temp-name {
    font-size: 1.3rem;
    color: #1f4788;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.temp-thumb {
    margin-top: 1rem;
}

.thumb-img {
    max-width: 180px;
    height: auto;
    border: 1px solid #e1e5ea;
    border-radius: 4px;
}

/* Pattern Panel */
.pattern-panel {
    flex: 1;
    min-width: 300px;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #e1e5ea;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: #2c2c2c;
}

.pattern-content {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
}

.pattern-item {
    color: #333;
}

.wolf-badge {
    display: inline-block;
    background: #ffe6e6;
    color: #cc0000;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Results Table */
.results-controls {
    margin-bottom: 1rem;
    font-family: 'Source Sans Pro', sans-serif;
}

.results-controls select {
    padding: 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.95rem;
}

.results-table th {
    background: #f8f9fa;
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #2c2c2c;
    border-bottom: 2px solid #dee2e6;
}

.results-table th:first-child {
    width: 120px;
    text-align: center;
}

.results-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

.results-table th.sortable:hover {
    background: #e9ecef;
}

.results-table th.sortable::after {
    content: ' ↕';
    position: absolute;
    right: 0.5rem;
    opacity: 0.5;
    font-size: 0.8rem;
}

.results-table th.sortable.sort-asc::after {
    content: ' ↑';
    opacity: 1;
    color: #1f4788;
}

.results-table th.sortable.sort-desc::after {
    content: ' ↓';
    opacity: 1;
    color: #1f4788;
}

.results-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #eceff3;
}

.results-table td:first-child {
    text-align: center;
    padding: 0.5rem;
}

.results-table .preview-img {
    width: 120px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #e1e5ea;
    border-radius: 4px;
    background: #fff;
    display: block;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.results-table .preview-img:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.results-table .preview-link {
    display: inline-block;
    text-decoration: none;
}

.results-table tr:hover {
    background: #f8f9fa;
}

.results-table tr.pattern-match {
    background: #e6f5ec;
}

.results-table tr.pattern-match:hover {
    background: #d4edda;
}

.results-table a {
    color: #1f4788;
    text-decoration: none;
    font-weight: 500;
}

.results-table a:hover {
    text-decoration: underline;
}

.metric-cell {
    font-family: 'Courier New', monospace;
    text-align: right;
    color: #495057;
}

.pattern-badge {
    display: inline-block;
    background: #1f4788;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
}

.explanation-cell {
    max-width: 400px;
    font-size: 0.9rem;
    color: #495057;
}

.explanation-text {
    cursor: help;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .temp-display {
        flex-direction: column;
    }
    
    .results-table {
        font-size: 0.85rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.5rem 0.25rem;
    }
}

