/* Icelandic Chatbot - frontend styles */
#icbot-root, #icbot-root * {
    box-sizing: border-box;
}

.icbot-launcher {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 999px;
    background: var(--icbot-primary, #2563eb);
    color: var(--icbot-on-primary, #fff);
    font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    border: 0;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18), 0 4px 10px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.icbot-launcher:hover { transform: translateY(-1px); }
#icbot-root.icbot-pos-right .icbot-launcher { right: 24px; }
#icbot-root.icbot-pos-left  .icbot-launcher { left: 24px; }

.icbot-launcher svg { width: 18px; height: 18px; }

.icbot-window {
    position: fixed;
    bottom: 96px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.22), 0 10px 20px rgba(15, 23, 42, 0.08);
    transform-origin: bottom right;
    animation: icbot-pop 0.18s ease-out;
    font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #0f172a;
}
#icbot-root.icbot-pos-right .icbot-window { right: 24px; }
#icbot-root.icbot-pos-left  .icbot-window { left: 24px; transform-origin: bottom left; }

@keyframes icbot-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)  scale(1); }
}

.icbot-header {
    background: linear-gradient(135deg, var(--icbot-primary, #2563eb), var(--icbot-accent, #1e40af));
    color: var(--icbot-on-primary, #fff);
    padding: 18px 18px 22px;
    position: relative;
}
.icbot-header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.icbot-header p  { margin: 4px 0 0; font-size: 13px; opacity: 0.85; }
.icbot-close {
    position: absolute;
    right: 10px;
    top: 10px;
    background: transparent;
    border: 0;
    color: inherit;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.85;
}
.icbot-close:hover { background: rgba(255,255,255,0.15); opacity: 1; }

.icbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.icbot-msg {
    max-width: 86%;
    padding: 10px 14px;
    border-radius: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    animation: icbot-fade 0.18s ease-out;
}
@keyframes icbot-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.icbot-msg-bot {
    align-self: flex-start;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.icbot-msg-user {
    align-self: flex-end;
    background: var(--icbot-primary, #2563eb);
    color: var(--icbot-on-primary, #fff);
    border-bottom-right-radius: 4px;
}
.icbot-msg-helper {
    align-self: flex-start;
    background: #fef3c7;
    color: #78350f;
    font-size: 13px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.icbot-typing {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: inline-flex;
    gap: 4px;
}
.icbot-typing span {
    width: 6px; height: 6px; border-radius: 50%; background: #94a3b8;
    animation: icbot-blink 1.2s infinite ease-in-out;
}
.icbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.icbot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes icbot-blink {
    0%, 80%, 100% { opacity: 0.3; }
    40%           { opacity: 1; }
}

.icbot-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 4px 2px;
}
.icbot-option-btn {
    text-align: left;
    background: #fff;
    color: var(--icbot-primary, #2563eb);
    border: 1.5px solid var(--icbot-primary, #2563eb);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.icbot-option-btn:hover {
    background: var(--icbot-primary, #2563eb);
    color: var(--icbot-on-primary, #fff);
}

.icbot-input-wrap {
    border-top: 1px solid #e2e8f0;
    padding: 10px 12px;
    background: #fff;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.icbot-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.icbot-input:focus {
    border-color: var(--icbot-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.icbot-send {
    background: var(--icbot-primary, #2563eb);
    color: var(--icbot-on-primary, #fff);
    border: 0;
    border-radius: 10px;
    padding: 0 14px;
    height: 40px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.15s ease;
}
.icbot-send:disabled { opacity: 0.5; cursor: not-allowed; }

.icbot-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    align-self: stretch;
}

.icbot-footer-note {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    padding: 6px 12px 8px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}

@media (max-width: 480px) {
    .icbot-window {
        width: calc(100vw - 16px);
        height: calc(100vh - 100px);
        bottom: 84px;
    }
    #icbot-root.icbot-pos-right .icbot-window { right: 8px; }
    #icbot-root.icbot-pos-left  .icbot-window { left: 8px; }
}
