* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4c63d2 0%, #7c3aed 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
    line-height: 1.6;
}

.search-section {
    padding: 40px;
    background: #f8fafc;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.search-input {
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.1em;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #4c63d2;
    box-shadow: 0 0 0 3px rgba(76, 99, 210, 0.1);
}

.search-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #4c63d2 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 200px;
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(76, 99, 210, 0.3);
}

.search-btn.secondary {
    background: #059669;
}

.search-btn.secondary:hover:not(:disabled) {
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
}

.search-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.priority-info {
    background: #e0e7ff;
    border-left: 4px solid #4c63d2;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.priority-info h3 {
    color: #4c63d2;
    margin-bottom: 10px;
}

.priority-info ol {
    margin-left: 20px;
    color: #475569;
}

.priority-info li {
    margin-bottom: 5px;
}

.results-section {
    padding: 0 40px 40px;
}

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

.results-count {
    background: #4c63d2;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.keyword-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.keyword-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.keyword-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.keyword-card.selected {
    border-color: #059669;
    box-shadow: 0 15px 40px rgba(5, 150, 105, 0.3);
}

.keyword-source {
    position: absolute;
    top: -8px;
    right: 15px;
    background: #4c63d2;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.keyword-source.termdat { background: #059669; }
.keyword-source.gemet { background: #dc2626; }
.keyword-source.wikidata { background: #7c3aed; }
.keyword-source.literal { background: #64748b; }

.keyword-label {
    font-size: 1.3em;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    padding-top: 10px;
}

.keyword-description {
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 15px;
}

.keyword-uri {
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9em;
    color: #475569;
    word-break: break-all;
}

.keyword-uri a {
    color: #4c63d2;
    text-decoration: none;
}

.keyword-uri a:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #4c63d2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fee2e2;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.download-btn {
    padding: 15px 30px;
    background: #059669;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
}

.language-indicators {
    display: flex;
    gap: 5px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.lang-tag {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .keyword-grid {
        grid-template-columns: 1fr;
    }
}
