/* ===========================================
   Dana Core Integration Styles
   Treatment Planner Bot
   =========================================== */

/* Floating Ask Dana Button */
.dana-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0D9488, #0F766E);
    color: white;
    border: none;
    border-radius: 28px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.3);
    transition: all 0.2s ease;
    z-index: 1000;
}

.dana-float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(13, 148, 136, 0.4);
}

.dana-float-btn:active {
    transform: translateY(0);
}

.dana-float-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.dana-float-btn.hidden {
    display: none;
}

/* Dana Chat Panel */
.dana-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
}

.dana-panel.visible {
    display: flex;
}

/* Panel Header */
.dana-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0D9488, #0F766E);
    color: white;
}

.dana-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.dana-panel-title svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.dana-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.dana-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dana-close-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Messages Container */
.dana-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message Bubbles */
.dana-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.dana-message.user {
    align-self: flex-end;
    background: #0D9488;
    color: white;
    border-bottom-right-radius: 4px;
}

.dana-message.assistant {
    align-self: flex-start;
    background: #F3F4F6;
    color: #1F2937;
    border-bottom-left-radius: 4px;
}

.dana-message.system {
    align-self: center;
    background: #FEF3C7;
    color: #92400E;
    font-size: 12px;
    padding: 8px 12px;
}

/* Typing Indicator */
.dana-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #F3F4F6;
    border-radius: 16px;
    width: fit-content;
}

.dana-typing span {
    width: 8px;
    height: 8px;
    background: #9CA3AF;
    border-radius: 50%;
    animation: dana-bounce 1.4s infinite ease-in-out;
}

.dana-typing span:nth-child(1) { animation-delay: 0s; }
.dana-typing span:nth-child(2) { animation-delay: 0.2s; }
.dana-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dana-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.dana-input-area {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    background: #FAFAFA;
}

.dana-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 24px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.dana-input:focus {
    border-color: #0D9488;
}

.dana-input::placeholder {
    color: #9CA3AF;
}

.dana-send-btn {
    width: 44px;
    height: 44px;
    background: #0D9488;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.dana-send-btn:hover {
    background: #0F766E;
}

.dana-send-btn:disabled {
    background: #D1D5DB;
    cursor: not-allowed;
}

.dana-send-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Quick Actions */
.dana-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
}

.dana-quick-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    font-size: 12px;
    color: #4B5563;
    cursor: pointer;
    transition: all 0.2s;
}

.dana-quick-btn:hover {
    background: #F3F4F6;
    border-color: #0D9488;
    color: #0D9488;
}

/* Status Indicator */
.dana-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6B7280;
    padding: 4px 12px;
}

.dana-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dana-status-dot.online {
    background: #10B981;
}

.dana-status-dot.offline {
    background: #EF4444;
}

/* Offline Banner */
.dana-offline-banner {
    background: #FEF2F2;
    color: #991B1B;
    padding: 8px 16px;
    font-size: 12px;
    text-align: center;
    display: none;
}

.dana-offline-banner.visible {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .dana-float-btn {
        bottom: 16px;
        right: 16px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .dana-panel {
        bottom: 70px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        height: calc(100vh - 100px);
        max-height: none;
        border-radius: 12px;
    }
}

/* Dark mode support (if parent app implements) */
@media (prefers-color-scheme: dark) {
    .dana-panel {
        background: #1F2937;
    }

    .dana-message.assistant {
        background: #374151;
        color: #F3F4F6;
    }

    .dana-input-area {
        background: #111827;
        border-color: #374151;
    }

    .dana-input {
        background: #1F2937;
        border-color: #374151;
        color: #F3F4F6;
    }
}
