/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    min-height: calc(100vh - 40px);
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header h1 i {
    color: #3498db;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

/* Search container */
.search-container {
    margin-bottom: 40px;
}

.search-box {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #eaeaea;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.input-group input {
    flex: 1;
    min-width: 200px;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.input-group select {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    min-width: 180px;
    cursor: pointer;
}

.input-group select:focus {
    outline: none;
    border-color: #3498db;
}

.input-group button {
    padding: 14px 30px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s;
}

.input-group button:hover {
    background-color: #2980b9;
}

.input-group button:active {
    transform: translateY(1px);
}

.search-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7f8c8d;
    font-size: 0.9rem;
    padding-top: 10px;
    border-top: 1px solid #eaeaea;
}

.search-hint i {
    color: #f39c12;
}

/* Results container */
.results-container {
    margin-bottom: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaeaea;
}

.results-header h2 {
    font-size: 1.8rem;
    color: #2c3e50;
}

.results-count {
    background-color: #3498db;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.results-table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eaeaea;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.empty-state i {
    margin-bottom: 20px;
    color: #bdc3c7;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Term card styles */
.term-card {
    padding: 25px;
    border-bottom: 1px solid #eaeaea;
    transition: background-color 0.2s;
    position: relative;
}

.term-card:last-child {
    border-bottom: none;
}

.term-card:hover {
    background-color: #f9f9f9;
}

.term-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.term-language {
    background-color: #2ecc71;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.term-description {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.term-content {
    margin-bottom: 15px;
}

.term-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.term-definition {
    color: #34495e;
    line-height: 1.7;
    margin-bottom: 15px;
}

.term-metadata {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.metadata-item i {
    color: #3498db;
}

.metadata-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    background-color: #ecf0f1;
    color: #34495e;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.tag.unwort {
    background-color: #fff3cd;
    color: #856404;
}

.tag.kategorie {
    background-color: #d4edda;
    color: #155724;
}

/* Loading animation */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    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); }
}

/* Match type label (replaces indicator) */
.match-type-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.match-type-label.term {
    background-color: #2ecc71; /* Green - term match (highest priority) */
}

.match-type-label.unwort {
    background-color: #f39c12; /* Orange - unwort match (medium priority) */
}

.match-type-label.definition {
    background-color: #e74c3c; /* Red - definition match (lowest priority) */
}

/* Footer */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
    color: #7f8c8d;
    font-size: 0.9rem;
}

footer span {
    font-weight: 600;
    color: #2c3e50;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 30px;
    background-color: #3498db;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-description {
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.modal-description h4 {
    margin: 0 0 8px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.modal-description code {
    font-size: 1.1rem;
    color: #2c3e50;
    word-break: break-all;
}

.translations-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.translation-item {
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.translation-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.translation-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eaeaea;
}

.translation-language {
    background-color: #2ecc71;
    color: white;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.translation-content {
    padding: 20px;
}

.translation-term {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.translation-definition {
    color: #34495e;
    line-height: 1.6;
    margin-bottom: 15px;
}

.translation-unworte {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.translation-unworte .tag {
    background-color: #fff3cd;
    color: #856404;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.no-translations {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
}

.no-translations i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #bdc3c7;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group input,
    .input-group select,
    .input-group button {
        width: 100%;
    }
    
    .term-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .term-metadata {
        flex-direction: column;
        gap: 10px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .translation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
