/* Online Takım Bul — rezervasyon kartı ile uyumlu korku teması */

.horror-team-section {
    position: relative;
    padding: 4rem 0;
    background: var(--color-bg, #0a0a0a);
    overflow: hidden;
    border-top: 1px solid rgba(196, 30, 58, 0.2);
}

.horror-team-section__glow {
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 120%);
    height: 70%;
    background: radial-gradient(ellipse at center,
            rgba(196, 30, 58, 0.14) 0%,
            transparent 65%);
    pointer-events: none;
}

.horror-team-section .container {
    position: relative;
    z-index: 1;
}

/* Dış kart — reservation-container ile aynı dil */
.team-chat-container {
    background: var(--color-surface, rgba(18, 18, 18, 0.92));
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-card, 0 8px 32px rgba(0, 0, 0, 0.45));
    padding: 2rem 2.25rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
}

.team-chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            transparent,
            var(--color-accent, #c41e3a),
            transparent);
    opacity: 0.85;
}

.team-chat-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent 0,
            transparent 3px,
            rgba(255, 255, 255, 0.012) 4px);
    pointer-events: none;
}

/* Başlık — reservation-title ile eş */
.team-chat-header {
    text-align: center;
    margin-bottom: 1.75rem;
    position: relative;
    z-index: 1;
}

.team-chat-eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-accent-soft, #e63950);
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.team-chat-eyebrow i {
    font-size: 0.9rem;
    opacity: 0.9;
    animation: teamChatSkullFloat 4s ease-in-out infinite;
}

.team-chat-title {
    font-family: var(--font-display, 'Oswald', sans-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text, #f5f5f5);
    margin: 0 0 0.5rem;
    text-shadow: 0 0 32px rgba(196, 30, 58, 0.25);
}

.team-chat-tagline {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 1rem;
    color: var(--color-text-muted, #a3a3a3);
    margin: 0;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

/* İç chat kutusu */
#team-chat .horror-team-chat.modern-chat {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(196, 30, 58, 0.22);
    border-radius: var(--radius-md, 12px);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
    padding: 0;
    max-width: none;
    margin: 0;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--color-text, #f5f5f5);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 1;
}

#team-chat .chat-header-simple {
    display: none;
}

/* Toolbar */
#team-chat .horror-chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: rgba(196, 30, 58, 0.08);
    border-bottom: 1px solid rgba(196, 30, 58, 0.25);
}

#team-chat .horror-chat-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--color-text-muted, #a3a3a3);
}

#team-chat .horror-chat-status strong {
    color: var(--color-text, #f5f5f5);
    font-weight: 700;
    font-size: 1.05rem;
}

#team-chat .horror-chat-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.8);
    animation: teamChatPulseDot 1.8s ease-in-out infinite;
}

#team-chat .horror-chat-live-badge {
    font-family: var(--font-display, 'Oswald', sans-serif);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    background: var(--color-accent, #c41e3a);
    color: #fff;
    animation: teamChatBadgeFlicker 3s ease-in-out infinite;
}

/* Mesaj alanı */
#team-chat .horror-chat-messages-wrap {
    position: relative;
    min-height: 280px;
}

#team-chat .horror-chat-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.04;
    background: repeating-linear-gradient(0deg,
            transparent 0,
            transparent 2px,
            rgba(255, 255, 255, 0.5) 3px);
}

#team-chat .horror-team-chat .chat-messages {
    height: 300px;
    max-height: 45vh;
    overflow-y: auto;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 0;
    margin: 0;
    scrollbar-color: var(--color-accent, #c41e3a) rgba(0, 0, 0, 0.3);
    scrollbar-width: thin;
}

#team-chat .horror-team-chat .chat-messages::-webkit-scrollbar {
    width: 6px;
}

#team-chat .horror-team-chat .chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-accent, #c41e3a);
    border-radius: 3px;
}

#team-chat .horror-chat-empty {
    padding: 2.5rem 1rem;
    color: var(--color-text-muted, #a3a3a3);
}

