/* ============================================================
   ✝️ Logos Chatbot — Floating Bubble UI
   ============================================================ */

/* ─── Bubble ─── */
.chatbot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chatbot__bubble {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #b8962f 50%, #c5a028 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    position: relative;
    animation: chatbotPulse 4s ease-in-out infinite;
}

.chatbot__bubble:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 28px rgba(212, 175, 55, 0.45);
}

.chatbot__bubble:active {
    transform: scale(0.95);
}

.chatbot__bubble-icon {
    line-height: 1;
}

.chatbot__bubble-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
}

@keyframes chatbotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ─── Window ─── */
.chatbot__window {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 380px;
    height: 580px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: none;
    flex-direction: column;
    animation: chatbotSlideUp 0.3s ease-out;
    z-index: 10000;
    overflow: hidden;
}

.chatbot__window.open {
    display: flex;
}

@keyframes chatbotSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── Header ─── */
.chatbot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #1a2a4a 0%, #243b5e 100%);
    color: #fff;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.chatbot__header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot__header-icon {
    font-size: 22px;
    line-height: 1;
}

.chatbot__header-title {
    font-weight: 700;
    font-size: 17px;
    display: block;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.chatbot__header-subtitle {
    font-size: 10px;
    display: block;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.03em;
    font-weight: 400;
    margin-top: 1px;
}

.chatbot__header-status {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.9;
    margin-left: auto;
    padding-left: 8px;
}

.chatbot__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.chatbot__status-dot--active {
    background: #2ecc71;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.6);
}

.chatbot__lang-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 5px;
    line-height: 1.2;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    margin-left: 6px;
    opacity: 0.85;
    letter-spacing: 0.03em;
}

.chatbot__lang-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.chatbot__lang-toggle:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.06);
}

.chatbot__header-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}

.chatbot__header-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ─── Body ─── */
.chatbot__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.chatbot__body::-webkit-scrollbar {
    width: 5px;
}

.chatbot__body::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot__body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* ─── Messages ─── */
.chatbot__message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: chatbotMessageIn 0.25s ease-out;
    position: relative;
}

@keyframes chatbotMessageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot__message--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #d4af37 0%, #c5a028 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot__message--bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: relative;
}

.chatbot__message-time {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 4px;
    display: block;
}

.chatbot__message--user .chatbot__message-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.7);
}

/* ─── Welcome Message ─── */
.chatbot__welcome {
    text-align: center;
    padding: 36px 20px 28px;
    color: #666;
    position: relative;
    overflow: hidden;
}

.chatbot__welcome-glow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.chatbot__welcome-icon {
    font-size: 42px;
    margin-bottom: 10px;
    display: block;
    animation: chatbotWelcomeBounce 2s ease-in-out infinite;
}

@keyframes chatbotWelcomeBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.chatbot__welcome-title {
    color: #1a2a4a;
    font-size: 19px;
    margin: 0 0 6px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: opacity 0.25s ease;
}

.chatbot__welcome-text {
    font-size: 13.5px;
    line-height: 1.6;
    max-width: 260px;
    margin: 0 auto;
    color: #777;
    transition: opacity 0.25s ease;
}

.chatbot__welcome-text strong {
    color: #d4af37;
    font-weight: 700;
}

.chatbot__welcome-hint {
    margin-top: 16px;
    padding: 6px 14px;
    display: inline-block;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.04));
    border-radius: 20px;
    font-size: 11.5px;
    color: #b8962f;
    font-weight: 500;
    letter-spacing: 0.02em;
    animation: chatbotHintPulse 3s ease-in-out infinite;
    transition: opacity 0.25s ease;
}

.chatbot__welcome-hint span {
    transition: opacity 0.25s ease;
}

@keyframes chatbotHintPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ─── Typing Indicator ─── */
.chatbot__typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
    background: #fff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.chatbot__typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #bbb;
    animation: chatbotTyping 1.4s infinite ease-in-out;
}

