/* ═══════════════════════════════════════════════
   SPACE EMPIRE — GUILD & CHAT SYSTEM CSS
   Optimiert für Dark-Sci-Fi UI
   ═══════════════════════════════════════════════ */

/* 1. CHAT CONTAINER */
#seg-guild-chat-container {
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    box-shadow: inset 0 0 20px rgba(0, 180, 255, 0.05);
}

/* 2. NACHRICHTEN-FENSTER */
#seg-guild-chat-messages {
    height: 350px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--clr-primary) transparent;
}

/* Scrollbar für Chrome/Safari */
#seg-guild-chat-messages::-webkit-scrollbar { width: 4px; }
#seg-guild-chat-messages::-webkit-scrollbar-thumb { background: var(--clr-primary); border-radius: 10px; }

/* 3. CHAT BUBBLES */
.seg-chat-row {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-meta {
    font-size: 0.7rem;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    opacity: 0.8;
}

.msg-others {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--clr-secondary);
}

.msg-me {
    align-self: flex-end;
    background: rgba(0, 150, 255, 0.1);
    border-right: 3px solid var(--clr-primary);
    text-align: right;
}

.msg-me .chat-meta { flex-direction: row-reverse; }

/* 4. SMART CARDS (HANDEL & ANGRIFF) */
.seg-chat-card {
    background: var(--clr-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    margin-top: 5px;
    text-align: left;
}

/* Handelskarte: Gold/Grün */
.chat-card-trade {
    border-left: 4px solid var(--clr-gold);
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
}

/* Angriffskarte: Rot/Gefahr */
.chat-card-attack {
    border-left: 4px solid var(--clr-danger);
    background: linear-gradient(90deg, rgba(255, 68, 102, 0.05) 0%, transparent 100%);
}

.seg-chat-card strong {
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
}

.seg-chat-card .seg-btn-sm {
    margin-top: 8px;
    width: 100%;
    font-size: 0.7rem;
    padding: 4px;
}

/* 5. INPUT BEREICH */
.seg-chat-input-wrap {
    display: flex;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--clr-border);
    gap: 8px;
}

#seg-guild-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--clr-border);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
}

#seg-guild-chat-input:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 8px rgba(0, 150, 255, 0.3);
}

#seg-btn-send-chat {
    background: var(--clr-primary);
    color: #fff;
    border: none;
    padding: 0 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

#seg-btn-send-chat:hover {
    filter: brightness(1.2);
}

/* Hilfsklasse für Schiffs-Auswahl im Modal */
.seg-ship-select-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn-cancel-trade {
    background-color: var(--clr-danger, #ff4d4d) !important;
    color: white;
    margin-top: 5px;
}

.btn-cancel-trade:hover {
    background-color: #ff1a1a !important;
}
.btn-cancel-trade {
    background: #d9534f !important;
    border: none !important;
    box-shadow: 0 2px 0 #b52b27;
    transition: all 0.2s;
}

.btn-cancel-trade:hover {
    background: #c9302c !important;
    transform: translateY(1px);
    box-shadow: 0 1px 0 #b52b27;
}

.chat-card-trade {
    border-left: 4px solid #f0ad4e !important;
    background: rgba(240, 173, 78, 0.1) !important;
}
.seg-chat-row.msg-system {
    justify-content: center;
    width: 100%;
}

.seg-chat-row.msg-system .chat-text {
    background: rgba(255, 215, 0, 0.1) !important;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    font-style: italic;
    font-size: 0.85em;
    text-align: center;
    border-radius: 10px;
    padding: 5px 15px;
}
/* 1. Die gesamte Nachrichten-Zeile zentrieren */
.seg-chat-row.msg-system {
    display: flex !important;
    justify-content: center !important;
    margin: 15px 0;
    width: 100%;
}

/* 2. Die goldene Box (system-announcement) */
.seg-chat-row.msg-system .system-announcement {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.05) 100%) !important;
    border: 1px solid rgba(255, 215, 0, 0.6) !important;
    color: #ffd700 !important;
    font-size: 0.95em;
    font-weight: bold;
    font-style: italic;
    text-align: center;
    padding: 10px 25px;
    border-radius: 25px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
    position: relative;
    overflow: hidden; /* Wichtig für den Glanz-Effekt! */
    max-width: 85%;
}

/* 3. Der Glanz-Effekt (wandert über die Box) */
.seg-chat-row.msg-system .system-announcement::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 100%;
    height: 200%;
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    animation: goldShine 4s infinite linear;
}

/* 4. Die Animation des Glanzes */
@keyframes goldShine {
    0% { left: -150%; }
    100% { left: 150%; }
}
/* Blaues Leuchten für laufende Lieferungen */
.seg-chat-row .chat-text:contains("🚀") {
    color: #5bc0de !important;
    border-color: #46b8da !important;
    font-style: italic;
}

/* Grünes Leuchten für fertige Lieferungen */
.seg-chat-row .chat-text:contains("✅") {
    color: #5cb85c !important;
    border-color: #4cae4c !important;
}
/* Die Handelskarte im Chat */
.seg-chat-card.chat-card-trade {
    border-left: 4px solid #f0ad4e; /* Orange für offene Anfragen */
    background: rgba(240, 173, 78, 0.1);
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
}

/* Status 1: Lieferung läuft (Blau) */
.seg-chat-card.status-1 {
    border-left-color: #5bc0de;
    background: rgba(91, 192, 222, 0.1);
}

/* Status 2: Erledigt (Grün) */
.seg-chat-card.status-2 {
    border-left-color: #5cb85c;
    background: rgba(92, 184, 92, 0.1);
    opacity: 0.8;
}
.trade-timer {
    display: block;
    font-weight: bold;
    color: #5bc0de; /* Ein schönes Blau */
    font-family: monospace;
    margin-top: 5px;
    background: rgba(0,0,0,0.2);
    padding: 2px 5px;
    border-radius: 3px;
    text-align: center;
}