/* Similar MicroSims Styles */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
    color: #333;
}

.header {
    max-width: 1200px;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    color: #2c3e50;
    margin: 0;
}

h2 {
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.back-link {
    background: #3498db;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.2s;
}

.back-link:hover {
    background: #2980b9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Source Section */
.source-section {
    margin-bottom: 40px;
}

.source-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.source-card h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
}

.source-card h3 a {
    color: white;
    text-decoration: none;
}

.source-card h3 a:hover {
    text-decoration: underline;
}

.source-card .description {
    font-size: 15px;
    opacity: 0.95;
    margin-bottom: 15px;
    line-height: 1.6;
}

.source-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.source-card .tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
}

.source-card .meta {
    font-size: 13px;
    opacity: 0.85;
}

.loading {
    text-align: center;
    padding: 20px;
    font-size: 16px;
}

/* Results Section */
.results-section {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-count {
    font-size: 14px;
    color: #7f8c8d;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Result Cards */
.result-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.result-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    padding-right: 70px;
}

.result-card h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.result-card h3 a:hover {
    color: #3498db;
}

.result-card .description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.result-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag {
    background: #e8f4fd;
    color: #3498db;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
}

.tag.level {
    background: #e8f8f5;
    color: #1abc9c;
}

.tag.bloom {
    background: #fef5e7;
    color: #f39c12;
}

.tag.library {
    background: #f4ecf7;
    color: #9b59b6;
}

.tag.difficulty {
    background: #fdecea;
    color: #e74c3c;
}

.result-card .meta {
    font-size: 12px;
    color: #95a5a6;
}

/* Similarity Score Badge */
.similarity-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.result-card .similar-link {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background: #ecf0f1;
    color: #3498db;
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}

.result-card .similar-link:hover {
    background: #3498db;
    color: white;
}

/* Error State */
.error {
    background: #fdecea;
    color: #e74c3c;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.error h2 {
    color: #e74c3c;
    margin-bottom: 10px;
}

/* No results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.no-results h2 {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}
