/* ================================================================
   WP Wedding Core — AI Assistant Panel Styles
   ================================================================ */

/* ----------------------------------------------------------------
   Floating trigger button
---------------------------------------------------------------- */
.wpwc-ai-trigger {
    position: fixed;
    bottom: 88px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a9e8f, #0d5c54);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(13,92,84,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    z-index: 99999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wpwc-ai-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(13,92,84,0.5);
}
.wpwc-ai-trigger .wpwc-ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e24b4a;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    display: none;
}
.wpwc-ai-trigger .wpwc-ai-badge.show { display: block; }

/* ----------------------------------------------------------------
   Chat panel
---------------------------------------------------------------- */
.wpwc-ai-panel {
    position: fixed;
    bottom: 156px;
    right: 28px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 580px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    z-index: 8999;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.wpwc-ai-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* ----------------------------------------------------------------
   Panel header
---------------------------------------------------------------- */
.wpwc-ai-header {
    background: linear-gradient(135deg, #0d5c54, #085048);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.wpwc-ai-header__icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}
.wpwc-ai-header__title {
    flex: 1;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}
.wpwc-ai-header__sub {
    color: #b2e4df;
    font-size: 0.72rem;
    margin-top: 1px;
}
.wpwc-ai-header__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
}
.wpwc-ai-header__close:hover { opacity: 1; }

/* ----------------------------------------------------------------
   Quick action buttons
---------------------------------------------------------------- */
.wpwc-ai-actions {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid #e8e4de;
    overflow-x: auto;
    flex-shrink: 0;
    background: #faf9f7;
}
.wpwc-ai-action-btn {
    white-space: nowrap;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid #e8e4de;
    background: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: #0d5c54;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.wpwc-ai-action-btn:hover {
    background: #0d5c54;
    color: #fff;
    border-color: #0d5c54;
}

/* ----------------------------------------------------------------
   Messages area
---------------------------------------------------------------- */
.wpwc-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wpwc-ai-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 100%;
}

.wpwc-ai-msg--user {
    flex-direction: row-reverse;
}

.wpwc-ai-msg__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.wpwc-ai-msg--assistant .wpwc-ai-msg__avatar {
    background: linear-gradient(135deg, #1a9e8f, #0d5c54);
    color: #fff;
}
.wpwc-ai-msg--user .wpwc-ai-msg__avatar {
    background: #e8e4de;
    color: #7a7670;
}

.wpwc-ai-msg__bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.6;
    max-width: calc(100% - 40px);
    word-wrap: break-word;
}
.wpwc-ai-msg--assistant .wpwc-ai-msg__bubble {
    background: #f0faf9;
    border: 1px solid #b2e4df;
    color: #2c2a28;
    border-top-left-radius: 4px;
}
.wpwc-ai-msg--user .wpwc-ai-msg__bubble {
    background: #0d5c54;
    color: #fff;
    border-top-right-radius: 4px;
}

/* Markdown-style formatting inside bubbles */
.wpwc-ai-msg__bubble strong { font-weight: 700; }
.wpwc-ai-msg__bubble em { font-style: italic; }
.wpwc-ai-msg__bubble ul { margin: 6px 0 6px 16px; }
.wpwc-ai-msg__bubble li { margin-bottom: 3px; }
.wpwc-ai-msg__bubble p { margin: 0 0 6px; }
.wpwc-ai-msg__bubble p:last-child { margin-bottom: 0; }

.wpwc-ai-msg--typing .wpwc-ai-msg__bubble {
    background: #f0faf9;
    border: 1px solid #b2e4df;
}
.wpwc-ai-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 16px;
}
.wpwc-ai-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1a9e8f;
    animation: wpwc-dot-bounce 1.2s infinite;
}
.wpwc-ai-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.wpwc-ai-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wpwc-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Notes input area (for meeting summariser) */
.wpwc-ai-notes-area {
    padding: 10px 14px;
    border-top: 1px solid #e8e4de;
    background: #faf9f7;
    display: none;
    flex-shrink: 0;
}
.wpwc-ai-notes-area.show { display: block; }
.wpwc-ai-notes-area textarea {
    width: 100%;
    height: 100px;
    padding: 8px 12px;
    border: 1.5px solid #e8e4de;
    border-radius: 8px;
    font-size: 0.82rem;
    resize: none;
    box-sizing: border-box;
    font-family: inherit;
}
.wpwc-ai-notes-area textarea:focus { outline: none; border-color: #1a9e8f; }
.wpwc-ai-notes-submit {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* ----------------------------------------------------------------
   Input area
---------------------------------------------------------------- */
.wpwc-ai-input-area {
    padding: 12px 14px;
    border-top: 1px solid #e8e4de;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
    background: #fff;
}
.wpwc-ai-input {
    flex: 1;
    padding: 9px 13px;
    border: 1.5px solid #e8e4de;
    border-radius: 20px;
    font-size: 0.88rem;
    resize: none;
    max-height: 100px;
    min-height: 38px;
    overflow-y: auto;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.15s;
}
.wpwc-ai-input:focus { outline: none; border-color: #1a9e8f; }
.wpwc-ai-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1a9e8f;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.15s;
}
.wpwc-ai-send-btn:hover { background: #0d5c54; }
.wpwc-ai-send-btn:disabled { background: #e8e4de; cursor: not-allowed; }

/* ----------------------------------------------------------------
   Wedding context selector
---------------------------------------------------------------- */
.wpwc-ai-context-bar {
    padding: 8px 14px;
    border-bottom: 1px solid #e8e4de;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: #fff;
}
.wpwc-ai-context-bar label {
    font-size: 0.72rem;
    color: #7a7670;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.wpwc-ai-context-select {
    flex: 1;
    padding: 5px 10px;
    border: 1.5px solid #e8e4de;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #0d5c54;
    font-weight: 600;
}
.wpwc-ai-context-select:focus { outline: none; border-color: #1a9e8f; }

/* ----------------------------------------------------------------
   Mobile
---------------------------------------------------------------- */
@media (max-width: 480px) {
    .wpwc-ai-panel {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 75vh;
        border-radius: 16px 16px 0 0;
    }
    .wpwc-ai-trigger {
        bottom: 16px;
        right: 16px;
    }
}