.chatbot__typing-dot:nth-child(1) { animation-delay: 0s; }
.chatbot__typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot__typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbotTyping {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ─── Recommendations ─── */
.chatbot__recommendation {
    align-self: flex-start;
    width: 100%;
    font-size: 12px;
    color: #888;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 8px;
    border-left: 3px solid #d4af37;
    margin-top: 2px;
    animation: chatbotMessageIn 0.3s ease-out;
}

.chatbot__rec-label {
    font-weight: 600;
    color: #1a2a4a;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chatbot__rec-item {
    color: #d4af37;
    text-decoration: none;
    display: block;
    padding: 2px 0;
    font-weight: 500;
    transition: opacity 0.2s;
}

.chatbot__rec-item:hover {
    opacity: 0.7;
}

/* ─── Footer ─── */
.chatbot__footer {
    padding: 10px 14px 14px;
    background: #fff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* ─── Suggestions (chips) ─── */
.chatbot__suggestions {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 8px;
    scrollbar-width: none;
}

.chatbot__suggestions::-webkit-scrollbar {
    display: none;
}

.chatbot__chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chatbot__chip:hover {
    background: #d4af37;
    color: #fff;
    border-color: #d4af37;
}

/* ─── Input ─── */
.chatbot__input-group {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chatbot__input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    line-height: 1.4;
    max-height: 120px;
}

.chatbot__input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.chatbot__input::placeholder {
    color: #bbb;
}

.chatbot__send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #d4af37, #c5a028);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.chatbot__send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.chatbot__send:active:not(:disabled) {
    transform: scale(0.95);
}

.chatbot__send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── Link-uri (recomandări resurse) ─── */
.chatbot__link {
    color: #c9a84c;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s ease;
}

.chatbot__link:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.chatbot__message--user .chatbot__link {
    color: inherit;
    opacity: 0.9;
}

.chatbot__message--user .chatbot__link:hover {
    opacity: 1;
}

/* ─── Language Selector ─── */
.chatbot__lang-select {
    text-align: center;
    padding: 32px 20px 24px;
    animation: chatbotSlideUp 0.5s ease-out;
    position: relative;
}

.chatbot__lang-select::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.10) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.chatbot__lang-icon {
    font-size: 48px;
    margin-bottom: 8px;
    display: block;
    animation: chatbotWelcomeBounce 2s ease-in-out infinite;
}

.chatbot__lang-title {
    color: #1a2a4a;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

.chatbot__lang-text {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    font-weight: 400;
    line-height: 1.5;
}

.chatbot__lang-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.chatbot__lang-btn {
    padding: 14px 28px;
    border-radius: 14px;
    border: 2px solid #e8e4de;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 140px;
    color: #444;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chatbot__lang-btn small {
    font-size: 11px;
    font-weight: 400;
    color: #aaa;
    transition: color 0.25s ease;
}

.chatbot__lang-btn:hover {
    border-color: #d4af37;
    background: linear-gradient(135deg, #d4af37, #c5a028);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
}

.chatbot__lang-btn:hover small {
    color: rgba(255, 255, 255, 0.8);
}

.chatbot__lang-btn:active {
    transform: scale(0.96) translateY(-1px);
}

/* ─── Error Message ─── */
.chatbot__error {
    text-align: center;
    color: #e74c3c;
    font-size: 13px;
    padding: 8px;
    background: #fdf0ef;
    border-radius: 8px;
}

/* ─── Responsive (Mobile) ─── */
@media (max-width: 480px) {
    .chatbot__window {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh; /* modern browsers: 100dvh = viewport minus keyboard/browser chrome */
        border-radius: 0;
    }

    .chatbot__header {
        border-radius: 0;
        padding: 14px 16px;
    }

    .chatbot__bubble {
        width: 50px;
        height: 50px;
        font-size: 22px;
        bottom: 16px;
        right: 16px;
    }

    .chatbot__body {
        padding: 12px;
    }

    .chatbot__lang-toggle {
        font-size: 11px;
        padding: 1px 5px;
    }
}
