/* =========================================
   Aajuna Chatbot — Grønlandiskolen v2.0
   Floating widget
   ========================================= */

/* ── Floating bubble ──────────────────────── */

#aajuna-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: inherit;
}

.aajuna-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 0 14px;
    height: 52px;
    background: #8DC4AA;
    color: #fff;
    border: none;
    border-radius: 26px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    transition: background 0.15s, transform 0.15s;
    white-space: nowrap;
}

.aajuna-bubble:hover {
    background: #6DAA8E;
    transform: translateY(-2px);
}

.aajuna-bubble__icon {
    font-size: 15px;
    font-weight: 800;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aajuna-bubble__label {
    font-size: 14px;
    font-weight: 600;
}

.aajuna-bubble--open {
    background: #6DAA8E;
}

/* ── Chat panel ───────────────────────────── */

.aajuna-panel {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 360px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.aajuna-panel--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── Panel header ─────────────────────────── */

.aajuna-panel__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #8DC4AA;
    color: #fff;
}

.aajuna-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.aajuna-header-text {
    flex: 1;
}

.aajuna-header-text h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.aajuna-header-text p {
    margin: 2px 0 0;
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    line-height: 1.3;
}

.aajuna-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.aajuna-close:hover { opacity: 1; }

/* ── Messages ─────────────────────────────── */

.aajuna-messages {
    background: #f7faf8;
    padding: 16px;
    min-height: 180px;
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.aajuna-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 92%;
}

.aajuna-msg--bot  { align-self: flex-start; }
.aajuna-msg--user { align-self: flex-end; flex-direction: row-reverse; }

.aajuna-msg__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #8DC4AA;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aajuna-msg--user .aajuna-msg__avatar {
    background: #E5E7EB;
    color: #6B7280;
    font-size: 13px;
}

.aajuna-msg__bubble {
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #1a2e22;
}

.aajuna-msg--bot .aajuna-msg__bubble {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-bottom-left-radius: 3px;
}

.aajuna-msg--user .aajuna-msg__bubble {
    background: #8DC4AA;
    color: #fff;
    border-bottom-right-radius: 3px;
}

.aajuna-msg__bubble a { color: #8DC4AA; text-decoration: underline; word-break: break-word; }
.aajuna-msg--user .aajuna-msg__bubble a { color: #b3ffd9; }

.aajuna-msg__bubble p  { margin: 0 0 6px; }
.aajuna-msg__bubble p:last-child { margin-bottom: 0; }
.aajuna-msg__bubble ul, .aajuna-msg__bubble ol { margin: 4px 0 4px 16px; padding: 0; }
.aajuna-msg__bubble li { margin-bottom: 3px; }
.aajuna-msg__bubble strong { font-weight: 700; }

/* ── Typing indicator ─────────────────────── */

.aajuna-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
    align-items: center;
}

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

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

@keyframes aajuna-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Chips ────────────────────────────────── */

.aajuna-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 0;
}

.aajuna-chip {
    padding: 5px 12px;
    border: 1.5px solid #8DC4AA;
    border-radius: 16px;
    background: #fff;
    color: #8DC4AA;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.aajuna-chip:hover { background: #8DC4AA; color: #fff; }

/* ── Input bar ────────────────────────────── */

.aajuna-input-bar {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
    align-items: flex-end;
    border-top: 1px solid #E5E7EB;
    background: #fff;
}

.aajuna-input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    resize: none;
    line-height: 1.4;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.2s;
    color: #1a2e22;
    background: #fff;
}

.aajuna-input:focus {
    outline: none;
    border-color: #8DC4AA;
    box-shadow: 0 0 0 2px rgba(141,196,170,0.2);
}

.aajuna-send {
    padding: 9px 16px;
    background: #8DC4AA;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.aajuna-send:hover    { background: #6DAA8E; }
.aajuna-send:disabled { background: #9CA3AF; cursor: not-allowed; }

/* ── Mobil ────────────────────────────────── */

@media (max-width: 480px) {
    #aajuna-widget {
        bottom: 16px;
        right: 16px;
    }

    .aajuna-panel {
        width: calc(100vw - 32px);
        right: 0;
    }

    .aajuna-bubble__label {
        display: none;
    }

    .aajuna-bubble {
        padding: 0;
        width: 52px;
        justify-content: center;
        border-radius: 50%;
    }
}
