/* /home/siisi/vertex/vertex_app/static/css/live.css */

/* --- Chat Container --- */
#chat-history {
    height: 65vh;
    /* Responsive height */
    min-height: 400px;
    overflow-y: auto;
    padding: 20px;
}

/* --- Message Layout --- */
.message-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease;
}

.message-user {
    flex-direction: row-reverse;
}

.message-ai {
    flex-direction: row;
}

/* --- Avatar --- */
.message-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    border: 1px solid white;
}

/* --- Bubbles --- */
.message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    max-width: 75%;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
}

.user-bubble {
    background: linear-gradient(135deg, #5a9bfc, #09439b);
    color: white;
    border-bottom-right-radius: 4px;
}

.user-bubble a {
    color: #e0e0e0;
    text-decoration: underline;
}

.ai-bubble {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

.ai-bubble a {
    color: #0d6efd;
}

/* Specific override for your existing bubbles */
.user-bubble a:hover,
.ai-bubble a:hover {
    color: #43DC80 !important;
}

/* --- Content --- */
.message-sender {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    opacity: 0.8;
}

.message-content {
    line-height: 1.6;
    font-size: 0.95rem;
}

.message-timestamp {
    font-size: 0.7rem;
    margin-top: 6px;
    opacity: 0.6;
    text-align: right;
}

/* Custom status colors */
.status-connected {
    color: #43DC80 !important;
}

.status-disconnected {
    color: #dc3545 !important; /* Red for disconnected */
}

.status-connecting {
    color: #ffc107 !important; /* Yellow for connecting */
}

.text-danger {
    color: #dc3545 !important; /* Keep existing Bootstrap danger */
}

/* --- Media --- */
.image-container img {
    max-height: 350px;
    width: auto;
    transition: transform 0.2s;
    cursor: pointer;
}

.image-container img:hover {
    transform: scale(1.01);
}

/* Scrollbar Styling */
#chat-history::-webkit-scrollbar {
    width: 6px;
}

#chat-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

#chat-history::-webkit-scrollbar-thumb {
    background: #43DC80;  /* Your custom green color */
    border-radius: 10px;
}

#chat-history::-webkit-scrollbar-thumb:hover {
    background: #3ac571;  /* Slightly darker green on hover */
}

/* For Firefox */
#chat-history {
    scrollbar-width: thin;
    scrollbar-color: #43DC80 rgba(0, 0, 0, 0.05);
}

/* --- Video Feed --- */
#video-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    overflow: hidden;
    margin: 5px;
    padding: 5px !important;
    display: none;
    /* Hidden by default */
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#user-video-feed {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: #000;
    display: block !important;
    /* Force display */
}

#video-container small {
    color: white !important;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* --- Typing Indicator --- */
.typing-indicator {
    display: inline-flex;
    gap: 5px;
    padding: 7px 11px;
    background: white;
    border-radius: 18px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    animation: typing-bounce 1.4s ease-in-out infinite both;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.media-controls .btn-light:hover {
    background-color: #9fa3a7;
    border-color: #dee2e6;
    color: #000;
}

/* Animations */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.7;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
    }

    .message-avatar {
        width: 36px;
        height: 36px;
    }

    #chat-history {
        height: 400px;
        padding: 15px;
    }

    .btn-media {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    #video-container {
        margin: 5px;
        padding: 15px !important;
        max-height: 300px;
    }

    #user-video-feed {
        max-height: 250px;
        width: 100%;
        object-fit: cover;
    }

    /* DISABLE screen share on mobile instead of hiding */
    #screenshare-toggle {
        pointer-events: none;
        opacity: 0.7;
        cursor: not-allowed;
    }
}

/* Audio Player Styles */
.audio-container audio {
    height: 32px;
    margin-top: 8px;
}

.custom-audio-play-button {
    background: #43DC80;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.custom-audio-play-button:hover {
    background: #41b45a;
}

.hidden-audio-player {
    display: none;
}

/* Style for the user's TTS button */
.user-tts-button {
    background-color: rgba(255, 255, 255, 0.9);
    /* White, slightly transparent */
    color: #0056b3;
    /* Dark blue text */
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.user-tts-button:hover {
    background-color: #ffffff;
    /* Solid white on hover */
    color: #0056b3;
}
