﻿
/* Content/Chatbot.css */
/* Main Container */
/* Main container should always be bottom-right fixed */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
}

/* Floating Chat Button - Only the GIF visible */
.floating-chat-button {
    background: transparent !important; /* fully transparent */
    border: none !important; /* no border */
    border-radius: 0 !important; /* no shape */
    padding: 0;
    margin: 0;
    cursor: pointer;
    box-shadow: none !important; /* remove shadow */
    outline: none !important;
    position: fixed;
    bottom: 80px; /* adjust as you like */
    right: 20px;
    z-index: 9999;
}

/* Chatbot GIF only */
.chatbot-gif {
    width: 110px; /* increase/decrease as needed */
    height: auto;
    object-fit: contain;
    display: block;
    background: transparent !important; /* remove any image background */
    mix-blend-mode: multiply; /* removes white look if GIF has white bg */
    border: none;
}



/* Chat Window */
.chatbot-wrapper {
    position: absolute; /* make it float inside container */
    bottom: 40px; /* keep above the button */
    right: 0; /* stick to right side */
    width: 320px;
    height: 450px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-icon {
    position: relative;
    z-index: 2;
}

.chat-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
   /* background: rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;*/
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 1;
    }

    70% {
        transform: scale(1.1);
        opacity: 0;
    }

    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.chatbot-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chatbot-subtitle {
    font-size: 10px;
    opacity: 0.8;
    margin: 0;
}

.close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .close-button:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
    }

/* Messages Container */
.chatbot-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Message Styles */
.message {
    display: flex;
    flex-direction: column;
    max-width: 90%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    align-self: flex-end;
}

.bot-message {
    align-self: flex-start;
}

