/* AI Chatbot Styles */

/* Fullscreen Chat Styles */
.fullscreen-chat-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fullscreen-chat-wrapper.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Main Content Container */
.chat-content-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px 20px;
    background: #f8f9fa;
    max-height: calc(100vh - 120px);
    position: relative;
}

/* Question Section */
.question-section {
    display: none;
    margin-bottom: 20px;
    padding: 20px 25px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    min-height: auto;
    max-height: 150px;
    overflow: hidden;
}

.question-content {
    width: 100%;
    position: relative;
}

.user-question-text {
    color: #03203e;
    font-weight: 600;
    font-size: 18px;
    margin: 0;
    line-height: 1.4;
    padding-right: 50px;
}



.question-loading-spinner {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: none;
}

/* Question Lottie Container */
.question-lottie-container {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-lottie-container svg {
    width: 100% !important;
    height: 100% !important;
}

/* Professional Spinner */
.professional-spinner {
    display: flex;
    gap: 4px;
    align-items: center;
}

.spinner-dot {
    width: 6px;
    height: 6px;
    background: linear-gradient(90deg, #02B4E4, #c10ad7);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.spinner-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Lottie Animation Transitions */
.lottie-loader-wrapper {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

.lottie-loader-wrapper.animate-to-question {
    animation: lottieToQuestion 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes lottieToQuestion {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: scale(0.4) translate(300px, -150px);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.2) translate(600px, -300px);
        opacity: 0;
    }
}

@keyframes moveToQuestion {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: scale(0.6) translate(200px, -100px);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.4) translate(400px, -200px);
        opacity: 0;
    }
}

/* Response waiting spinner - same as question spinner */
.response-waiting-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

.response-waiting-spinner.animate-to-question {
    animation: moveToQuestion 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes moveToQuestion {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: scale(0.6) translate(200px, -100px);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.4) translate(400px, -200px);
        opacity: 0;
    }
}

.response-waiting-spinner .professional-spinner {
    display: flex;
    gap: 6px;
    align-items: center;
}

.response-waiting-spinner .spinner-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(90deg, #02B4E4, #c10ad7);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.response-waiting-spinner .spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.response-waiting-spinner .spinner-dot:nth-child(2) { animation-delay: -0.16s; }

/* Answer Section */
.answer-section {
    margin-bottom: 30px;
}

.answer-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    min-height: 200px;   /* Increased from 120px */
    max-height: 60vh;    /* Flexible height, takes 60% of viewport */
    overflow-y: auto;
    position: relative;
    z-index: 1; /* Ensure it sits above backgrounds but below close button */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


.answer-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.answer-container p {
    color: #2c3e50;
    line-height: 1.7;
    font-size: 16px;
    margin-bottom: 1rem;
}

.answer-container p strong {
    color: #02B4E4;
    font-weight: 600;
}

/* Bottom Input Section */
.bottom-input-section {
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    padding: 20px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.05);
}

.follow-up-container {
    max-width: 100%;
}

.follow-up-form {
    width: 100%;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    padding: 8px 8px 8px 24px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #02B4E4;
    box-shadow: 0 0 0 3px rgba(2, 180, 228, 0.1);
}

.follow-up-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 16px;
    color: #2c3e50;
    outline: none;
}

.follow-up-input::placeholder {
    color: #6c757d;
}

