/* ========================= */
/* GLOBAL */
/* ========================= */

body {
    margin: 0;
    font-family:
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            Roboto,
            "Noto Sans",
            "Apple Color Emoji",
            "Segoe UI Emoji",
            "Noto Color Emoji",
            sans-serif;
    background: #f5f7fb;
    color: #1a1a1a;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* ========================= */
/* NAVBAR */
/* ========================= */

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    font-weight: bold;
    font-size: 18px;
    color: #0a74da;
}

/* ========================= */
/* SPLIT LAYOUT */
/* ========================= */

.split-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* LEFT SIDE */

.left {
    padding: 20px;
}

/* HERO */

.hero {
    text-align: center;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.hero p {
    color: #555;
    font-size: 16px;
}

/* ========================= */
/* FEATURES (LIGHTWEIGHT LIST) */
/* ========================= */

.features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

/* each item */
.feature {
    display: flex;
    align-items: center;
    gap: 12px;

    background: none;              /* remove card feel */
    box-shadow: none;
    padding: 0;
    border-radius: 0;

    font-size: 15px;
    color: #555;
}

/* icon */
.feature .icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

/* subtle hover (desktop only) */
@media (hover: hover) {
    .feature:hover {
        color: #0a74da;
    }
}

/* ========================= */
/* RIGHT SIDE (CHAT) */
/* ========================= */

.right {
    padding: 10px;
}

/* CHAT BOX */

/* CHAT AREA */

#chat {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

/* MESSAGES */

.message {
    max-width: 80%;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

/* USER MESSAGE */

.user {
    align-self: flex-end;
    background: #0a74da;
    color: white;
    border-bottom-right-radius: 4px;
}

/* AI MESSAGE */

.bot {
    align-self: flex-start;
    background: #eef2f7;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
}

/* INPUT AREA */

.input-area {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    background: white;
}

/* INPUT */

input {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 16px; /* prevents zoom on iOS */
}

/* BUTTON */

button {
    padding: 12px 16px;
    background: #0a74da;
    color: white;
    border: none;
    border-radius: 8px;
    min-height: 44px;
    cursor: pointer;
}

/* ========================= */
/* FOOTER */
/* ========================= */

.footer {
    text-align: center;
    padding: 30px 20px;
    color: #777;
}

/* three dots thinking */
.dots {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 16px;
}

.dots span {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out;
}

.dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================= */
/* TABLET */
/* ========================= */

@media (min-width: 768px) {

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 18px;
    }

    .features {
        flex-direction: row;
        justify-content: center;
    }

    .feature {
        width: 200px;
    }
}

/* LABEL POSITION */
.chat-label {
    position: absolute;
    right: 70px;
    top: 50%;
    background: #f59e0b;
    color: white;
    padding: 8px 14px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 14px;

    opacity: 0;
    transform: translateY(-50%) translateX(10px);
    transition: all 0.4s ease;

    pointer-events: none;
}

.chat-widget.show-label .chat-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* LITTLE ARROW (optional but nice) */
.chat-label::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #f59e0b;
}

/* ✨ PULSE ANIMATION */
@keyframes pulseLabel {
    0% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    }

    70% {
        transform: translateY(-50%) scale(1.05);
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* APPLY PULSE */
.chat-label.pulse {
    animation: pulseLabel 2s infinite;
}

/* ========================= */
/* DESKTOP (SPLIT MODE) */
/* ========================= */

@media (min-width: 1024px) {

    .split-layout {
        flex-direction: row;
    }

    .left {
        flex: 1;
        padding: 60px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .right {
        display: flex;
        width: 480px;
        padding: 20px;
    }

    .chat-box {
        width: 100%;
        margin-top: auto;
    }
}

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* Circle button */
.chat-launcher {
    width: 60px;
    height: 60px;
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    position: relative;
}

/* Chat box */
.chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    height: 40dvh;
    max-height: 40dvh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);

    opacity: 0;
    pointer-events: none;
    transform: translateX(100%) translateY(20px);
    transition: all 0.3s ease;

    display: flex;
    flex-direction: column;
}
/*.chat-box {*/
/*    !*width: 100%;*!*/
/*    height: 40dvh;*/
/*    max-height: 40dvh;*/
/*    background: white;*/
/*    border-radius: 16px;*/
/*    padding: 16px;*/
/*    box-shadow: 0 10px 30px rgba(0,0,0,0.08);*/

/*    display: flex;*/
/*    flex-direction: column;*/

/*    margin-top: auto;*/
/*}*/
/* Active state */
.chat-box.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) translateY(0);
    padding: 16px;
}

/* ========================= */
/* MOBILE */
/* ========================= */

@media (max-width: 768px) {
    .chat-box {
        width: auto;
        right: 10px;
        left: 10px;
        position: inherit;
        bottom: 140px;
    }

    .chat-launcher {
        position: absolute;
        right: 16px;
        bottom: 50px;
    }

    .chat-label {
        position: absolute;
        right: 90px;
        bottom: 45px;
        top: auto;
    }
}



