.chatbot-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    animation: chatbotAppear 0.5s ease forwards;
}
.xyz{
       transform: translateY(20px);
    animation: chatbotAppear 0.5s ease forwards;
}
@keyframes chatbotAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-container.chatbot-minimized {
    transform: translateY(0);
    opacity: 1;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    cursor: pointer;
    /* background: url("/assets/chatbot.gif") no-repeat center center/cover; */
    /* background: url("https://i.pinimg.com/originals/c1/14/12/c114123eb48fc0712b2482264414d9d7.gif") no-repeat center center/cover; */
    /* background: url("https://media.tenor.com/s-aep-TR3UIAAAAM/ayush-ai-assistant.gif") no-repeat center center/cover; */
    /* background: url("https://i.pinimg.com/originals/42/78/76/42787621ed6d40f0c30f0ae423fc572c.gif") no-repeat center center/cover; */
    background: url("https://cdn.dribbble.com/userupload/23934109/file/original-6abc5ca0baf8cb785d4098a1e71901f8.gif")
        no-repeat center center/cover;
    /* background: url("https://i.pinimg.com/originals/40/ac/0e/40ac0e8c778d0cab1996800fc4bc26b0.gif") no-repeat center center/cover; */
    /* background: url("https://cdn.dribbble.com/userupload/23743704/file/original-0034aa5191749c11e4be1a9ba56ec51b.gif") no-repeat center center/cover; */
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.chatbot-container.chatbot-minimized:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.chatbot-container.chatbot-minimized .chatbot-messages,
.chatbot-container.chatbot-minimized .chatbot-input-container {
    display: none;
}

.chatbot-container.chatbot-minimized .chatbot-header {
    border-radius: 50%;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
}

.chatbot-container.chatbot-minimized .chatbot-title {
    display: none;
}

.chatbot-container.chatbot-minimized .chatbot-minimize {
    display: none;
}

.chatbot-container.chatbot-minimized .chatbot-avatar {
    width: 100%;
    height: 100%;
    margin: 0;
    animation: float 3s ease-in-out infinite;
    position: relative;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: visible;
    padding: 15px;
}

.chatbot-container.chatbot-minimized .chatbot-avatar .bot-avatar-img {
    width: 100%;
    height: 100%;
    -o-object-fit: contain;
       object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.chatbot-container.chatbot-minimized .chatbot-avatar:hover .bot-avatar-img {
    transform: scale(1.1) rotate(-5deg);
}

.chatbot-container.chatbot-minimized .chatbot-avatar::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.3),
        transparent 60%
    );
    z-index: 1;
    border-radius: 50%;
}

.chatbot-container.chatbot-minimized .chatbot-avatar::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.chatbot-container.chatbot-minimized .chatbot-avatar .message-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Robot Animation Classes */
.robot-head {
    animation: headBob 3s ease-in-out infinite;
    transform-origin: center;
}

.robot-eye {
    animation: blink 4s infinite;
}

.robot-mouth {
    animation: smile 3s ease-in-out infinite;
}

.robot-antenna {
    animation: antennaWave 2s ease-in-out infinite;
}

.robot-antenna-dot {
    animation: antennaGlow 2s ease-in-out infinite;
}

.message-bubble {
    animation: bubbleFloat 3s ease-in-out infinite;
    transform-origin: center;
}

.message-line {
    animation: linePulse 2s ease-in-out infinite;
}

.message-shine {
    animation: shine 3s ease-in-out infinite;
}

.message-fold {
    animation: foldWave 3s ease-in-out infinite;
    transform-origin: bottom right;
}

@keyframes headBob {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-2px) rotate(2deg);
    }
}

@keyframes blink {
    0%,
    45%,
    55%,
    100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.1);
    }
}

@keyframes smile {
    0%,
    100% {
        transform: scaleX(1);
    }
    50% {
        transform: scaleX(1.1);
    }
}

@keyframes antennaWave {
    0%,
    100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

@keyframes antennaGlow {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bubbleFloat {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-3px) rotate(2deg);
    }
}

@keyframes linePulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shine {
    0%,
    100% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.2;
    }
}

@keyframes foldWave {
    0%,
    100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(2deg);
    }
}

.chatbot-container.chatbot-minimized .chatbot-avatar:hover .message-icon {
    transform: translate(-50%, -50%) scale(1.1) rotate(-5deg);
}

.chatbot-container.chatbot-minimized .chatbot-avatar:hover .message-bubble {
    animation: bubbleFloat 1.5s ease-in-out infinite;
}

.chatbot-container.chatbot-minimized .chatbot-avatar:hover .message-line {
    animation: linePulse 1s ease-in-out infinite;
}