#team-chat .horror-chat-empty i {
    font-size: 2.5rem;
    color: var(--color-accent-soft, #e63950);
    margin-bottom: 1rem;
    display: block;
    opacity: 0.7;
    animation: teamChatGhostFloat 5s ease-in-out infinite;
}

#team-chat .horror-chat-empty p {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

/* Mesaj balonları */
#team-chat .horror-team-chat .message {
    max-width: 82%;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.5;
    animation: teamChatMsgIn 0.35s ease;
}

#team-chat .horror-team-chat .message.other {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid rgba(196, 30, 58, 0.5);
    margin-right: auto;
}

#team-chat .horror-team-chat .message.own {
    background: rgba(196, 30, 58, 0.15);
    border: 1px solid rgba(196, 30, 58, 0.35);
    border-right: 3px solid var(--color-accent, #c41e3a);
    margin-left: auto;
    text-align: right;
}

#team-chat .horror-team-chat .message-header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

#team-chat .horror-team-chat .message.own .message-header {
    flex-direction: row-reverse;
}

#team-chat .horror-team-chat .username {
    font-family: var(--font-display, 'Oswald', sans-serif);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-accent-soft, #e63950);
}

#team-chat .horror-team-chat .message.own .username {
    color: #ffb4c0;
}

#team-chat .horror-team-chat .timestamp {
    opacity: 0.55;
    font-size: 0.7rem;
}

#team-chat .horror-team-chat .message-content {
    color: var(--color-text, #f5f5f5);
    word-break: break-word;
}

#team-chat .horror-team-chat .message.horror-new-message {
    animation: teamChatNewMsg 0.8s ease;
}

/* Yazıyor göstergesi */
#team-chat .horror-team-chat .typing-indicator {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--color-accent-soft, #e63950);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Input alanı */
#team-chat .horror-team-chat .chat-input {
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(196, 30, 58, 0.2);
    border-radius: 0 0 var(--radius-md, 12px) var(--radius-md, 12px);
    position: relative;
}

#team-chat .horror-chat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted, #a3a3a3);
    margin-bottom: 0.35rem;
}

#team-chat .horror-team-chat .chat-warning-message {
    background: rgba(196, 30, 58, 0.1);
    border: 1px solid rgba(196, 30, 58, 0.35);
    border-radius: var(--radius-md, 12px);
    padding: 0.65rem 0.9rem;
    margin-bottom: 1rem;
    color: #ffb4c0;
    font-size: 0.8rem;
    animation: teamChatWarningPulse 3s ease-in-out infinite;
}

#team-chat .horror-team-chat .chat-warning-message i {
    color: var(--color-accent, #c41e3a);
}

#team-chat .horror-team-chat .chat-warning-message strong {
    color: var(--color-accent-soft, #e63950);
}

#team-chat .horror-team-chat .chat-warning-message span {
    color: var(--color-text-muted, #a3a3a3);
}

#team-chat .horror-team-chat .chat-nick,
#team-chat .horror-team-chat .chat-message {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1)) !important;
    border-radius: var(--radius-md, 12px) !important;
    color: var(--color-text, #f5f5f5) !important;
    padding: 12px 14px !important;
    font-size: 0.95rem !important;
    margin-bottom: 0.75rem;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#team-chat .horror-team-chat .chat-nick:focus,
#team-chat .horror-team-chat .chat-message:focus {
    border-color: var(--color-accent, #c41e3a) !important;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.35) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    outline: none;
}

#team-chat .horror-team-chat .chat-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-bottom: 0;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

#team-chat .horror-team-chat .chat-message {
    flex: 1;
    margin-bottom: 0 !important;
}

#team-chat .horror-team-chat .chat-send-btn {
    background: var(--color-accent, #c41e3a) !important;
    border: none !important;
    border-radius: var(--radius-md, 12px) !important;
    color: #fff !important;
    font-family: var(--font-display, 'Oswald', sans-serif);
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0 1.25rem !important;
    min-height: 48px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#team-chat .horror-team-chat .chat-send-btn:hover:not(:disabled) {
    background: var(--color-accent-soft, #e63950) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.35) !important;
}

#team-chat .horror-team-chat .chat-send-btn:disabled {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.35) !important;
}

