/* ======================== */
/* 1. GRUNDLEGENDES NEWS STYLING */
/* ======================== */

.news-container {
    padding: 1rem;
}

.news-card {
    background: #2c3034;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid #09a8fd;
}

/* Header-Styling (Autor und Datum) */
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.news-date {
    text-align: right;
}

.news-author {
    display: flex;
    align-items: center;
}

.news-author a {
    color: #09a8fd;
    text-decoration: none;
    transition: all 0.2s;
}

.news-author a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Titel und Inhalt */
.news-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: #f8f9fa;
}

.news-content {
    color: #adb5bd;
    font-size: 0.95rem;
}

/* News-Inhalte (Auszug und voller Text) */
.news-excerpt {
    line-height: 1.5;
    display: block;
}

.news-full {
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

/* ======================== */
/* 2. TOGGLE-FUNKTIONALITÄT */
/* ======================== */

.news-toggle {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    height: 31px;
}

.news-toggle.expanded {
    background-color: rgba(9, 168, 253, 0.2);
}

.news-toggle i {
    transition: transform 0.3s ease;
    display: inline-block;
}

/* ======================== */
/* 3. INTERAKTIONS-ELEMENTE */
/* ======================== */

/* Aktionszeile für Buttons */
.news-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.news-toggle-wrapper {
    flex: 0 0 auto;
}

.news-interactions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
    margin-top: 0;
}

/* Reaktions-Button (Like) */
.btn-reaction {
    background-color: rgba(9, 168, 253, 0.1);
    color: #adb5bd;
    border: 1px solid rgba(9, 168, 253, 0.2);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    height: 31px;
}

.btn-reaction:hover:not(.disabled) {
    background-color: rgba(9, 168, 253, 0.2);
    color: #f8f9fa;
    border-color: rgba(9, 168, 253, 0.4);
}

.btn-reaction.active {
    background-color: rgba(9, 168, 253, 0.25);
    color: #09a8fd;
    border-color: rgba(9, 168, 253, 0.5);
}

.btn-reaction.active:hover {
    background-color: rgba(9, 168, 253, 0.35);
}

.btn-reaction i {
    font-size: 1.1rem;
    margin-right: 5px;
    transition: transform 0.2s ease;
}

.btn-reaction:hover:not(.disabled) i {
    transform: scale(1.15);
}

.btn-reaction.active i {
    color: #09a8fd;
}

.reaction-count {
    font-weight: 500;
    transition: color 0.2s ease;
}

.btn-reaction.active .reaction-count {
    color: #09a8fd;
}

/* Animation für Like-Button */
@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.btn-reaction.animate i {
    animation: likeAnimation 0.4s ease;
}

/* Kommentar-Button */
.show-comments-btn {
    background-color: rgba(248, 249, 250, 0.1);
    color: #adb5bd;
    border: 1px solid rgba(248, 249, 250, 0.2);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    height: 31px;
    padding: 0.25rem 0.75rem;
}

.show-comments-btn:hover {
    background-color: rgba(248, 249, 250, 0.15);
    color: #f8f9fa;
    border-color: rgba(248, 249, 250, 0.25);
}

.show-comments-btn i {
    margin-right: 5px;
}

/* Disabled-Style für Gäste */
.news-interactions .btn-outline-secondary[data-action="react"] {
    background-color: rgba(9, 168, 253, 0.05);
    border: 1px solid rgba(9, 168, 253, 0.15);
    color: #adb5bd;
    height: 31px;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
}

.news-interactions .btn-outline-secondary[data-action="react"] i {
    font-size: 1.1rem;
    margin-right: 5px;
}

.news-interactions .btn-outline-secondary[data-action="react"] .reaction-count {
    font-weight: 500;
}

/* ======================== */
/* 4. KOMMENTAR-BEREICH */
/* ======================== */

