/* style.css */



#chat {
    position: relative;
    /* Ensure button stays in flow */
    z-index: 1;
}

/* Chat Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #e50914;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}



.chat-toggle:hover {
    background: #b20710;
    transform: scale(1.1);
}

.chat-toggle-icon {
    font-size: 24px;
    color: white;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
    animation: pulse 1s infinite;
    z-index: 10001;
    /* Ensure it's above the toggle */
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(0.95);
    }
}

/* Chat Overlay */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent background */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* High, but below the toggle and badge */
    padding: 10px;
    pointer-events: none;
    /*  Allow clicks to pass through when hidden  */
    backdrop-filter: blur(5px);
    /*  Nice blur effect  */
}

.chat-overlay.active {
    display: flex;
    pointer-events: auto;
    /*  Enable interaction when visible  */
}

/* Chat Container */
.chat-container {
    position: absolute;
    width: 95%;
    max-width: 500px;
    background: #221f1f;
    border-radius: 15px;
    overflow: hidden;
    z-index: 10000;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    touch-action: manipulation;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    max-height: 700px;
    /* Fixed maximum height */
    height: 700px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    overflow-x: hidden;
    max-height: calc(700px - 150px);
}

/* Message Styles */
.message {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 20px;
    margin: 10px 0;
    border-radius: 20px;
    max-width: 80%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.message:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.message.user {
    align-items: flex-end;
    margin-left: auto;
    background: #e50914;
    border: 1px solid #b20710;
}

.message.user:hover {
    background: #b20710;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.message-icon {
    font-size: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    margin-right: 8px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.message.user .message-icon {
    background: #fff;
    color: #e50914;
}

.message-content {
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    color: #fff;
    margin-left: 10px;
}

.message.user .message-content {
    margin-left: 0;
    margin-right: 10px;
}

.message-timestamp {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.message.user .message-timestamp {
    margin-left: 0;
    margin-right: 10px;
}

.message-status {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    display: none;
}

.message.user .message-status {
    background: #e50914;
}

.message.unread .message-status {
    display: block;
}

/* New Message Notification */
.new-message-notification {
    position: fixed;
    bottom: 40px;
    right: 20px;
    background: #e5091461;
    color: white;
    padding: 2px 2px;
    border-radius: 20px;
    display: none;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Chat Title */
.chat-title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 10002;
}

/* Draggable Header */
.draggable-header {

    top: -25px;
    left: 0;
    right: 0;
    height: 25px;
    background: #1647704f;
    cursor: move;
    z-index: 10001;
    /* Ensure it's above the container */
}

/* Input Container */
.input-container {
    padding: 10px;
    background: #221f1f;
}

/* Input Wrapper */
.input-wrapper {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Input Field */
input {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    background-color: #444;
    /* Darker background for input */
    color: #fff;
    border: none;
    /* Remove default border */
}

input::placeholder {
    color: #aaa;
    /* Lighter color for placeholder text */
}

/* Send Button */
button {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    background-color: #e50914;
    /* Consistent color with toggle button */
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #b20710;
    /* Darker shade on hover */
}

/* Typing Message */
#typingMessage {
    display: none;
}

/* Media Queries */
@media (max-width: 480px) {
    .chat-toggle {
        width: 40px;
        height: 40px;
    }

    .chat-toggle-icon {
        font-size: 18px;
    }

    .chat-container {
        width: 98%;
        max-width: none;
        border-radius: 10px;
    }

    .chat-messages {
        padding: 8px;
    }

    .input-container {
        padding: 8px;
    }

    input {
        font-size: 13px;
        padding: 8px;
    }

    button {
        padding: 8px 15px;
        font-size: 13px;
    }
}


.message {
    /* Or whatever your message class is */
    position: relative;
    /* Required for absolute positioning of the index */
    padding-bottom: 15px;
    /* Make space for the index display */
}

.indices-display {
    position: absolute;
    bottom: 2px;
    right: 5px;
    font-size: 0.7em;
    color: #888;
}