/* Premium Glassmorphism Chatbot Styles for Transport Seppälä */
:root {
    --chat-primary: #10b981;
    --chat-secondary: #047857;
    --chat-gradient: linear-gradient(135deg, #10b981, #047857);
    --chat-bg: rgba(18, 36, 25, 0.85);
    /* Dark green tint */
    --chat-window-glass: rgba(255, 255, 255, 0.03);
    --chat-text: #f8f9fa;
    --chat-text-muted: #94a3b8;
    --chat-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --chat-border: rgba(255, 255, 255, 0.1);
}

.chat-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    background: var(--chat-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 10px 40px rgba(16, 185, 129, 0.3),
        0 0 20px rgba(4, 120, 87, 0.2);
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    animation: chat-bubble-float 3s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes chat-bubble-float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-12px) scale(1.05);
    }
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(16, 185, 129, 0.5);
}

.chat-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.chat-bubble.active {
    background: #1a1a1a;
    transform: rotate(90deg);
    border-color: var(--chat-primary);
}

.chat-bubble-label {
    position: fixed;
    bottom: 35px;
    right: 105px;
    background: rgba(18, 36, 25, 0.9);
    backdrop-filter: blur(12px);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 999;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.02em;
}

.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 rgba(18, 36, 25, 0.9);
}

.chat-window {
    position: fixed;
    bottom: 110px;
    right: 25px;
    width: 420px;
    height: min(650px, 85vh);
    background: var(--chat-bg);
    backdrop-filter: blur(30px);
    border-radius: 32px;
    box-shadow: var(--chat-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid var(--chat-border);
    font-family: 'Inter', sans-serif;
}

.chat-window.active {
    display: flex;
    animation: chat-premium-in 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chat-premium-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: var(--chat-gradient);
    color: white;
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    position: relative;
}

.chat-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.chat-status {
    font-size: 0.75rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-header-actions button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
    padding: 0;
}

.chat-header-actions button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.chat-messages {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    scrollbar-width: thin;
    scrollbar-color: var(--chat-primary) transparent;
}

.message {
    padding: 14px 20px;
    border-radius: 20px;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
}

.message.bot {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #e2e8f0;
    backdrop-filter: blur(5px);
}

.message.user {
    background: var(--chat-gradient);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chat-suggestions {
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestion-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--chat-text);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(5px);
}

.suggestion-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--chat-primary);
    color: var(--chat-primary);
    transform: translateY(-2px) scale(1.02);
}

.chat-input-area {
    padding: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 20px;
    border-radius: 16px;
    outline: none;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: var(--chat-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.chat-send {
    background: var(--chat-gradient);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chat-send:hover {
    transform: scale(1.05) translate(2px, -2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.chat-send svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Contact Form Premium Redesign */
.chat-contact-form {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f172a;
    display: none;
    flex-direction: column;
    z-index: 1510;
    border-radius: 32px;
    animation: form-premium-slide 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes form-premium-slide {
    from {
        transform: translateX(100%);
        filter: blur(5px);
    }

    to {
        transform: translateX(0);
        filter: blur(0);
    }
}

.chat-contact-form.active {
    display: flex;
}

.chat-contact-form .form-header {
    background: rgba(255, 255, 255, 0.02);
    color: white;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-contact-form .form-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.chat-contact-form .form-close {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.chat-contact-form .form-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.chat-contact-form .form-body {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: radial-gradient(circle at top right,
            rgba(16, 185, 129, 0.05),
            transparent);
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--chat-text-muted);
    font-weight: 500;
    margin-left: 4px;
}

.chat-contact-form input:not(.honeypot),
.chat-contact-form textarea {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.chat-contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.chat-contact-form input:focus,
.chat-contact-form textarea:focus {
    border-color: var(--chat-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.chat-contact-form .form-submit {
    width: 100%;
    background: var(--chat-gradient);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s;
    margin-top: 10px;
}

.chat-contact-form .form-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.3);
}

.honeypot {
    position: absolute;
    left: -9999px;
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex !important;
    align-items: center;
    width: fit-content;
    gap: 6px;
    padding: 14px 20px !important;
}

.typing-indicator .dot {
    display: inline-block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: var(--chat-primary, #10b981);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Dark Mode Support */
body.dark-mode .chat-window {
    background: rgba(10, 20, 15, 0.95);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .chat-messages {
    background: rgba(0, 0, 0, 0.4);
}

body.dark-mode .chat-input-area {
    background: rgba(0, 0, 0, 0.5);
    border-top-color: rgba(255, 255, 255, 0.02);
}

body.dark-mode .chat-input {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

body.dark-mode .chat-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--chat-primary);
}

body.dark-mode .message.bot {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
    color: #cbd5e0;
}

body.dark-mode .suggestion-btn {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
    color: #cbd5e0;
}

body.dark-mode .suggestion-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--chat-primary);
    color: var(--chat-primary);
}

body.dark-mode .chat-suggestions {
    background: rgba(0, 0, 0, 0.2);
    border-top-color: rgba(255, 255, 255, 0.02);
}

@media (max-width: 768px) {
    .chat-window {
        bottom: 90px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        height: 75vh !important;
        max-height: 700px !important;
        border-radius: 20px !important;
        border: 1px solid var(--chat-border) !important;
        box-shadow: var(--chat-shadow) !important;
    }

    .chat-header {
        padding: 16px 20px !important;
    }

    .chat-header h3 {
        font-size: 1rem !important;
    }

    .chat-messages {
        padding: 16px 20px !important;
        gap: 12px !important;
    }

    .chat-suggestions {
        padding: 10px 16px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .chat-suggestions::-webkit-scrollbar {
        display: none;
    }

    .suggestion-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }

    .chat-input-area {
        padding: 16px !important;
    }

    .chat-bubble {
        bottom: 90px !important;
        right: 15px !important;
    }

    .chat-bubble.active {
        display: none !important;
    }

    .chat-bubble-label {
        display: none !important;
    }
}