/* ------------------------------------------
   HR
------------------------------------------ */
hr {
    border: none;
    height: 1px;
    background-color: #e0e0e0;
    margin: 10px 0;
}

/* ------------------------------------------
   OVERLAY
------------------------------------------ */
.language-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(50, 50, 50, 0.4);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow-y: auto;
    pointer-events: auto;
    animation: fadeIn 0.5s ease-in-out;
}

/* ------------------------------------------
   MODAL
------------------------------------------ */
.language-modal {
    background-color: var(--bg-light);
    padding: 0 40px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.5s ease-in-out;
    width: 450px;
    max-width: 90%;
    max-height: 60vh;
    white-space: pre-wrap;
    font-family: Arial, sans-serif;
    color: #222;
    position: relative; /* wichtig für Close-Button */
    display: flex;
    flex-direction: column;
}

body.dark-mode .language-modal {
    background-color: var(--bg-dark, #333);
    color: var(--icon-dark, #eee);
    scrollbar-color: #555 transparent;
}

/* ------------------------------------------
   SCROLLBAR
------------------------------------------ */
.language-options.scrollable {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 20px;
    margin-right: -20px;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 transparent;
}

.language-options.scrollable::-webkit-scrollbar {
    width: 8px;
}

.language-options.scrollable::-webkit-scrollbar-thumb {
    background-color: #d0d0d0;
    border-radius: 4px;
}

.language-options.scrollable::-webkit-scrollbar-thumb:hover {
    background-color: #a0a0a0;
}

/* ------------------------------------------
   CLOSE BUTTON
------------------------------------------ */
.language-close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
    user-select: none;
    border-radius: 6px;
}

.language-close-button:hover {
    color: var(--button-filter-hover-light);
    outline: none;
}

body.dark-mode .language-close-button {
    color: var(--text-dark);
}

body.dark-mode .language-close-button:hover {
    color: var(--button-filter-hover-dark);
}


/* ------------------------------------------
   SPRACHOPTIONEN
------------------------------------------ */
.language-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.language-option {
    display: flex;
    align-items: center;  /* vertikal mittig */
    gap: 12px;
    padding: 10px 15px;
    border-radius: 15px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-light);
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;

    line-height: 1;       /* verhindert Textverschiebung */
}

.language-option .flag-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-option .language-text {
    display: flex;
    align-items: center;
}


body.dark-mode .language-option {
    border: 1px solid var(--border-dark);
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

.language-option:hover {
    background-color: var(--language-hover-light);
}

body.dark-mode .language-option:hover {
    background-color: var(--language-hover-dark);
}

.flag-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    object-fit: cover;
    box-shadow: 0 0 2px rgba(0,0,0,0.1);
}

body.dark-mode .flag-icon {
    border: 1px solid var(--border-dark);
}

/* ------------------------------------------
   ICONBUTTONS & TITEL (zentriert)
------------------------------------------ */
.language-options-icontitle,
.language-options-iconbutton {
    display: flex;
    align-items: center;
    justify-content: center; /* <-- mittig horizontal */
    gap: 8px;
    background: none;
    border: none;
    font-size: 16px;
    padding: 20px;
    margin-top: 10px;
    color: var(--icon-light);
    cursor: default;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; /* damit die Zentrierung über die volle Breite geht */
    flex-shrink: 0;
}

body.dark-mode .language-options-icontitle,
body.dark-mode .language-options-iconbutton {
    color: var(--icon-dark);
}

.language-options-icontitle h2 {
    font-size: 1.5rem;
    margin: 0;
}

/* Responsive Titelgrößen */
@media (max-width: 434px) {
    .language-options-icontitle h2 { font-size: 1.17rem; }
}

@media (max-width: 366px) {
    .language-options-icontitle h2 { font-size: 1rem; }
}



/* ------------------------------------------
   IPHONE 4 / 4S
------------------------------------------ */
@media (max-width: 360px) {
    .language-modal {
        max-height: 90vh; /* höher, fast gesamter Bildschirm */
    }

    .language-close-button {
        top: 10px;
        right: 15px;
        font-size: 26px;
    }

    .language-option {
        padding-left: 8px;
        font-size: 14px;
    }

    .flag-icon {
        width: 28px;
        height: 28px;
    }

    /* Titel anpassen für kleine Bildschirme */
    .language-options-icontitle,
    .language-options-iconbutton {
        padding: 10px 5px;
        font-size: 14px;
        gap: 5px;
    }

    .language-options-icontitle h2 {
        font-size: 1.1rem; /* kleiner, damit es passt */
        margin-top: 5px;
        margin-bottom: 5px;
    }
}


/* ------------------------------------------
   EINBLEND-ANIMATION
------------------------------------------ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
