/* Chatbot Styles */
:root {
    --chat-primary: #122419;
    /* Forest Green */
    --chat-accent: #f8f9fa;
    --chat-text: #333;
    --chat-bg: #fff;
    --chat-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--chat-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.chat-bubble:hover {
    transform: scale(1.1);
}

.chat-bubble svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.chat-bubble-label {
    position: fixed;
    bottom: 30px;
    right: 90px;
    background: var(--chat-primary);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
    pointer-events: none;
    transition: all 0.3s ease;
    animation: pulse 2.5s infinite;
    /* Lisätty syke-animaatio */
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
}

/* Lisätään pieni nuoli */
.chat-bubble-label::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid var(--chat-primary);
}

@media (max-width: 768px) {
    .chat-bubble-label {
        display: none;
    }

    .chat-bubble {
        bottom: 90px;
        /* Elevated above mobile CTA-sticky */
        right: 15px;
    }

    .chat-window {
        bottom: 160px;
        /* Elevated accordingly */
        right: 15px;
        width: calc(100% - 30px);
        height: 60vh;
    }
}

.chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: var(--chat-bg);
    border-radius: 12px;
    box-shadow: var(--chat-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
}

.chat-window.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chat-header {
    background-color: var(--chat-primary);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
}

.chat-close {
    cursor: pointer;
    font-size: 30px;
    padding: 5px;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.message {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot {
    background-color: #f1f1f1;
    align-self: flex-start;
}

.message.user {
    background-color: var(--chat-primary);
    color: white;
    align-self: flex-end;
}

.chat-suggestions {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid #eee;
    background: #fdfdfd;
}

.suggestion-btn {
    background: #fff;
    border: 1px solid var(--chat-primary);
    color: var(--chat-primary);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: var(--chat-primary);
    color: white;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    outline: none;
}

.chat-send {
    background-color: var(--chat-primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.typing-indicator {
    font-style: italic;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
}

/* Dark Mode support */
body.dark-mode .chat-window {
    background-color: #0a1a11;
    color: #f1f5f2;
}

body.dark-mode .message.bot {
    background-color: #1c3a2a;
    color: #f1f5f2;
}

body.dark-mode .chat-input {
    background-color: #1c3a2a;
    border-color: #2d4a3a;
    color: white;
}

body.dark-mode .suggestion-btn {
    border-color: #2d4a3a;
    color: #cbd5e0;
    background: #1c3a2a;
}

/* Contact Form Styles */
.chat-email-icon {
    cursor: pointer;
    font-size: 24px;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 5px;
}

.chat-clear {
    font-size: 20px;
    padding: 5px;
}

.chat-email-icon:hover {
    opacity: 1;
}

.chat-contact-form {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--chat-bg);
    display: none;
    flex-direction: column;
    z-index: 10;
}

.chat-contact-form.active {
    display: flex;
}

.chat-contact-form .form-header {
    background-color: var(--chat-primary);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-contact-form .form-header h3 {
    margin: 0;
    font-size: 1rem;
}

.chat-contact-form .form-close {
    cursor: pointer;
    font-size: 20px;
}

.chat-contact-form .form-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.chat-contact-form .form-group {
    margin-bottom: 15px;
}

.chat-contact-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--chat-text);
    font-weight: 500;
}

.chat-contact-form input,
.chat-contact-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

.chat-contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

.chat-contact-form .form-submit {
    width: 100%;
    background-color: var(--chat-primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.chat-contact-form .form-submit:hover {
    opacity: 0.9;
}

.chat-contact-form .form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-contact-form .honeypot {
    position: absolute;
    left: -9999px;
}

.contact-form-suggestion {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--chat-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.contact-form-suggestion:hover {
    opacity: 0.9;
}

/* Dark mode for contact form */
body.dark-mode .chat-contact-form {
    background-color: #0a1a11;
}

body.dark-mode .chat-contact-form label {
    color: #f1f5f2;
}

body.dark-mode .chat-contact-form input,
body.dark-mode .chat-contact-form textarea {
    background-color: #1c3a2a;
    border-color: #2d4a3a;
    color: white;
}