
/* ==========================================================
   /ui/css/public/ljh-allan-widget.css
   Allan Chat Widget — Publik CSS
   Version 1.1 — 2026-05-25
   ========================================================== */

/* ==========================================================
   WIDGET WRAPPER
   ========================================================== */

.allan-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* ==========================================================
   ALLAN BAR — Pulslinje
   ========================================================== */

.allan-bar {
    position: relative;
    width: 380px;        /* ← samma som .allan-window */
    height: 52px;
    border-radius: 26px;
    background: linear-gradient(
        135deg,
        rgba(10, 20, 40, 0.92),
        rgba(5, 12, 28, 0.96)
    );
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.5),
        0 0 0 1px rgba(0,188,212,0.15);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.allan-bar:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0,0,0,0.6),
        0 0 0 1px rgba(0,188,212,0.3);
}

.allan-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.allan-name {
    position: relative;
    z-index: 1;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #00ff88;
    text-shadow: 0 0 12px #00ff88, 0 0 24px #00ff8888;
    pointer-events: none;
    user-select: none;
}

/* ==========================================================
   CHAT FÖNSTER — Desktop
   ========================================================== */

.allan-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 380px;
    height: 560px;
    border-radius: 20px;
    background: linear-gradient(
        180deg,
        rgba(12, 22, 42, 0.97),
        rgba(8, 16, 32, 0.99)
    );
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow:
        0 24px 64px rgba(0,0,0,0.7),
        0 0 0 1px rgba(0,188,212,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);   /* ← scale borttagen */
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    z-index: 9001;
}

.allan-window.is-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);      /* ← scale borttagen */
}


.allan-window.is-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* ==========================================================
   HEADER
   ========================================================== */

.allan-window-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.03);
    flex-shrink: 0;
}

.allan-window-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.allan-window-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.allan-window-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(235,245,255,0.95);
}

.allan-window-status {
    font-size: 0.75rem;
    color: #00e676;
}

.allan-window-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
    flex-shrink: 0;
}

.allan-window-close:hover {
    color: rgba(255,255,255,0.9);
}

/* ==========================================================
   MEDDELANDEN
   ========================================================== */

.allan-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;   /* ← meddelanden nerbottnade */
    gap: 10px;
    scroll-behavior: smooth;
}

.allan-messages::-webkit-scrollbar {
    width: 4px;
}

.allan-messages::-webkit-scrollbar-track {
    background: transparent;
}

.allan-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* ── Bubblor ───────────────────────────────────────────── */
.allan-bubble {
    max-width: 82%;
    padding: 10px 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
}

.allan-bubble-allan {
    align-self: flex-start;
    background: rgba(0,188,212,0.12);
    border: 1px solid rgba(0,188,212,0.2);
    color: rgba(235,245,255,0.92);
    border-radius: 4px 16px 16px 16px;
}

.allan-bubble-user {
    align-self: flex-end;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(235,245,255,0.88);
    border-radius: 16px 4px 16px 16px;
}

/* ==========================================================
   TYPING INDICATOR
   ========================================================== */

.allan-typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(0,188,212,0.08);
    border: 1px solid rgba(0,188,212,0.15);
    border-radius: 4px 16px 16px 16px;
    margin: 0 16px 8px 16px;
    flex-shrink: 0;
}

.allan-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,188,212,0.6);
    animation: allanTyping 1.2s infinite ease-in-out;
}

.allan-typing span:nth-child(2) { animation-delay: 0.2s; }
.allan-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes allanTyping {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
    40%           { transform: scale(1.2); opacity: 1;   }
}

/* ==========================================================
   INPUT-RAD
   ========================================================== */

.allan-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
}

.allan-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 0.88rem;
    color: rgba(235,245,255,0.9);
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}

.allan-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.allan-input:focus {
    border-color: rgba(0,188,212,0.4);
    background: rgba(255,255,255,0.08);
}

.allan-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    border: none;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.allan-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0,188,212,0.4);
}

/* ==========================================================
   SLOT-KNAPPAR
   ========================================================== */

.allan-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}

.allan-slot-btn {
    background: rgba(0,188,212,0.08);
    border: 1px solid rgba(0,188,212,0.25);
    border-radius: 10px;
    padding: 10px 14px;
    color: rgba(235,245,255,0.9);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.allan-slot-btn:hover {
    background: rgba(0,188,212,0.16);
    border-color: rgba(0,188,212,0.5);
    transform: translateX(2px);
}

.allan-slot-other {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

.allan-slot-other:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.85);
    transform: translateX(2px);
}

/* ==========================================================
   MOBIL — Fullskärm under 768px
   ========================================================== */

@media (max-width: 768px) {

    .allan-widget {
        bottom: 16px;
        right: 16px;
    }

    .allan-bar {
        width: 160px;
        height: 44px;
    }

    .allan-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        height: -webkit-fill-available;
        height: calc(var(--vh, 1vh) * 100);
        border-radius: 0;
        border: none;
        transform: translateY(100%);
        transition: transform 0.3s ease, opacity 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    .allan-window.is-open {
        transform: translateY(0);
        opacity: 1;
    }

    .allan-messages {
        flex: 1;
        padding: 12px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        overflow-y: auto;
        gap: 10px;
        overscroll-behavior: contain;
    }

    .allan-typing {
        margin: 0 12px 8px 12px;
        flex-shrink: 0;
    }

    .allan-input-row {
        position: relative;
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        flex-shrink: 0;
        background: rgba(8, 16, 32, 0.99);
    }

    .allan-input {
        font-size: 16px;
        padding: 12px 16px;
    }

    .allan-send-btn {
        width: 44px;
        height: 44px;
    }

    .allan-slot-btn {
        padding: 14px 16px;
        font-size: 0.92rem;
    }
}