.message-content {
    padding: 10px 12px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: relative;
    box-sizing: border-box;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message-text {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.message-timestamp {
    font-size: 9px;
    opacity: 0.8;
    margin-top: 3px;
    text-align: right;
    color: black;
    font-weight: 600;
}

.user-message .message-timestamp {
    color: black;
    font-weight: 600;
}

/* Links */
.message-links {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 100%;
    flex-wrap: wrap;
}

.message-link {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    white-space: normal;
}

    .message-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
        color: white;
        text-decoration: none;
    }

/* FAQ Section */


.faq-title {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 2px solid #e3f2fd;
    padding-bottom: 5px;
}

.faq-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.faq-button {
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
    color: black;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

    .faq-button:hover {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

    .faq-button:active {
        transform: translateY(0);
    }

/* Yojana Cards */
.yojana-cards-grid {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.yojana-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e0e6ed;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
}

    .yojana-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .yojana-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }

.yojana-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.yojana-name {
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.yojana-id {
    background: #f0f4ff;
    color: #667eea;
    font-size: 12px;
    padding: 2px 5px;
    border-radius: 5px;
    font-weight: 500;
}

.yojana-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.yojana-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

    .yojana-info-row:last-child {
        border-bottom: none;
    }

.info-label {
    font-weight: 600;
    color: #555;
    font-size: 11px;
    flex-shrink: 0;
    margin-right: 6px;
}

.info-value {
    color: #333;
    font-size: 11px;
    text-align: right;
    flex: 1;
}

    .info-value.deadline {
        background: #fff3cd;
        color: #856404;
        padding: 2px 5px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 500;
    }

.yojana-description {
    flex-direction: column;
    align-items: flex-start;
    background: #f8f9ff;
    padding: 8px;
    border-radius: 5px;
    margin-top: 3px;
}

.description-text {
    margin: 5px 0 0 0;
    color: #555;
    font-size: 11px;
    line-height: 1.3;
}

.apply-now-wrapper {
    margin-top: 6px;
    text-align: center;
}

.apply-now-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .apply-now-btn:hover {
        background: #5a67d8;
        transform: translateY(-2px);
    }

/* Form Styles */
.yojana-form {
    background: white;
    border-top: 1px solid #e0e6ed;
    padding: 12px;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

    .form-header h4 {
        color: #667eea;
        font-size: 15px;
        font-weight: 600;
        margin: 0;
    }

.form-close-btn {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

    .form-close-btn:hover {
        background: #ff3742;
        transform: rotate(90deg);
    }

.form-subtitle {
    font-size: 11px;
    color: #666;
    margin-bottom: 12px;
    text-align: center;
    font-style: italic;
}

.form-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.form-input,
.form-select {
    padding: 8px 10px;
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s ease;
    background: white;
}

    .form-input:focus,
    .form-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
        transform: translateY(-1px);
    }

.form-buttons {
    display: flex;
    gap: 6px;
}

.submit-button,
.cancel-button {
    flex: 1;
    padding: 7px 7px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.submit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

    .submit-button:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

.cancel-button {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e6ed;
}

    .cancel-button:hover:not(:disabled) {
        background: #e9ecef;
        border-color: #adb5bd;
    }

    .submit-button:disabled,
    .cancel-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* Quick Actions */
.quick-actions {
    padding: 10px 12px;
    background: white;
    border-top: 1px solid #e0e6ed;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-action-btn {
    flex: 1;
    min-width: 80px;
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    padding: 8px 5px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

    .quick-action-btn.primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-color: transparent;
    }

    .quick-action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }

    .quick-action-btn.primary:hover {
        box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
    }

/* Input Area */
.chatbot-input-area {
    padding: 12px;
    background: white;
    border-top: 1px solid #e0e6ed;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 18px;
    padding: 3px 3px 3px 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

    .input-wrapper:focus-within {
        border-color: #667eea;
        background: white;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    }

.chatbot-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 13px;
    outline: none;
    color: #333;
}

    .chatbot-input::placeholder {
        color: #aaa;
    }

.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

    .send-button:hover:not(:disabled) {
        transform: scale(1.05);
        box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    }

    .send-button:disabled {
        background: #ccc;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* Loading Spinner */
.loading-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 2px;
}

    .chatbot-messages::-webkit-scrollbar-thumb:hover {
        background: rgba(102, 126, 234, 0.7);
    }

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .floating-chat-button {
               width: 95px;
        height: 95px;
        font-size: 18px;
    }

    .chatbot-wrapper {
       /* width: 90vw;
        height: 80vh;
        max-width: none;
        border-radius: 10px;*/
    }

    .chatbot-header {
        padding: 10px;
    }

    .chatbot-logo {
        width: 30px;
        height: 30px;
    }

    .chatbot-title {
        font-size: 14px;
    }

    .chatbot-subtitle {
        font-size: 9px;
    }

    .chatbot-messages {
        padding: 10px;
    }

    .message-content {
        padding: 8px 10px;
    }

    .message-link {
        font-size: 10px;
        padding: 5px 8px;
    }

    .yojana-card {
        padding: 10px;
    }

    .form-grid {
        gap: 8px;
    }

    .quick-actions {
        flex-direction: column;
        gap: 5px;
    }

    .quick-action-btn {
        flex: none;
        min-width: none;
    }
}

@media (max-width: 480px) {
    .chatbot-wrapper {
        width: 100vw;
       /* height: 100vh;
        border-radius: 0;*/
    }

    .chatbot-container {
        bottom: 0;
        right: 0;
    }

    .floating-chat-button {
        bottom: 100px;
        right: 10px;
        width: 90px;
        height: 90px;
        font-size: 16px;
    }

    .form-buttons {
        flex-direction: column;
    }

    .message {
        max-width: 95%;
    }

    .message-link {
        font-size: 9px;
        padding: 4px 6px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
.floating-chat-button:focus,
.close-button:focus,
.faq-button:focus,
.message-link:focus,
.form-input:focus,
.form-select:focus,
.submit-button:focus,
.cancel-button:focus,
.quick-action-btn:focus,
.send-button:focus,
.form-close-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .chatbot-wrapper {
        border: 2px solid #000;
    }

    .message-content {
        border: 1px solid #000;
    }

    .form-input,
    .form-select {
        border: 2px solid #000;
    }

    .message-link {
        border: 1px solid #000;
    }
    /* Chat helper bubble */
    .bot-helper-bubble {
        position: absolute;
        right: 90px; /* distance from button */
        bottom: 50%;
        transform: translateY(50%);
        background: #f0f4ff;
        color: #0052cc;
        font-size: 14px;
        font-weight: 500;
        padding: 10px 16px;
        border-radius: 12px;
        border: 1px solid #0052cc;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        overflow: hidden;
        white-space: nowrap;
        width: auto;
        max-width: 200px;
    }

        /* Typing effect */
        .bot-helper-bubble::after {
            content: '';
            display: inline-block;
            width: 10px;
            height: 1em;
            background-color: #0052cc;
            margin-left: 5px;
            animation: blink 1s infinite;
        }

    @keyframes blink {
        0%, 50%, 100% {
            opacity: 1;
        }

        25%, 75% {
            opacity: 0;
        }
    }

    /* Slide in from left */
    .bot-helper-bubble {
        animation: slideIn 0.5s ease-out forwards;
        opacity: 0;
    }

    @keyframes slideIn {
        from {
            transform: translateY(50%) translateX(50px);
            opacity: 0;
        }

        to {
            transform: translateY(50%) translateX(0);
            opacity: 1;
        }
    }
    .chatbot-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
    }

    .floating-chat-button {
        background: transparent;
        border: none;
        cursor: pointer;
        position: relative;
    }

  

    .bot-helper-bubble {
        background-color: #0078ff;
        color: white;
        font-size: 14px;
        font-weight: 500;
        padding: 10px 16px;
        border-radius: 15px 15px 15px 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        white-space: nowrap;
        animation: fadeInUp 0.6s ease;
        margin-left: 10px;
    }

    .hero-title {
        font-size: 14px;
        margin: 0;
    }

    .hero-prefix {
        font-weight: bold;
    }

    .cursor {
        color: #fff;
        font-weight: bold;
        animation: blink 0.8s infinite;
    }

    @keyframes blink {
        0% {
            opacity: 1;
        }

        50% {
            opacity: 0;
        }

        100% {
            opacity: 1;
        }
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }


}


/* Fullscreen on mobile */
@media (max-width: 767px) {   /* Covers iPhones, Samsung, most mobiles */
 .chatbot-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    z-index: 99999 !important;
  }
}

/* Desktop / Tablet → Small window */
@media (min-width: 768px) {
  .chatbot-wrapper {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 350px !important;   /* small box size */
    height: 500px !important;
    border-radius: 12px !important;
    z-index: 99999 !important;
  }
}
/* Mobile: horizontal buttons full width */
@media (max-width: 768px) {
  .quick-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;       /* if too many, they move to next line */
    width: 100%;
    gap: 8px;
    justify-content: space-between;
  }

  .quick-actions button {
    flex: 1;               /* each button takes equal space */
    min-width: 100px;      /* optional: stops button from shrinking too much */
  }
}

.toggle-btn {
    color: #667eea;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    text-decoration: underline;
}
