/* ═══════════════════════════════════════════
   Amina Support Chat Widget
   Brand: dark (#1a1a1a), orange (#FFAD6C), white
   ═══════════════════════════════════════════ */

#amina-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a1a1a;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, background .2s ease;
}
#amina-chat-toggle:hover {
    transform: scale(1.08);
    background: #2a2a2a;
}
#amina-chat-toggle svg {
    width: 26px;
    height: 26px;
    fill: #FFAD6C;
    transition: transform .2s ease;
}
#amina-chat-toggle.open svg {
    transform: rotate(90deg);
}

/* ── Panel ── */
#amina-chat-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 99998;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(.96);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
#amina-chat-panel.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ── Header ── */
.amina-chat-header {
    background: #1a1a1a;
    color: #fff;
    padding: 16px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.amina-chat-header .amina-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
}

/* ── Messages area ── */
.amina-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
.amina-chat-messages::-webkit-scrollbar {
    width: 4px;
}
.amina-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

/* ── Bubbles ── */
.amina-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
}
.amina-msg.assistant {
    background: #f3f4f6;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.amina-msg.user {
    background: #1a1a1a;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.amina-msg a {
    color: #FFAD6C;
    text-decoration: underline;
}

/* ── Quick reply buttons ── */
.amina-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 8px;
}
.amina-quick-reply {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    color: #1a1a1a;
    transition: border-color .15s, background .15s;
}
.amina-quick-reply:hover {
    border-color: #FFAD6C;
    background: #fff8f0;
}

/* ── Typing indicator ── */
.amina-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
}
.amina-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    animation: amina-bounce .6s infinite alternate;
}
.amina-typing span:nth-child(2) { animation-delay: .15s; }
.amina-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes amina-bounce {
    to { transform: translateY(-4px); opacity: .5; }
}

/* ── Input area ── */
.amina-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    background: #fff;
}
.amina-chat-input-area input {
    flex: 1;
    border: 1.5px solid #e5e7eb;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}
.amina-chat-input-area input:focus {
    border-color: #FFAD6C;
}
.amina-chat-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a1a1a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.amina-chat-input-area button:hover {
    background: #333;
}
.amina-chat-input-area button svg {
    width: 18px;
    height: 18px;
    fill: #FFAD6C;
}
.amina-chat-input-area button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ── Escalation form ── */
.amina-escalation-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fefce8;
    border-top: 1px solid #fde68a;
}
.amina-escalation-form label {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
}
.amina-escalation-form input {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}
.amina-escalation-form button {
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.amina-escalation-form button:hover {
    background: #333;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    #amina-chat-panel {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    #amina-chat-toggle {
        bottom: 16px;
        right: 16px;
    }
}
