/* Reset & Basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body.bg-image-body {
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    background: linear-gradient(rgba(10, 10, 25, 0.88), rgba(10, 10, 25, 0.88)), 
                url('../Bilder & Videos/Hauptseite.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* Navbar Fixes */
.navbar {
    background-color: #12131c;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-btn {
    width: 28px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001;
}

.menu-btn .bar {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-btn.open .bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-btn.open .bar:nth-child(2) { opacity: 0; }
.menu-btn.open .bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.logo { 
    height: 36px; 
    width: auto; 
    cursor: pointer; 
}

.nav-center { 
    flex-grow: 1; 
    max-width: 450px; 
    margin: 0 20px; 
}

.search-input { 
    width: 100%; 
    padding: 9px 18px; 
    border-radius: 20px; 
    border: 1px solid rgba(99, 102, 241, 0.3); 
    outline: none; 
    background-color: #1a1b29; 
    color: white;
    font-size: 0.9rem;
}

.search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-link, .profile-icon { display: flex; align-items: center; cursor: pointer; }


/* Hauptbereich */
.page-content {
    flex: 1;
    padding-top: 90px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

.main-title {
    font-size: 2.3rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

/* Top-Controls */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 18px;
    background-color: #1a1b29;
    color: white;
    border: 1px solid #312e81;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
    background-color: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.action-buttons-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Sperre-Symbol entfernt -> jetzt aktiv mit Cursor Pointer */
.create-btn, .create-event-btn {
    padding: 8px 16px;
    background-color: #6366f1;
    color: #ffffff;
    border: 1px solid #4338ca;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.create-btn:hover, .create-event-btn:hover {
    background-color: #4f46e5;
}

/* Event Kasten */
.events-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.empty-events {
    text-align: center;
    font-size: 1.1rem;
    color: #a5b4fc;
    margin-top: 40px;
    background: rgba(20, 20, 35, 0.6);
    padding: 30px;
    border-radius: 12px;
    border: 1px dashed rgba(99, 102, 241, 0.3);
}

.event-box {
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.95), rgba(30, 27, 75, 0.9));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease;
    width: 100%;
}

.event-box:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 85, 247, 0.5);
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.organizer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.organizer-name {
    font-weight: bold;
    font-size: 1.05rem;
    color: #fff;
}

.verified-badge {
    color: #818cf8;
}

.countdown-banner {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #c7d2fe;
    flex-wrap: wrap;
    gap: 5px;
}

.countdown-timer {
    color: #a855f7;
    font-family: monospace;
    font-size: 1.05rem;
}

.event-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.event-tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.tag-turnier { background-color: #ef4444; color: white; }
.tag-community { background-color: #8b5cf6; color: white; }
.tag-stream { background-color: #06b6d4; color: white; }
.tag-special { background-color: #f59e0b; color: white; }

.event-date {
    font-size: 0.85rem;
    color: #cbd5e1;
}

.event-title {
    font-size: 1.3rem;
    color: #f8fafc;
}

.event-text-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e2e8f0;
    white-space: pre-line;
    word-break: break-word;
}

/* Event-Interaktionen und Kommentare */
.event-actions, .news-actions {
    display: flex;
    gap: 12px;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.badge {
    background: #312e81;
    color: #e0e7ff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.event-box .add-comment-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.event-box .comment-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #555;
    color: #fff;
    padding: 8px 0;
    font-size: 14px;
    outline: none;
}

.event-box .comment-input:focus {
    border-bottom-color: #fff;
}

.event-box .comment-submit-btn {
    background-color: #38bdf8;
    color: #0f172a;
    border: none;
    padding: 8px 16px;
    border-radius: 18px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 5px;
}

.event-box .comments-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.event-box .comments-header {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #fff;
}

.event-box .comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 12px;
}

.event-box .comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #4f46e5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

footer {
    width: 100%;
    text-align: center;
    padding: 15px;
    font-size: 12px;
    color: #aaa;
    background-color: #12131c;
    margin-top: auto;
}

/* =========================================
   Responsive Anpassungen für Handys (@media)
   ========================================= */
@media (max-width: 768px) {
    .navbar {
        padding: 0 10px;
    }

    .nav-center {
        display: flex !important;
        flex: 1;
        max-width: 140px;
        margin: 0 8px;
    }

    .search-input {
        padding: 7px 12px;
        font-size: 0.8rem;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .top-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 95%;
    }

    .filter-container {
        justify-content: center;
        width: 100%;
    }

    .action-buttons-group {
        justify-content: center;
        width: 100%;
    }

    .events-container {
        width: 95%;
    }

    .event-box {
        padding: 15px;
    }

    .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .countdown-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .event-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .event-title {
        font-size: 1.15rem;
    }

    .event-actions {
        gap: 8px;
    }

    .action-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

/* Mobiles Layout für Smartphones unter 768px */
@media (max-width: 768px) {
    /* Boxen anpassen */
    .event-box, .news-box {
        padding: 10px !important;
        margin: 8px 4px !important;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Haupt-Aktionsleiste oben */
    .news-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .news-actions button, 
    .news-actions .action-btn {
        width: 100% !important;
        box-sizing: border-box;
        justify-content: center !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
        margin: 0 !important;
    }

    /* KOMMENTAR- UND ANTWORT-AKTIONEN: Sauber aufteilen statt abschneiden */
    .comment-actions, 
    .reply-item .comment-actions {
        display: flex !important;
        flex-wrap: wrap !important; /* Erlaubt das Umbrechen in die nächste Zeile */
        gap: 6px 12px !important;   /* Abstand zwischen den Buttons */
        align-items: center !important;
        width: 100% !important;
        overflow-x: visible !important;
    }

    /* Buttons kompakten, aber gut lesbaren Look geben */
    .comment-actions button,
    .reply-item button {
        font-size: 12px !important;
        padding: 4px 6px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 4px !important;
    }

    /* Eingabefelder für Antworten/Bearbeiten volle Breite */
    .comment-input, 
    .edit-box input, 
    .reply-box input, 
    .edit-reply-box input,
    .reply-to-reply-box input {
        width: 100% !important;
        box-sizing: border-box;
        margin-bottom: 6px;
    }

    .edit-box button, 
    .reply-box button, 
    .edit-reply-box button,
    .reply-to-reply-box button {
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    /* Die Haupt-Aktionsleiste als Flex-Container mit Spaltenumbruch */
    .comment-actions, 
    .reply-item .comment-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
    }

    /* Einheitliche Basis für alle Aktions-Buttons in Kommentaren/Antworten */
    .comment-actions button,
    .reply-item button {
        font-size: 12px !important;
        padding: 4px 8px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 4px !important;
    }

    /* 
      TRICK: Wir zwingen die Bearbeiten- und Löschen-Buttons 
      dazu, in eine neue Zeile zu springen (volle Breite oder Gruppe) 
    */
    .comment-actions .c-edit-btn,
    .comment-actions .c-delete-btn,
    .comment-actions .r-edit-btn,
    .comment-actions .r-submit-edit-btn {
        /* Falls du sie in einer eigenen Zeile haben willst: */
    }
}