.friends-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 20px;
    border-radius: 12px;
    z-index: 1000;
    width: 450px;
    max-width: 90vw;
    min-width: 320px;
    animation: fadeIn 0.3s ease-in-out;
    box-sizing: border-box;
    touch-action: manipulation;
}

/* Find-Friends Modal (Basis) */
.find-friends-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    width: 520px;
    max-width: 95vw;
    max-height: 85vh;
    overflow: auto;
    z-index: 10010;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Spinner Animation für Ladevorgang */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.friends-header h3 {
    margin: 0;
    font-size: 1em; /* Normale Schriftgröße für die Überschriften */
    color: #333;
}

.friends-header .close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.friends-header .close:hover,
.friends-header .close:focus {
    color: #333;
    text-decoration: none;
}

.friends-body {
    margin-top: 20px;
}

.friends-body ul {
    list-style: none;
    padding: 0;
}

.friends-body li {
    margin-bottom: 15px;
}

.friends-body .btn {
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.friends-body .btn:hover {
    background-color: #0056b3;
}

.friends-body .btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.friends-body h3 {
    font-size: 1em; /* Normale Schriftgröße für die Überschriften */
}

/* Überschriften der Freundesliste farbig unterscheiden */
#friends-list h3:nth-of-type(1) {
    color: #007bff; /* Blau für offene Anfragen */
    border-left: 4px solid #007bff;
    padding-left: 8px;
    background: #eaf4ff;
    border-radius: 4px;
}
#friends-list h3:nth-of-type(2) {
    color: #ff9800; /* Orange für gesendete Anfragen */
    border-left: 4px solid #ff9800;
    padding-left: 8px;
    background: #fff6e5;
    border-radius: 4px;
}
#friends-list h3:nth-of-type(3) {
    color: #27ae60; /* Grün für Freunde */
    border-left: 4px solid #27ae60;
    padding-left: 8px;
    background: #eafaf1;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .friends-container {
        width: 98vw !important;
        max-width: 100vw !important;
        min-width: unset !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        border-radius: 8px !important;
        font-size: 15px;
        box-sizing: border-box;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    .find-friends-modal {
        width: 98vw !important;
        max-width: 100vw !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-height: 90vh !important;
        border-radius: 8px !important;
        overflow: auto !important;
        box-sizing: border-box !important;
    }

    .friends-header {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 6px;
    }

    .friends-header h3 {
        font-size: 1.1em;
    }

    .friends-header .close {
        font-size: 28px;
        margin-top: 8px;
    }

    .friends-body {
        margin-top: 10px;
    }

    .friends-body .btn {
        font-size: 1em;
        padding: 14px 10px;
        border-radius: 6px;
    }
}

/* Zentrierung für das Freunde-Popup immer erzwingen */
.friends-container {
    margin: 0 !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.friend-messagebox {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 32px rgba(0,0,0,0.18);
    padding: 0;
    min-width: 350px;
    min-height: 420px;
    color: #222;
    font-family: 'Segoe UI', Arial, sans-serif;
    opacity: 1;
    transition: box-shadow 0.2s;
    border: 1px solid #e0e0e0;
}
.fmb-header {
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    padding: 14px 18px;
    font-weight: bold;
    font-size: 1.1em;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fmb-title {
    color: #333;
}
.fmb-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}
.fmb-close:hover {
    color: #d32f2f;
}
.fmb-body {
    padding: 16px;
    max-height: 260px;
    overflow-y: auto;
    background: #fafafa;
}
.fmb-footer {
    padding: 14px 18px;
    border-top: 1px solid #eee;
    background: #f5f5f5;
    border-radius: 0 0 10px 10px;
    display: flex;
    gap: 8px;
}
.fmb-input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1em;
}
.fmb-send {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.fmb-send:hover {
    background: #0056b3;
}
.fmb-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fmb-msg {
    margin-bottom: 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: #e9e9e9;
    max-width: 80%;
    word-break: break-word;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.fmb-msg.own {
    background: #d1e7dd;
    margin-left: auto;
    text-align: right;
}
.fmb-msg.new {
    border: 2px solid #4caf50;
}
.fmb-msg-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fmb-msg-name {
    font-weight: bold;
    color: #007bff;
}
.fmb-msg-date {
    font-size: 0.85em;
    color: #999;
}
.fmb-msg-new {
    background: #4caf50;
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8em;
    margin-left: 8px;
}