.news-comments-section {
    background-color: rgba(33, 37, 41, 0.5);
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

/* ======================== */
/* 5. KOMMENTAR STYLING */
/* ======================== */

/* Basis-Kommentar */
.comment-item {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid #09a8fd;
    background-color: rgba(9, 168, 253, 0.05);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-item:hover {
    background-color: rgba(9, 168, 253, 0.1);
}

.comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Ausgeblendeter Kommentar */
.comment-item.hidden-comment {
    opacity: 0.65;
    border-left: 3px solid #ffc107;
    background-color: rgba(255, 193, 7, 0.05);
    padding-left: 8px;
}

.comment-item.hidden-comment:hover {
    background-color: rgba(255, 193, 7, 0.1);
}

.hidden-comment-notice {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    padding: 4px 8px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Kommentar-Header mit Benutzerinfo */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-user {
    display: flex;
    align-items: center;
}

.comment-user-info {
    display: flex;
    align-items: flex-start;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-user-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 10px;
}

.comment-username {
    font-weight: 600;
    color: #f8f9fa;
    text-decoration: none;
    line-height: 1.2;
    font-size: 1.05rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Kommentar-Inhalt */
.comment-content {
    color: #adb5bd;
    font-size: 0.9rem;
    line-height: 1.4;
    padding-top: 5px;
    padding-bottom: 5px;
}

.comment-edited-indicator {
    display: block;
    margin-left: 5px;
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
}

.comment-edited-indicator i {
    margin-right: 2px;
}

/* Kommentar-Aktionsbuttons */
.comment-actions {
    font-size: 0.8rem;
}

.comment-actions button {
    background: none;
    border: none;
    padding: 3px 8px;
    color: #6c757d;
    cursor: pointer;
    background-color: rgba(33, 37, 41, 0.3);
    border-radius: 4px;
    margin-left: 5px;
}

.comment-actions button:hover {
    color: #f8f9fa;
    background-color: rgba(33, 37, 41, 0.5);
}

/* ======================== */
/* 6. KOMMENTARE BEARBEITEN */
/* ======================== */

.comment-edit-form {
    background: rgba(33, 37, 41, 0.5);
    padding: 10px;
    border-radius: 4px;
    margin-top: 8px;
}

.edit-comment-input {
    background-color: #2c3034;
    border-color: #495057;
    color: #f8f9fa;
    font-size: 0.9rem;
}

.edit-comment-input:focus {
    background-color: #2c3034;
    border-color: rgba(9, 168, 253, 0.5);
    color: #f8f9fa;
    box-shadow: 0 0 0 0.2rem rgba(9, 168, 253, 0.25);
}

.save-edit-btn, .cancel-edit-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* ======================== */
/* 7. KOMMENTARFORMULAR */
/* ======================== */

.comment-form .form-control {
    background-color: #2c3034;
    border-color: #495057;
    color: #f8f9fa;
}

.character-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #6c757d;
    padding: 2px 5px;
    margin-top: 0;
    margin-bottom: 10px;
    transition: color 0.3s;
    visibility: hidden;
}

.character-counter.counter-warning {
    color: #ffc107;
}

.character-counter.counter-exceeded {
    color: #dc3545;
    font-weight: bold;
}

.input-group {
    display: block;
}

.input-group textarea.form-control {
    width: 100%;
    min-height: 80px;
    margin-bottom: 10px;
}

.input-group-append {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-top: 0;
}

/* ======================== */
/* 8. REAKTIONS-POPUP */
/* ======================== */

.reaction-tooltip {
    position: absolute;
    z-index: 1000;
    background-color: #343a40;
    border: 1px solid #495057;
    border-radius: 4px;
    padding: 10px;
    max-width: 250px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.reaction-tooltip:before {
    content: '';
    position: absolute;
    top: -8px;
    left: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #495057;
}

.reaction-tooltip:after {
    content: '';
    position: absolute;
    top: -7px;
    left: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #343a40;
}

.reaction-tooltip-content {
    color: #f8f9fa;
}

.reaction-users {
    max-height: 150px;
    overflow-y: auto;
}

.reaction-user {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.reaction-user:last-child {
    border-bottom: none;
}

.reaction-more {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: #adb5bd;
    font-size: 0.9em;
    text-align: center;
}

/* Reaktionen Tooltip Links und Modal */
.reaction-tooltip a {
    color: #09a8fd;
    text-decoration: none;
}

.reaction-tooltip a:hover {
    text-decoration: underline;
}

.reaction-more-link {
    cursor: pointer;
    color: #09a8fd;
    margin-top: 5px;
}

.reaction-more-link:hover {
    text-decoration: underline;
}

/* Reaktionen Modal */
.reaction-users-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px; /* Platz für Scrollbalken */
}

/* Angepasstes Scrollbar-Styling für Dark Mode */
.reaction-users-list::-webkit-scrollbar {
    width: 8px;
    background-color: #343a40;
    border-radius: 4px;
}

.reaction-users-list::-webkit-scrollbar-thumb {
    background-color: rgba(9, 168, 253, 0.5);
    border-radius: 4px;
}

.reaction-users-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(9, 168, 253, 0.7);
}

/* Firefox Scrollbar */
.reaction-users-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(9, 168, 253, 0.5) #343a40;
}

/* Verbesserte Darstellung der Benutzerelemente */
.reaction-user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background-color 0.2s ease;
}

.reaction-user-item:hover {
    background-color: rgba(9, 168, 253, 0.1);
}

.reaction-user-item:last-child {
    border-bottom: none;
}

/* Verbesserte Avatar-Darstellung */
.reaction-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    overflow: hidden;
    border: 2px solid rgba(9, 168, 253, 0.3);
    background-color: #212529;
    flex-shrink: 0;
}

.reaction-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reaction-user-info {
    flex-grow: 1;
    min-width: 0; /* Vermeidet Überlaufen bei langen Namen */
}

.reaction-user-name {
    font-weight: 600;
    color: #f8f9fa;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reaction-user-name a {
    color: #09a8fd;
    text-decoration: none;
    transition: color 0.2s ease;
}

.reaction-user-name a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.reaction-user-date {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Modal styling improvements */
.modal-dialog {
    margin: 1.75rem auto;
}

.modal-content {
    border: 1px solid rgba(9, 168, 253, 0.2);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-header .close {
    opacity: 0.8;
    text-shadow: none;
    transition: all 0.2s ease;
}

.modal-header .close:hover {
    opacity: 1;
}

/* ======================== */
/* 9. RESPONSIVE ANPASSUNGEN */
/* ======================== */

@media (max-width: 576px) {
    /* News-Karten */
    .news-actions-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-interactions {
        margin-top: 0.75rem;
        width: 100%;
    }
    
    .news-interactions button {
        flex: 1;
    }
    
    .news-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-date {
        text-align: left;
        margin-top: 4px;
    }
    
    /* Kommentare */
    .comment-header {
        flex-direction: column;
    }
    
    .comment-actions {
        margin-top: 10px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 8px;
        width: 100%;
    }
    
    .comment-actions button {
        padding: 6px 10px;
        background-color: rgba(33, 37, 41, 0.5);
        border-radius: 4px;
        font-size: 0.8rem;
        min-width: auto;
        flex: 1;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .comment-actions button i {
        margin-right: 4px;
    }
    
    .comment-input {
        font-size: 16px; /* Verhindert iOS-Zoom bei Fokus */
    }
    
    .comment-edit-form .btn {
        padding: 8px 12px;
        min-height: 38px;
    }
    
    .comment-avatar {
        width: 32px;
        height: 32px;
    }
    
    .comment-content {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-top: 10px;
    }
    
    .edit-comment-input {
        min-height: 80px;
    }
}