* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

/* Sprachumschalter */
.language-switcher {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.lang-btn {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    opacity: 0.45;
}

.lang-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lang-btn.active {
    opacity: 1;
}

.lang-btn:focus {
    outline: none;
}

.flag {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url('https://safer-nightlife.berlin/wp-content/plugins/weglot/dist/images/circular_flag.png');
    background-size: auto 24px;
    background-repeat: no-repeat;
    border-radius: 50%;
}

.flag-de {
    background-position: -1488px 0;
}

.flag-en {
    background-position: -2520px 0;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0;
    font-weight: 700;
}

.by-text {
    color: #95a5a6;
    font-size: 0.85rem;
    font-weight: 300;
    font-style: italic;
    margin: 5px 0 0 0;
    letter-spacing: 0.5px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1rem;
    margin-top: 0;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.header-logo {
    height: 80px;
    width: auto;
    opacity: 0.9;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.header-logo:hover {
    opacity: 1;
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
}

@media (max-width: 480px) {
    .header-logo {
        height: 60px;
    }
}

.form-container {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 30px;
}

.autocomplete-wrapper {
    flex: 1;
    position: relative;
}

.autocomplete-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.substance-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    color: #333;
    transition: all 0.3s ease;
}

.substance-input:hover {
    border-color: #667eea;
}

.substance-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: -10px;
}

.suggestions-list.hidden {
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item.active {
    background: #667eea;
    color: white;
}

.suggestion-main-name {
    font-weight: 600;
    color: #2c3e50;
}

.suggestion-item.active .suggestion-main-name {
    color: white;
}

.suggestion-alias {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.suggestion-item.active .suggestion-alias {
    color: rgba(255, 255, 255, 0.9);
}

.no-suggestions {
    padding: 12px 16px;
    color: #7f8c8d;
    font-size: 0.9rem;
    text-align: center;
}

.combination-symbol {
    font-size: 1.8rem;
    color: #7f8c8d;
    font-weight: 300;
    padding-bottom: 14px;
}

.info-box {
    background: #f8f9fa;
    border-radius: 14px;
    padding: 25px;
    margin-top: 20px;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-box.hidden {
    display: none;
}

.badges-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.risk-level,
.interaction-badge {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.badge-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-description {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: 0;
}

.risk-low {
    background: #e9ecef;
    color: #495057;
}

.risk-unsafe {
    background: #fff4e6;
    color: #e65100;
}

.risk-caution {
    background: #fff3cd;
    color: #856404;
}

.risk-deadly {
    background: #ffcdd2;
    color: #b71c1c;
}

.interaction-synergistic {
    background: #d4edfc;
    color: #0277bd;
}

.interaction-counteracting {
    background: #dfe6e9;
    color: #2d3436;
}

.interaction-neutral {
    background: #e3f2fd;
    color: #1565c0;
}

.interaction-complex {
    background: #e1d5e7;
    color: #6a1b9a;
}

.combination-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.title-substance {
    flex: 1;
    text-align: center;
}

.title-separator {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: 400;
}

.info-content {
    color: #555;
    line-height: 1.7;
}

.combination-description {
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

/* Wissenschaftliche Quellen */
.sources-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.sources-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-citation {
    font-size: 0.7rem;
    line-height: 1.5;
    color: #333;
    margin-bottom: 6px;
    font-family: 'Courier New', monospace;
}

.source-citation a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.source-citation a:hover {
    text-decoration: underline;
}

.source-citation em {
    font-style: italic;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.footer-disclaimer {
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.8rem;
}

.footer-separator {
    color: #bdc3c7;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile Optimierung */
@media (max-width: 600px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 2rem;
    }

    .form-container {
        flex-direction: column;
        gap: 15px;
    }

    .combination-symbol {
        align-self: center;
        padding: 0;
        transform: rotate(0deg);
    }

    .autocomplete-wrapper {
        width: 100%;
    }
    
    .suggestions-list {
        max-height: 200px;
    }
    
    .badges-container {
        flex-direction: column;
        gap: 10px;
    }

    .combination-title {
        font-size: 1.3rem;
        gap: 10px;
        flex-wrap: wrap;
    }

    .title-substance {
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .title-separator {
        font-size: 1.2rem;
    }
}
