/* =========================================
    CSS FOR CLUBSITE AI CHATBOT
    ========================================= */
#clubsite-ai-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
}

/* Den runde knappen */
#ai-chat-button {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background-color: var(--chatbot-theme); /* Bruk temafargen fra admin-innstillingene */
    color: white;
    font-size: 32px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s;
    border: 2px solid var(--chatbot-theme);
}

#ai-chat-button:hover {
    transform: scale(1.05);
    background-color: #555; /* Mørkere blå på hover */
}

/* Selve Chat-vinduet */
#ai-chat-window {
    display: none; /* Skjult som standard */
    position: absolute;
    bottom: 0;
    right: 0;
    width: 350px;
    height: calc(100vh - 40px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

#ai-chat-window.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header i chatvinduet */
#ai-chat-header {
    background-color: var(--chatbot-theme);
    color: white;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#ai-chat-header > div {
    display:flex;
    align-items:center;
    gap: 10px;
}
#ai-robot-avatar {
    display:none;
    width:24px;
    height:24px;
    border-radius:50%;
    background:white;
    padding:2px;
}
#ai-chat-close {
    cursor: pointer;
    font-size: 20px;
    background: none;
    border: none;
    color: white;
}

/* Tidslinje for meldinger */
#ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.bubble-bot {
    background: #EAEAEA; /* Nøytral grå bakgrunn */
    color: #000000; 
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.bubble-user {
    background: var(--chatbot-theme);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.bubble-typing {
    color: #888;
    font-style: italic;
    font-size: 12px;
    background: transparent;
    padding: 5px;
}

/* Input område */
#ai-chat-input-area {
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #ddd;
}

#ai-chat-input {
    flex: 1;

    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
}

#ai-chat-send {
    background: var(--chatbot-theme);
    color: white;
    text-align: center;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-weight: bold;
    padding:0;
}

/* MOBIL TILPASSING */
@media (max-width: 600px) {
    #ai-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    #ai-chat-header {
        font-size: 18px;
        padding: 16px;
    }

    #ai-chat-close {
        font-size: 28px;
        line-height: 1;
    }

    #ai-chat-messages {
        padding: 16px;
        gap: 12px;
    }

    .chat-bubble {
        max-width: 88%;
        font-size: 19px;
        line-height: 1.5;
        padding: 12px 14px;
    }

    .bubble-typing {
        font-size: 14px;
    }

    #ai-chat-input-area {
        padding: 12px;
    }

    #ai-chat-input {
        font-size: 16px;
        padding: 12px 14px;
    }

    #ai-chat-send {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}