#team-chat .horror-team-chat .chat-emoji-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1)) !important;
    color: var(--color-text-muted, #a3a3a3) !important;
    border-radius: var(--radius-md, 12px) !important;
    min-width: 48px;
    min-height: 48px;
}

#team-chat .horror-team-chat .chat-emoji-btn:hover {
    border-color: var(--color-accent, #c41e3a) !important;
    color: var(--color-accent-soft, #e63950) !important;
    background: rgba(196, 30, 58, 0.12) !important;
}

#team-chat .horror-team-chat .emoji-picker {
    left: 1rem;
    right: 1rem;
    bottom: auto;
    top: auto;
    margin-top: 0.5rem;
    position: relative;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(196, 30, 58, 0.35);
    border-radius: var(--radius-md, 12px);
    padding: 0.75rem;
    display: none;
    flex-wrap: wrap;
    gap: 0.25rem;
    box-shadow: var(--shadow-card, 0 8px 32px rgba(0, 0, 0, 0.45));
}

#team-chat .horror-team-chat .emoji-picker[style*="block"] {
    display: flex !important;
}

#team-chat .horror-team-chat .emoji-btn {
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.15s ease;
}

#team-chat .horror-team-chat .emoji-btn:hover {
    background: rgba(196, 30, 58, 0.2);
    transform: scale(1.15);
}

/* Animasyonlar */
@keyframes teamChatSkullFloat {
    50% { transform: translateY(-3px); opacity: 0.7; }
}

@keyframes teamChatPulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

@keyframes teamChatBadgeFlicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    94% { opacity: 0.6; }
}

@keyframes teamChatGhostFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes teamChatMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes teamChatNewMsg {
    0% {
        box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.6);
        background: rgba(196, 30, 58, 0.25);
    }
    100% {
        box-shadow: none;
    }
}

@keyframes teamChatWarningPulse {
    0%, 100% { box-shadow: 0 0 0 transparent; }
    50% { box-shadow: 0 0 16px rgba(196, 30, 58, 0.2); }
}

/* chat.css mobil margin/renk çakışmalarını kır */
#team-chat .horror-team-chat.modern-chat {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

#team-chat .horror-team-chat .chat-messages {
    display: block !important;
    flex-direction: unset !important;
    gap: 0 !important;
    background: rgba(0, 0, 0, 0.45) !important;
    border-radius: 0 !important;
}

#team-chat .horror-team-chat .message.own {
    background: rgba(196, 30, 58, 0.15) !important;
}

