* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 20px;
    color: #2c3e50;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 400;
}

.search-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

#searchInput {
    flex: 1;
    padding: 16px 20px;
    font-size: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    transition: all 0.2s;
    background: #f8f9fa;
}

#searchInput:focus {
    outline: none;
    border-color: #4a90e2;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

#searchButton {
    padding: 16px 40px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

#searchButton:hover {
    background: #357abd;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}

#searchButton:active {
    transform: scale(0.98);
}

#searchButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

.filter-group select {
    padding: 12px 14px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-group select:focus {
    outline: none;
    border-color: #4a90e2;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

#clearFilters {
    padding: 12px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    color: #495057;
    font-weight: 500;
}

#clearFilters:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 28px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e9ecef;
}

#resultsCount {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

#resultsTime {
    font-size: 0.9rem;
    color: #6c757d;
}

.org-summary {
    background: white;
    padding: 20px 28px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e9ecef;
}

.org-summary h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.org-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.org-tag {
    padding: 8px 18px;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.org-tag:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.org-tag.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.opportunity-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e9ecef;
    transition: all 0.2s;
    cursor: pointer;
}

.opportunity-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #dee2e6;
}

.opportunity-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.opportunity-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.4;
}

.opportunity-org {
    display: inline-block;
    padding: 6px 14px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a90e2;
    border: 1px solid #e9ecef;
}

.similarity-score {
    padding: 6px 14px;
    background: #d4edda;
    color: #155724;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #c3e6cb;
}

.opportunity-description {
    color: #495057;
    line-height: 1.7;
    margin-bottom: 16px;
}

.opportunity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    color: #6c757d;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-icon {
    font-size: 1.1rem;
}

.opportunity-link {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 24px;
    background: #4a90e2;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.opportunity-link:hover {
    background: #357abd;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.page-btn {
    padding: 10px 18px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    color: #495057;
    font-weight: 500;
}

.page-btn:hover:not(:disabled) {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.empty-state, .error-state {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #e9ecef;
}

.empty-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h2, .error-state h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: #2c3e50;
    font-weight: 600;
}

.empty-state p, .error-state p {
    font-size: 1.05rem;
    color: #6c757d;
    margin-bottom: 30px;
    line-height: 1.6;
}

.example-searches {
    margin-top: 32px;
}

.example-searches p {
    font-size: 0.95rem;
    margin-bottom: 16px;
    color: #495057;
    font-weight: 500;
}

.example-btn {
    margin: 6px;
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: #495057;
    font-weight: 500;
}

.example-btn:hover {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

footer {
    text-align: center;
    color: #6c757d;
    margin-top: 40px;
    padding: 20px;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .opportunity-header {
        flex-direction: column;
        gap: 10px;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: 20px;
    font-size: 16px;
    color: #6c757d;
    font-weight: 500;
}