.chatbot-container.chatbot-minimized .chatbot-avatar:hover .message-shine {
    animation: shine 1.5s ease-in-out infinite;
}

.chatbot-container.chatbot-minimized .chatbot-avatar:hover .message-fold {
    animation: foldWave 1.5s ease-in-out infinite;
}

.chatbot-container.chatbot-minimized .chatbot-avatar:hover .robot-head {
    animation: headBob 1.5s ease-in-out infinite;
}

.chatbot-container.chatbot-minimized .chatbot-avatar:hover .robot-eye {
    animation: blink 2s infinite;
}

.chatbot-container.chatbot-minimized .chatbot-avatar:hover .robot-mouth {
    animation: smile 1.5s ease-in-out infinite;
}

.chatbot-header {
    background: linear-gradient(
        135deg,
        var(--color-primary),
        var(--color-secondary)
    );
    padding: 1rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.3s ease;
}

.chatbot-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: white;
    padding: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar img {
    width: 30px;
    height: 30px;
    -o-object-fit: contain;
       object-fit: contain;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.chatbot-status {
    width: 0.5rem;
    height: 0.5rem;
    background: #6ddfff;
    border-radius: 50%;
    margin-left: 0.5rem;
    position: relative;
}

.chatbot-status::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.chatbot-minimize {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chatbot-messages {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fcf8f8;
    scroll-behavior: smooth;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
}

.chatbot-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: messageSlide 0.3s ease-out;
    margin-bottom: 0.5rem;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    background: white;
    color: var(--text-color);
    border: 1px solid var(--color-secondary);
    align-self: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-right: auto;
    border-bottom-left-radius: 5px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 15px;
}
.ai-message {
    background: rgb(214, 214, 214);
    color: var(--text-color);
    border: 1px solid var(--color-secondary);
    align-self: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-right: auto;
    border-bottom-left-radius: 5px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 15px;
}

.bot-message .bot-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-message .bot-avatar img {
    width: 18px;
    height: 18px;
    -o-object-fit: contain;
       object-fit: contain;
}

.bot-message .message-content {
    flex: 1;
    color: black;
}
.ai-message .bot-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message .bot-avatar img {
    width: 18px;
    height: 18px;
    -o-object-fit: contain;
       object-fit: contain;
}

.ai-message .message-content {
    flex: 1;
    color: black;
}

.user-message {
    background: var(--color-primary);
    color: white;
    align-self: flex-end;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    border-bottom-right-radius: 5px;
}

.chatbot-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--color-secondary);
    display: flex;
    gap: 0.5rem;
    position: sticky;
    bottom: 0;
    z-index: 1;
}

