﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.foxy-modal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: none;
}

    .foxy-modal:not(.hidden) {
        display: block;
    }

/* Desktop */
.foxy-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: min(420px, calc(100vw - 40px));
    height: min(700px, calc(100vh - 140px));
    background: #111;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    transition: all .3s ease;
}


.hidden {
    display: none !important;
}

.foxy-header {
    padding: 12px 15px;
    background: #1c1c1c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2d2d2d; /* Subtle separator */
    font-weight: 600;
}

.foxy-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.foxy-input {
    display: flex;
    padding: 10px;
    background: #1c1c1c;
}

    .foxy-input input {
        flex: 1;
        padding: 8px;
    }


/* --- 🦊 GIF Style Foxy Button --- */

.foxy-icon {
    width: 50px;
    height: 50px;
    /* Triggers the shrinking animation when the page loads */
    /*animation: iconShrinkEntrance 2.5s ease-in-out forwards;*/
}

.foxy-fab {
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 15px rgba(0,0,0,.15);
    overflow: visible;
    transition: transform 0.2s ease, background-color 0.2s ease;
    pointer-events: auto;
    /* Triggers the button shrinking animation when the page loads */
    /* animation: fabShrinkEntrance 2.5s ease-in-out forwards;*/
}

    .foxy-fab:hover {
        transform: scale(1.05);
    }

/* --- ENTRANCE ANIMATIONS --- */

/* Animates the white background circle */
@keyframes fabShrinkEntrance {
    0%, 50% {
        /* Stays large for the first half of the animation */
        width: 180px;
        height: 180px;
    }

    100% {
        /* Shrinks to target size */
        width: 70px;
        height: 70px;
    }
}

/* Animates the GIF image inside the circle */
@keyframes iconShrinkEntrance {
    0%, 50% {
        width: 140px;
        height: 140px;
    }

    100% {
        width: 50px;
        height: 50px;
    }
}

.foxy-fab:hover {
    transform: scale(1.05);
}

.fox {
    position: relative;
    width: 44px;
    height: 40px;
    animation: foxFloat 3s ease-in-out infinite;
}

/* Animation to suck the greeting bubble into the button */
@keyframes hideIntoButton {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    100% {
        opacity: 0;
        /* Moves the bubble 60px right (into the button) and shrinks it */
        transform: translateX(60px) scale(0.2);
        visibility: hidden; /* Ensures it can no longer be clicked */
    }
}

/* Subtle fade-in animation for the greeting */
@keyframes foxyFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.foxy-close {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 18px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

    .foxy-close:hover {
        background: #ff7b00;
        color: white;
    }


/* --- FOXY ANIMATION --- */

/* The keyframes for a quick wiggle effect */
@keyframes foxyWiggle {
    0%, 80%, 100% {
        transform: rotate(0deg) scale(1);
    }

    85% {
        transform: rotate(15deg) scale(1.1);
    }

    90% {
        transform: rotate(-10deg) scale(1.1);
    }

    95% {
        transform: rotate(5deg) scale(1.1);
    }
}

/* Apply the animation to the span wrapping the emoji */
.foxy-emoji {
    display: inline-block; /* Required for transform to work on a span */
    animation: foxyWiggle 4s infinite ease-in-out;
}

/* Optional: Make the animation pause when the user hovers over the button */
.foxy-fab:hover .foxy-emoji {
    animation-play-state: paused;
}

.foxy-input {
    display: flex;
    padding: 10px;
    background: #1c1c1c;
    gap: 8px;
    align-items: center;
}

    .foxy-input input {
        flex: 1;
        padding: 10px 14px;
        background: #2a2a2a;
        border: 1px solid #333;
        border-radius: 20px;
        color: white;
        font-size: 14px;
        outline: none;
        transition: border 0.2s;
    }

        .foxy-input input:focus {
            border-color: #ff7b00;
        }

        .foxy-input input::placeholder {
            color: #666;
        }

.foxy-send {
    background: #ff7b00;
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

    .foxy-send:hover {
        background: #e06a00;
        transform: scale(1.1);
    }

    .foxy-send:active {
        transform: scale(0.95);
    }

/* Base bubble styling */
.msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.4;
    word-wrap: break-word;
    width: fit-content;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

    /* User Message (Right aligned, Blue) */
    .msg.user {
        background-color: #0084ff; /* Messenger Blue */
        color: #ffffff;
        align-self: flex-end;
        border-bottom-right-radius: 4px; /* Messenger tail effect */
    }

    /* Bot Message (Left aligned, Dark Gray) */
    .msg.bot {
        background-color: #3e4042; /* Messenger Dark Gray */
        color: #e4e6eb;
        align-self: flex-start;
        border-bottom-left-radius: 4px; /* Messenger tail effect */
    }

/* Typing Indicator Styling */
.foxy-typing {
    background-color: #3e4042;
    color: #e4e6eb;
    align-self: flex-start;
    border-radius: 18px;
    padding: 8px 14px;
    display: inline-flex;
    gap: 2px;
    width: fit-content;
    border-bottom-left-radius: 4px;
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
}

/* Tablet */
@media (max-width: 1024px) {
    .foxy-window {
        width: 90vw;
        height: 85vh;
        bottom: 90px;
        right: 5vw;
    }
}

@media (max-width: 768px) {

    .foxy-window {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
        border-radius: 0;
        margin: 0;
    }

    .foxy-input {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

        .foxy-input input {
            flex: 1 1 auto;
            min-width: 0; /* IMPORTANT */
            width: auto;
            font-size: 16px;
        }

    .foxy-send {
        flex-shrink: 0;
        width: 42px;
        height: 42px;
    }
}

/* Small phones */
@media (max-width: 480px) {

    .foxy-title {
        font-size: 15px;
    }

    .foxy-input {
        gap: 6px;
    }

    .foxy-send {
        width: 42px;
        height: 42px;
    }

    .msg {
        max-width: 95%;
        font-size: 13.5px;
    }
}