/* css/main.css - Main stylesheet */

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw;
    height: 100vh;
    font-family: 'Avenir Next', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: #f8fbfd;
    overflow: hidden;
}

.gradient-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 45% at 20% 5%, rgba(39, 198, 221, 0.18) 0%, transparent 80%),
        radial-gradient(ellipse 45% 30% at 80% 8%, rgba(103, 71, 254, 0.16) 0%, transparent 81%),
        radial-gradient(ellipse 65% 50% at 52% 13%, rgba(143, 225, 233, 0.14) 0%, transparent 85%),
        linear-gradient(to bottom, #e9f6fd 0%, #f8fbfd 100%);
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 102;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 2.5rem 0.7rem 1.7rem;
    background: rgba(255, 255, 255, 0.87);
    box-shadow: 0 2px 8px 0 rgba(40, 80, 120, 0.05);
    border-bottom: 1px solid #e9eef2;
}

.navbar .logo img {
    height: 80px;
    width: auto;
}

.nav-items {
    display: flex;
    align-items: center;
    gap: 1.3rem;
}

.nav-link {
    font-size: 1.02rem;
    color: #22313b;
    text-decoration: none;
    padding: 0.32em 1em;
    border-radius: 18px;
    transition: background 0.15s, color 0.15s;
    font-weight: 500;
}

.nav-link.active,
.nav-link:hover {
    background: #eaf6fc;
    color: #1191aa;
}

.nav-link.button {
    background: #eaf6fc;
    color: #1191aa;
    border: 1px solid #b4e2f3;
    font-weight: 600;
    padding: 0.32em 1.3em;
    margin-left: 0.7rem;
    border-radius: 18px;
}

.nav-link.button:hover {
    background: #1bc1dd;
    color: #fff;
    border: 1px solid #1bc1dd;
}

.nav-profile {
    margin-left: 1.5rem;
    font-size: 1.4rem;
    color: #1191aa;
    border-radius: 50%;
    background: #eaf6fc;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.13s;
    border: 1px solid #dbeffa;
}

.nav-profile:hover {
    background: #dbeffa;
}

/* ========== HERO / CENTER AREA ========== */
.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: calc(100vh - 80px);
    padding-top: 80px;
    position: relative;
    z-index: 2;
    overflow: hidden;
    transition: all 0.3s ease;
}

.hero-chat-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 640px;
    height: 100%;
    background: none;
    transition: all 0.6s cubic-bezier(.5, 0, .21, 1.05);
    opacity: 1;
    transform: translateY(-200px);
    justify-content: center;
    position: relative;
}

.hero-chat-area.chat-active {
    transform: translateY(-20px);
    justify-content: flex-start;
    padding-top: 0;
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
}

.hero-title {
    font-size: 2.7rem;
    font-weight: 700;
    margin: 0 0 1.1rem 0;
    color: #232323;
    letter-spacing: -1px;
    transition: all 0.5s cubic-bezier(.5, 0, .21, 1.05);
}

.hero-title.chat-active {
    opacity: 0;
    transform: scale(0.9);
}

.hero-title .accent {
    color: #1191aa;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.32rem;
    font-weight: 400;
    color: #232323;
    margin-bottom: 1.4rem;
    transition: all 0.5s cubic-bezier(.5, 0, .21, 1.05);
    opacity: 1;
    text-align: center;
}

.hero-subtitle.chat-active {
    opacity: 0;
    transform: scale(0.9);
}

.hero-subtitle .accent {
    color: #187aa6;
    font-weight: 600;
}

.hero-subtitle.word-changing {
    transform: translateY(-1px);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* ========== CHAT BUBBLES ========== */
.chat-content {
    width: 100%;
    max-width: 600px;
    margin-bottom: 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(.5, 0, .21, 1.05);
    perspective: 1000px;
    overflow: hidden;
}

.chat-content.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    flex: 1;
    min-height: 0;
    margin-bottom: 0.5rem;
}

.chat-messages-container {
    position: relative;
    flex: 1;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
}

.chat-bubble {
    width: 100%;
    margin: 0.4rem 0;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 1.09rem;
    box-shadow: 0 2px 7px rgba(24, 99, 158, 0.04);
    position: relative;
    word-break: break-word;
    transform-style: preserve-3d;
    transform-origin: center center;
    transition: all 0.3s ease-out;
}

.chat-bubble.user {
    background: #1191aa;
    color: #fff;
    align-self: flex-end;
    max-width: 85%;
}

.chat-bubble.bot {
    background: #eaf6fc;
    color: #1e2326;
    align-self: flex-start;
    max-width: 95%;
}

.chat-bubble.typing {
    background: #eaf6fc;
    color: #1e2326;
    align-self: flex-start;
    max-width: 95%;
    animation: pulse 1.5s infinite;
}

.chat-bubble.typing .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1191aa;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.chat-bubble.typing .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.chat-bubble.typing .dot:nth-child(2) {
    animation-delay: -0.16s;
}