.submit-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(90deg, #02B4E4, #c10ad7);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.submit-btn:hover {
    background: linear-gradient(-90deg, #02B4E4, #c10ad7);
    transform: scale(1.05);
}

.initial-chat-box {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.initial-chat-box.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.suggestion-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.suggestion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

.close-conversion {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 1.5rem;
    background: linear-gradient(90deg, #02B4E4, #c10ad7);
    /* Theme gradient background - same as header buttons */
    cursor: pointer;
    transition: all 0.3s;
    /* Same transition as theme */
    z-index: 10000;
    border: none;
    border-radius: 50%;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.close-conversion:hover {
    background: linear-gradient(-90deg, #02B4E4, #c10ad7);
    /* Reverse gradient on hover - same as header .lone_btn */
    transform: scale(1.05);
    /* Same scale as theme buttons */
}

.close-conversion i {
    color: white !important;
    /* White X icon */
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s;
    /* Smooth transition for icon */
}

/* Loading Spinner and Lottie Animation */
.loading-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: 60px 40px;
}

.lottie-loader-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 1;
    transform: scale(1);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.lottie-loader-wrapper.animate-out {
    opacity: 0;
    transform: scale(0.3) translateY(-100px);
}

.lottie-loader {
    width: 120px;
    height: 120px;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.spinner-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 60px 40px;
    opacity: 1;
    transform: scale(1);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.spinner-wrapper.animate-out {
    opacity: 0;
    transform: scale(0.3) translateY(-100px);
}

.spinner {
    border: 4px solid rgba(2, 180, 228, 0.1);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border-left-color: #02B4E4;
    border-top-color: #c10ad7;
    animation: spin 1s ease infinite;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-text {
    color: #606060;
    font-weight: 300;
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    opacity: 0.6;
}

/* Small loading icon for question area */
.question-loading-icon {
    width: 24px;
    height: 24px;
    margin-left: 15px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-loading-icon.visible {
    opacity: 1;
    transform: scale(1);
}

.question-loading-icon .mini-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(2, 180, 228, 0.2);
    border-radius: 50%;
    border-left-color: #02B4E4;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Response Animation */
.descriptive-answer {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    font-size: 16px;
    line-height: 1.7;
    position: relative;
    z-index: 5;
    min-height: 100px; /* Ensure it has space to show loading */
}

.descriptive-answer.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Typing cursor */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #02B4E4;
    /* Theme color for cursor */
    animation: blink 0.8s infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Input styling in fullscreen */
.bottom-content-wrap .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 15px;
}

.bottom-content-wrap .form-control:focus {
    border-color: #02B4E4;
    box-shadow: 0 0 0 0.2rem rgba(2, 180, 228, 0.25);
}

.bottom-content-wrap .btn i {
    color: #02B4E4;
    /* Theme color for send icon */
}

/* Close button styling */
.close-conversion {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 1.5rem;
    background: linear-gradient(90deg, #02B4E4, #c10ad7);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10000;
    border: none;
    border-radius: 50%;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.close-conversion:hover {
    background: linear-gradient(-90deg, #02B4E4, #c10ad7);
    transform: scale(1.05);
}

.close-conversion i {
    color: white !important;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-content-container {
        padding: 60px 15px 15px;
    }
    
    .question-section,
    .answer-container {
        padding: 20px;
        border-radius: 15px;
    }
    
    .user-question-text {
        font-size: 20px;
    }
    
    .question-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .bottom-input-section {
        padding: 20px 15px;
    }
    
    .input-wrapper {
        padding: 6px 6px 6px 20px;
    }
    
    .follow-up-input {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .submit-btn {
        width: 40px;
        height: 40px;
    }
    
    .close-conversion {
        top: 15px;
        right: 20px;
        width: 35px;
        height: 35px;
    }
}

/* Enhanced Response Content Styling for Markdown */
.response-content {
    line-height: 1.6;
    color: #333;
}

.response-content h1, .response-content h2, .response-content h3 {
    color: #02B4E4;
    margin: 16px 0 12px 0;
    font-weight: 600;
}

.response-content p {
    margin-bottom: 16px;
}

.response-content ol, .response-content ul {
    margin: 16px 0;
    padding-left: 0;
    list-style: none;
}

.response-content ol li {
    margin-bottom: 8px;
    line-height: 1.5;
    position: relative;
    padding-left: 0;
}

.response-content ul li {
    margin-bottom: 8px;
    line-height: 1.5;
    position: relative;
    padding-left: 20px;
}

.response-content ul li:before {
    content: "•";
    color: #02B4E4;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Ensure bold text is properly styled */
strong {
    color: linear-gradient(90deg, #02B4E4, #c10ad7);
    font-weight: 600;
}

.response-content strong,
.answer-container strong {
    color: #02B4E4 !important;
    font-weight: 600 !important;
}

.response-content em {
    font-style: italic;
    color: #666;
}

.response-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.response-content blockquote {
    border-left: 4px solid #02B4E4;
    margin: 16px 0;
    padding-left: 16px;
    color: #666;
    font-style: italic;
}