#team-chat .horror-team-chat .message.other {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Tablet ve mobil — rezervasyon ile uyumlu */
@media (max-width: 991.98px) {
    .horror-team-section {
        padding: 2rem 0 2.5rem;
        overflow-x: hidden;
    }

    .horror-team-section .container {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
        max-width: 100%;
    }

    .team-chat-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1.25rem max(0.75rem, env(safe-area-inset-left)) 1.25rem max(0.75rem, env(safe-area-inset-right));
        box-sizing: border-box;
        border-radius: var(--radius-md, 12px);
    }

    .team-chat-header {
        margin-bottom: 1.25rem;
    }

    .team-chat-eyebrow {
        font-size: 0.72rem;
        letter-spacing: 0.14em;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .team-chat-title {
        font-size: 1.35rem !important;
        letter-spacing: 0.05em;
        line-height: 1.2;
    }

    .team-chat-tagline {
        font-size: 0.9rem;
        padding: 0 0.25rem;
    }

    #team-chat .horror-chat-toolbar {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    #team-chat .horror-chat-status {
        flex: 1 1 auto;
        min-width: 0;
    }

    #team-chat .horror-chat-status-text {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #team-chat .horror-chat-messages-wrap {
        min-height: 0;
    }

    #team-chat .horror-team-chat .chat-messages {
        height: auto !important;
        min-height: 200px !important;
        max-height: min(50dvh, 360px) !important;
        padding: 1rem !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    #team-chat .horror-team-chat .chat-input {
        padding: 1rem !important;
        border-radius: 0 0 var(--radius-md, 12px) var(--radius-md, 12px) !important;
    }

    #team-chat .horror-team-chat .chat-nick,
    #team-chat .horror-team-chat .chat-message {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 16px !important;
        box-sizing: border-box !important;
    }

    #team-chat .horror-team-chat .chat-warning-message {
        font-size: 0.75rem;
        line-height: 1.45;
        align-items: flex-start;
    }

    #team-chat .horror-team-chat .chat-warning-message span {
        word-break: break-word;
    }

    #team-chat .horror-team-chat .chat-input-group {
        display: grid !important;
        grid-template-columns: 1fr auto minmax(7.5rem, 1fr);
        gap: 0.5rem !important;
        width: 100% !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #team-chat .horror-team-chat .chat-send-btn {
        font-size: 0.9rem !important;
        padding: 0 0.75rem !important;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    #team-chat .horror-team-chat .message {
        max-width: 90% !important;
        padding: 0.55rem 0.75rem !important;
        font-size: 0.88rem !important;
    }

    #team-chat .horror-team-chat .message-header {
        flex-wrap: wrap;
        gap: 0.15rem 0.5rem;
    }

    #team-chat .horror-team-chat .message.own .message-header {
        justify-content: flex-start;
    }

    #team-chat .horror-team-chat .username {
        font-size: 0.72rem;
    }

    #team-chat .horror-team-chat .timestamp {
        font-size: 0.65rem;
    }

    #team-chat .horror-team-chat .chat-messages {
        max-height: min(45dvh, 320px) !important;
    }
}

/* Küçük telefon */
@media (max-width: 576px) {
    .horror-team-section {
        padding: 1.5rem 0 2rem;
    }

    .team-chat-container {
        padding: 1rem 0.75rem;
    }

    #team-chat .horror-team-chat .chat-input-group {
        grid-template-columns: 1fr 48px;
        grid-template-areas:
            "message message"
            "emoji send";
    }

    #team-chat .horror-team-chat .chat-message {
        grid-area: message;
    }

    #team-chat .horror-team-chat .chat-emoji-btn {
        grid-area: emoji;
        width: 100%;
    }

    #team-chat .horror-team-chat .chat-send-btn {
        grid-area: send;
        width: 100%;
        min-height: 48px !important;
    }

    #team-chat .horror-team-chat .emoji-picker {
        margin-top: 0.65rem;
        justify-content: center;
    }

    #team-chat .horror-team-chat .emoji-btn {
        min-width: 40px;
        min-height: 40px;
        font-size: 1.25rem;
    }

    #team-chat .horror-chat-empty {
        padding: 1.75rem 0.5rem;
    }

    #team-chat .horror-chat-empty i {
        font-size: 2rem;
    }
}

@media (max-width: 380px) {
    .team-chat-title {
        font-size: 1.15rem !important;
    }

    #team-chat .horror-chat-live-badge {
        font-size: 0.62rem;
        padding: 0.2rem 0.5rem;
    }

    #team-chat .horror-team-chat .chat-send-btn {
        font-size: 0.8rem !important;
        padding: 0 0.5rem !important;
    }

    #team-chat .horror-team-chat .chat-send-btn i {
        margin-right: 0.25rem;
    }

    #team-chat .horror-team-chat .message {
        max-width: 94% !important;
    }
}

/* Yatay mobil / kısa ekran */
@media (max-height: 500px) and (orientation: landscape) {
    #team-chat .horror-team-chat .chat-messages {
        min-height: 120px !important;
        max-height: 35dvh !important;
    }

    .team-chat-header {
        margin-bottom: 0.75rem;
    }

    .team-chat-tagline {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #team-chat .horror-chat-pulse-dot,
    #team-chat .horror-chat-live-badge,
    #team-chat .horror-chat-empty i,
    #team-chat .team-chat-eyebrow i,
    #team-chat .horror-team-chat .chat-warning-message {
        animation: none !important;
    }
}