.chat-bubble.typing .dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing {
    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ========== FORMS (chatbot demo, etc) ========== */
.chat-form-container {
    margin: 15px 0;
    padding: 20px;
    background: #f8fbfd;
    border: 1.5px solid #b4e2f3;
    border-radius: 12px;
    animation: slideInForm 0.4s ease-out;
}

@keyframes slideInForm {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-form-container form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-form-container label {
    font-weight: 600;
    color: #1191aa;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.chat-form-container input,
.chat-form-container select {
    padding: 10px 12px;
    border: 1px solid #c2e5f4;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-form-container input:focus,
.chat-form-container select:focus {
    border-color: #1191aa;
    box-shadow: 0 0 0 3px rgba(17, 145, 170, 0.1);
}

.chat-form-container button {
    padding: 12px 20px;
    background: #1191aa;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.chat-form-container button:hover {
    background: #1bc1dd;
    transform: translateY(-1px);
}

.chat-form-container button:active {
    transform: translateY(0);
}

/* ========== CHAT INPUT (NEW STYLE!) ========== */
.input-section {
    width: 100%;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: all 0.6s cubic-bezier(.5, 0, .21, 1.05);
    transform: translateY(0);
    position: relative;
}

.input-section.chat-active {
    margin-top: auto;
    padding-bottom: 1rem;
    gap: 0.6rem;
    position: sticky;
    bottom: 0;
    background: rgba(248, 251, 253, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px 12px 0 0;
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
}

/* Clean, modern chat input box with animated cursor and icon button */
.demo-input-box {
    width: 100%;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.demo-input-line {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    min-height: 52px;
    border-bottom: 2.5px solid #1191aa;
    background: transparent;
    transition: border-color 0.23s cubic-bezier(.5, 0, .21, 1.05);
    padding-right: 54px;
    /* for button */
    overflow: hidden;
}

.demo-input-line:focus-within {
    border-color: #1bc1dd;
}

.demo-input-line input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.17rem;
    font-family: inherit;
    color: #222;
    padding: 10px 0 10px 2px;
    padding-right: 44px;
    /* never let text overlap button */
    min-width: 0;
    box-shadow: none !important;
    z-index: 2;
    position: relative;
    caret-color: transparent !important;
    /* Hide default caret */
}

.chat-cursor {
    display: inline-block;
    width: 2px;
    height: 1.5em;
    background: #1bc1dd;
    border-radius: 2px;
    animation: pulse-cursor 1s infinite;
    position: absolute;
    z-index: 6;
    pointer-events: none;
    opacity: 1;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    transition: left 0.09s cubic-bezier(.5, 0, .21, 1.05);
}

@keyframes pulse-cursor {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.25;
    }
}

/* Button stays 100% locked in place, no shift ever */
.chat-send-btn,
.chat-send-btn:active,
.chat-send-btn:focus,
.chat-send-btn:hover {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 34px;
    width: 34px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    box-shadow: none;
    outline: none;
}

.chat-send-btn img {
    height: 26px;
    width: 26px;
    display: block;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

/* ========== RESPONSIVE TWEAKS ========== */
@media (max-width: 800px) {
    .center-content {
        height: calc(100vh - 80px);
        padding-top: 80px;
    }

    .hero-chat-area,
    .input-section {
        max-width: 99vw;
    }

    .hero-chat-area.chat-active {
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }

    .chat-bubble {
        max-width: 97vw;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.1rem;
    }

    .hero-title.chat-active {
        font-size: 1.4rem;
    }

    #bot-toggle-container {
        margin: 12px auto 0 auto;
        text-align: center;
        max-width: 100%;
    }
}

/* ========== WORD FLIPPER ANIMATION ========== */
.animated-word-container {
    display: inline-block;
    white-space: nowrap;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    min-width: 7.5em; /* Fixed width to prevent text shifting - fits longest word "personable." */
    text-align: left; /* Align words to left within the fixed container */
}

.animated-word {
    display: inline;
    color: #187aa6;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: normal;
    word-spacing: normal;
}

.letter {
    display: inline-block;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    will-change: transform;
    vertical-align: baseline;
    margin: 0;
    padding: 0;
    letter-spacing: inherit;
    perspective: 1000px;
}

.letter.flipping {
    transform: rotateY(180deg);
}

.letter-front,
.letter-back {
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.letter-front {
    transform: rotateY(0deg);
    position: relative;
}

.letter-back {
    transform: rotateY(180deg);
}

.wf-letter {
    display: inline-block;
    transition: opacity 0.44s cubic-bezier(.77, .01, .3, 1), transform 0.44s cubic-bezier(.77, .01, .3, 1);
    will-change: opacity, transform;
    font-variant-ligatures: none;
}

.wf-in {
    opacity: 1;
    transform: none;
}

.wf-out {
    opacity: 0;
    transform: rotateX(-60deg) scale(0.8);
}