/* =============================================================================
   CHAT INTERFACE STYLES
   ============================================================================= */

/* Messages Container */
#messages-container {
    scroll-behavior: smooth;
}

#messages-container::-webkit-scrollbar {
    width: 6px;
}

#messages-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#messages-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#messages-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Message Bubbles */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    animation: message-appear 0.3s ease-out;
}

@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Messages (left-aligned) */
.message-ai {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: #0c4a6e;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid #bae6fd;
}

.message-ai .message-label {
    font-size: 11px;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User Messages (right-aligned) */
.message-user {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message-user .message-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Message Content */
.message-text {
    line-height: 1.5;
}

/* Question Intro (clinical context) */
.message-intro {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    font-style: italic;
}

.message-ai .message-intro {
    color: #0284c7;
    border-bottom-color: #bae6fd;
}

/* =============================================================================
   OPTION BUTTONS
   ============================================================================= */

.option-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.option-button:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.option-button:active {
    transform: translateY(0);
}

.option-button.selected {
    border-color: #2563eb;
    background: #2563eb;
    color: white;
}

.option-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* =============================================================================
   OLLAMA STATUS INDICATOR
   ============================================================================= */

#ollama-status.online {
    background: #dcfce7;
}

#ollama-status.online span:first-child {
    background: #22c55e;
    animation: status-pulse 2s infinite;
}

#ollama-status.online span:last-child {
    color: #166534;
}

#ollama-status.offline {
    background: #fef3c7;
}

#ollama-status.offline span:first-child {
    background: #f59e0b;
}

#ollama-status.offline span:last-child {
    color: #92400e;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* =============================================================================
   AUDIO TOGGLE
   ============================================================================= */

#audio-toggle {
    position: relative;
}

#audio-toggle.muted svg {
    color: #9ca3af;
}

#audio-toggle.muted::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #ef4444;
    transform: rotate(-45deg);
    top: 50%;
    left: 50%;
    margin-left: -12px;
    margin-top: -1px;
}

/* =============================================================================
   LOADING STATES
   ============================================================================= */

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Complete Button */
.complete-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.complete-button:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.complete-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* =============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================= */

@media (max-width: 640px) {
    .robot-avatar {
        width: 60px;
        height: 80px;
    }

    .robot-head {
        width: 50px;
        height: 45px;
    }

    .robot-body {
        width: 36px;
        height: 22px;
    }

    .speech-bubble {
        padding: 12px 14px;
    }

    .option-button {
        padding: 12px 16px;
        font-size: 14px;
    }

    #messages-container {
        height: 250px;
    }
}
