/* Chat Widget Styles — PlanFast brand (dark teal, no gray glass) */
:root {
    --chat-primary: #1E4A6D;
    --chat-primary-dark: #0D1F2D;
    --chat-primary-mid: #18344D;
    --chat-primary-light: #2A6080;
    --chat-bg: #0D1F2D;
    --chat-text: rgba(255, 255, 255, 0.92);
    --chat-message-user: #1E4A6D;
    --chat-message-bot: #18344D;
    --chat-base-font: 'Inter', system-ui, -apple-system, sans-serif;
}

#planfast-chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--chat-base-font);
}

/* Toggle Button */
#planfast-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #18344D 0%, #0D1F2D 100%);
    box-shadow: 0 6px 24px rgba(13, 31, 45, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

#planfast-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(13, 31, 45, 0.55);
}

#planfast-chat-toggle img {
    width: 36px;
    height: 36px;
    filter: brightness(0) invert(1);
}

/* Chat Window */
#planfast-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    max-height: 80vh;
    background: var(--chat-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

#planfast-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header — dunkler Marken-Gradient */
.chat-header {
    background: linear-gradient(135deg, #0D1F2D 0%, #1E4A6D 100%);
    padding: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header .close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0D1F2D;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot {
    background-color: var(--chat-message-bot);
    color: var(--chat-text);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.message.user {
    background-color: var(--chat-message-user);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Suggestion Chips */
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding: 0 4px;
}

.suggestion-chip {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background-color: #1E4A6D;
    border-color: #2A6080;
    color: white;
}

/* Input Area */
.chat-input-area {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 8px;
    background: #18344D;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: #0D1F2D;
    color: #fff;
    transition: border-color 0.2s;
}

.chat-input-area input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.chat-input-area input:focus {
    border-color: #2A6080;
}

.chat-input-area button {
    background-color: var(--chat-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.chat-input-area button:hover {
    background-color: var(--chat-primary-light);
}

.chat-input-area button:disabled {
    background-color: #2A6080;
    opacity: 0.45;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    margin: 0 1px;
}

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

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

@keyframes typing {

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

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

/* Chat Tooltip / Speech Bubble - Glass Style */
.chat-tooltip {
    position: absolute;
    bottom: 75px;
    right: 10px;
    background: #fff;
    color: #1a1a1a;
    padding: 10px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 600;
    max-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fff;
}

.chat-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: tooltip-bounce 2s ease-in-out infinite;
}

.chat-tooltip .tooltip-close {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0 0 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.chat-tooltip .tooltip-close:hover {
    color: #666;
}

@keyframes tooltip-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@media (max-width: 480px) {
    #planfast-chat-widget-container {
        bottom: 20px;
        right: 16px;
    }
    
    .chat-tooltip {
        bottom: 70px;
        right: 0;
        max-width: 180px;
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .chat-tooltip::after {
        right: 20px;
    }

    /* When open, make it full screen fixed */
    #planfast-chat-window {
        position: fixed;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        transform: translateY(100%);
        z-index: 10000;
        margin: 0;
    }

    #planfast-chat-window.open {
        transform: translateY(0);
    }
}
/* Chat App CTA Bubble */
.chat-app-cta-bubble {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(135deg, #0d1f2d, #1e4a6d) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    padding: 10px 14px !important;
}

.chat-cta-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    flex: 1;
}

.chat-cta-btn {
    background: #D4AF37;
    color: #1a1a1a !important;
    text-decoration: none !important;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.chat-cta-btn:hover {
    background: #c9a428;
}