.chatbot-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-secondary);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chatbot-send {
    background: var(--color-primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}
.chatbot-container.chatbot-minimized.keyboard-active {
    height: 70px !important;
}
.chatbot-send i {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.chatbot-send:hover {
    background: var(--color-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.chatbot-send:hover i {
    transform: scale(1.1);
}

.chatbot-send:active {
    transform: translateY(0);
}

.chatbot-link {
    color: #1a1a1a;
    text-decoration: underline;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 1rem;
    align-self: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--color-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Ensure messages are properly spaced */
.chatbot-message:last-child {
    margin-bottom: 0;
}

/* Add smooth scroll behavior for new messages */
.chatbot-message {
    scroll-margin-bottom: 1rem;
}

/* Ensure input container stays at bottom */
.chatbot-input-container {
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 1;
    border-top: 1px solid var(--color-secondary);
}

/* Responsive design */
@media (max-width: 480px) {
    /* Original full-screen styles - commented out
    .chatbot-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    */

    /* New mobile styles */
    .chatbot-container {
        width: 90%;
        height: 80vh;
        bottom: 1rem;
        right: 1rem;
        border-radius: 1rem;
        max-width: 380px;
        max-height: 600px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .chatbot-container.chatbot-minimized {
        height: 60px;
        width: 60px;
        border-radius: 50%;
        bottom: 20px;
        right: 20px;
    }

    .chatbot-header {
        padding: 0.75rem;
    }

    .chatbot-title {
        font-size: 1rem;
    }

    .chatbot-input-container {
        padding: 0.75rem;
    }

    .chatbot-input {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .chatbot-send {
        width: 42px;
        height: 42px;
    }

    .chatbot-send i {
        font-size: 1.1rem;
    }
    .chatbot-messages {
        overflow-x: hidden;
    }

    .chatbot-container.keyboard-active {
        height: 50vh !important;
        border-radius: 1rem 1rem 0 0;
    }
    .chatbot-container.chatbot-minimized.keyboard-active {
        height: 70px !important;
        border-radius: 50%;
    }
}

@media (max-width: 360px) {
    /* Original full-screen styles - commented out
    .chatbot-container {
        width: 100%;
    }
    */

    /* New mobile styles */
    .chatbot-container {
        /* width: 85%; */
        height: 75vh;
        bottom: 0.75rem;
        right: 0.75rem;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .chatbot-container.chatbot-minimized {
        height: 50px;
        width: 50px;
        bottom: 15px;
        right: 15px;
    }

    .chatbot-header {
        padding: 0.5rem;
    }

    .chatbot-title {
        font-size: 0.9rem;
        gap: 0.5rem;
    }

    .chatbot-avatar {
        width: 2rem;
        height: 2rem;
    }

    .chatbot-avatar img {
        width: 24px;
        height: 24px;
    }

    .chatbot-input-container {
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .chatbot-input {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }

    .chatbot-send {
        width: 40px;
        height: 40px;
    }

    .chatbot-send i {
        font-size: 1rem;
    }
    .chatbot-messages {
        overflow-x: hidden;
    }

    .chatbot-message {
        padding: 0.6rem 0.75rem;
        font-size: 10px;
    }

    .bot-message .bot-avatar {
        width: 20px;
        height: 20px;
    }

    .bot-message .bot-avatar img {
        width: 16px;
        height: 16px;
    }
    .typing-text {
        font-size: 10px;
    }

    .chatbot-container.keyboard-active {
        height: 50vh !important;
        border-radius: 1rem 1rem 0 0;
    }
}

@media (max-width: 280px) {
    /* Original full-screen styles - commented out
    .chatbot-container {
        width: 100%;
    }
    */

    /* New mobile styles */
    .chatbot-container {
        height: 70vh;
        bottom: 0.5rem;
        right: 0.5rem;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .chatbot-container.chatbot-minimized {
        height: 45px;
        width: 45px;
        bottom: 10px;
        right: 10px;
    }

    .chatbot-header {
        padding: 0.4rem;
    }

    .chatbot-title {
        font-size: 0.8rem;
        gap: 0.4rem;
    }

    .chatbot-avatar {
        width: 1.8rem;
        height: 1.8rem;
    }

    .chatbot-avatar img {
        width: 20px;
        height: 20px;
    }

    .chatbot-input-container {
        padding: 0.4rem;
        gap: 0.2rem;
    }

    .chatbot-input {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }

    .chatbot-send {
        width: 38px;
        height: 38px;
    }

    .chatbot-send i {
        font-size: 0.9rem;
    }

    .chatbot-message {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        max-width: 90%;
    }

    .bot-message .bot-avatar {
        width: 18px;
        height: 18px;
    }

    .bot-message .bot-avatar img {
        width: 14px;
        height: 14px;
    }

    .chatbot-message-tag {
        font-size: 0.7em;
        padding: 3px;
    }

    .terms-text {
        font-size: 0.75rem;
    }

    .chatbot-container.keyboard-active {
        height: 50vh !important;
        border-radius: 1rem 1rem 0 0;
    }
}

.message-logo-animation {
    animation: messageLogoPop 1s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes messageLogoPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.5);
        background: var(--color-primary);
    }
    100% {
        transform: scale(1);
        background: white;
    }
}

.chatbot-container.chatbot-minimized .chat-bubble-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.chatbot-container.chatbot-minimized .bot-avatar-img {
    display: none !important;
}

.chatbot-container:not(.chatbot-minimized) .chat-bubble-icon {
    display: none !important;
}

.chatbot-container:not(.chatbot-minimized) .bot-avatar-img {
    display: block !important;
}

.typing-indicator .typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    width: -moz-fit-content;
    width: fit-content;
}

.typing-indicator .typing-dots .dot {
    width: 6px;
    height: 6px;
    background: #4f46e5;
    border-radius: 50%;
    animation: typing-dot 1.4s infinite ease-in-out;
}

.typing-indicator .typing-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator .typing-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .typing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-dot {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.typing-text {
    display: inline-block;
    min-height: 1.5em;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Mailto link styles */
.typing-text a {
    color: #4f46e5;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.typing-text a:hover {
    color: #4338ca;
    text-decoration: none;
}

.typing-text a:active {
    color: #3730a3;
}

.chatbot-message-tag {
    text-align: center;
    color: #666;
    font-size: 0.8em;
    margin: 10px 0;
    padding: 5px;
    background: #f5f5f5;
    border-radius: 15px;
    width: -moz-fit-content;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* Sending Animation */
.sending-animation {
    position: relative;
    padding-right: 30px;
}

.sending-animation::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: sending-spin 0.8s linear infinite;
}

@keyframes sending-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Error state for user messages */
.user-message.error-message {
    background: #ff4444 !important;
    color: white !important;
    animation: error-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes error-shake {
    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }
    30%,
    50%,
    70% {
        transform: translate3d(-2px, 0, 0);
    }
    40%,
    60% {
        transform: translate3d(2px, 0, 0);
    }
}
.chatbot-terms-notice {
    margin: 20px 0;
    padding: 10px;
    text-align: center;
}

.terms-content {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 20px;
    display: inline-block;
    max-width: 90%;
}

.terms-text {
    color: #a0aec0;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.terms-link {
    color: #4f46e5;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.terms-link:hover {
    color: #6366f1;
}

/* Add animation for the terms notice */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-terms-notice {
    animation: fadeIn 0.5s ease-out;
}

/* Add styles for keyboard active state */
.chatbot-container.keyboard-active {
    height: 50vh !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-container.keyboard-active .chatbot-messages {
    scroll-behavior: smooth;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure messages container maintains scroll functionality */
.chatbot-messages {
    scroll-behavior: smooth;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
}

/* Add padding to ensure last message is visible */
.chatbot-messages::after {
    content: "";
    display: block;
    height: 1rem;
    width: 100%;
}

/* Ensure messages are properly spaced */
.chatbot-message {
    margin-bottom: 0.5rem;
}

.chatbot-message:last-child {
    margin-bottom: 0;
}

/* Ensure input container stays at bottom */
.chatbot-input-container {
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 1;
    border-top: 1px solid var(--color-secondary);
}

/* Terms Agreement Styles */
.terms-agreement {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.terms-content {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.terms-text {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.terms-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.terms-link:hover {
    color: #4338ca;
    text-decoration: underline;
}

.terms-agreement-text {
    font-weight: 500;
    color: #1a202c;
    font-size: 1rem;
    text-align: center;
}

.terms-agreement-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.terms-agreement-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terms-agree-btn {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.terms-agree-btn:hover {
    background: var(--color-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}

.terms-disagree-btn {
    background: #ef4444;
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.terms-disagree-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

/* Service Selection Styles */
.service-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
    padding: 5px;
}

.service-option {
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
    font-weight: 500;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.service-option:hover {
    border-color: var(--color-primary);
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.1);
}

.service-option.selected {
    border-color: var(--color-primary);
    background: #eef2ff;
    color: var(--color-primary);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.15);
}

/* Email Input Styles */
.email-input-container {
    margin: 20px 0;
    padding: 5px;
}

.email-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
    color: #1a202c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
}

.email-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.email-input::-moz-placeholder {
    color: #a0aec0;
}

.email-input::placeholder {
    color: #a0aec0;
}

/* Email error container */
.email-error-container {
    min-height: 0;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.email-error-container:empty {
    min-height: 0;
    margin-bottom: 0;
}

/* Email input error state */
.email-input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

.email-input-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Email error message */
.email-error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.email-error-message::before {
    content: "⚠️";
    font-size: 1rem;
}

.email-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.email-submit-btn {
    flex: 1;
    padding: 14px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.email-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.email-submit-btn:active {
    transform: translateY(0);
}

.email-skip-btn {
    background: #6b7280;
    color: white;
}

.email-skip-btn:hover {
    background: #4b5563;
}

.email-submit-btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.email-submit-btn-primary:hover {
    background: var(--color-secondary);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}

/* Message Tags */
.chatbot-message-tag {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    margin: 15px 0;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 20px;
    width: -moz-fit-content;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .terms-agreement {
        margin: 15px 0;
        padding: 12px;
    }

    .terms-agreement-buttons {
        flex-direction: column;
    }

    .terms-agreement-btn {
        width: 100%;
        justify-content: center;
    }

    .service-selection {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .service-option {
        padding: 12px;
        min-height: 60px;
    }

    .email-input {
        padding: 12px;
        margin-bottom: 10px;
    }

    .email-buttons {
        gap: 8px;
    }

    .email-submit-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .email-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .email-submit-btn {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
    }
}

/* Hide chat input until email is submitted */
.chatbot-input-container.hidden {
    display: none;
}

/* Keyboard Active State */
.chatbot-container.keyboard-active .chatbot-messages {
    max-height: calc(100vh - 300px);
    scroll-behavior: smooth;
}

.chatbot-container.keyboard-active .chatbot-messages:last-child {
    scroll-margin-bottom: 20px;
}

