* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    gap: 10px;
}

:root {
    --primary-gradient: linear-gradient(135deg, #29A5DD, #1e8cc4);
    --secondary-gradient: linear-gradient(135deg, #2c3e50, #34495e);
    --danger-gradient: linear-gradient(135deg, #dc2626, #b91c1c);
    --bg-light: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    --white: #fff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-light: #e2e8f0;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-primary: rgba(41, 165, 221, 0.3);
    --success: #10b981;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.2);
}

/* Chatbot Launcher */
.chatbot-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.launcher-text {
    background: var(--secondary-gradient);
    color: var(--white);
    padding: 10px 18px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    display: flex;
    align-items: center;
    opacity: 1;
    transform: translateY(0);
    transition: var(--transition);
    animation: floatBounce 3s ease-in-out infinite;
}

.launcher-text.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

/* Animations */
@keyframes floatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes wave {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-15deg); }
}

@keyframes statusPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typingPulse {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--white);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

/* Launcher Icon */
.launcher-icon {
    background: var(--primary-gradient);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 24px var(--shadow-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.launcher-icon:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 30px rgba(41, 165, 221, 0.5);
}

.launcher-icon.active {
    background: var(--danger-gradient);
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.4);
}

.launcher-icon.active:hover {
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.5);
}

.launcher-pulse {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(41, 165, 221, 0.4);
    animation: pulse 2s ease-out infinite;
    z-index: 1;
}

/* Chatbot Window */
#chatbot-window {
    position: fixed;
    bottom: 20px;
    right: 50px;
    width: min(400px, calc(100vw - 40px));
    height: min(650px, calc(100vh - 120px));
    background: var(--white);
    border-radius: 15px;
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: var(--transition);
}

#chatbot-window.active {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

#chatbot-window.minimized {
    height: auto;
    min-height: 0;
    overflow: hidden;
}

#chatbot-window.minimized #chatbot-messages,
#chatbot-window.minimized .chatbot-footer {
    display: none;
}

/* Header */
.chatbot-header {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 0;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.header-content {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.header-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.2) 0, transparent 60%);
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-arrow {
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-arrow:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-2px);
}

/* Bot Profile */
.bot-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border: 2px solid var(--white);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

.bot-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.bot-info p {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s ease-in-out infinite;
}

/* Header Controls */
.header-controls {
    display: flex;
    gap: 6px;
}

.control-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* Messages Area */
#chatbot-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    min-height: 0;
}

#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: var(--text-light);
}

/* Message Groups */
.message-group {
    display: flex;
    flex-direction: column;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sender-label {
    display: none;
}

.bot-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--shadow-primary);
}

.bot-avatar-img {
    width: 33px;
    height: 36px;
    object-fit: contain;
}

.bot-avatar-img {
    border-radius: 50%;
}


/* Message Bubbles */
.message-bubble {
    padding: 10px 10px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    max-width: 75%;
    position: relative;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
}

.bot-bubble {
    background: var(--white);
    color: var(--text-dark);
    box-shadow: 0 2px 8px var(--shadow-light);
    border: 1px solid var(--border-light);
}

.bot-bubble .message-time {
    color: var(--text-light);
}

.user-bubble {
    background: var(--primary-gradient);
    color: var(--white);
    margin-left: auto;
    box-shadow: 0 2px 8px var(--shadow-primary);
}

.user-bubble .message-time {
    color: white;
}

.user-message .message-wrapper {
    justify-content: flex-end;
}

.user-message .message-content {
    align-items: flex-end;
}

.wave-emoji {
    font-size: 18px;
    display: inline-block;
    animation: wave 0.6s ease-in-out;
}

/* Message Elements */
.message-time {
    font-size: 12px;
    color: inherit;
    opacity: 0.7;
    margin-top: 0px;
    align-self: flex-end;
    white-space: nowrap;
}

.bubble-content {
    word-break: break-word;
}

.bubble-content strong,
.bubble-content b {
    font-weight: 600;
}

/* RTL Support for Urdu/Arabic */
.message-bubble[dir="rtl"] .bubble-content {
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

.message-bubble[dir="rtl"] {
    direction: rtl;
}

.message-bubble[dir="rtl"] .message-time {
    align-self: flex-start;
}

/* Mixed language support */
.bubble-content {
    unicode-bidi: plaintext;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    cursor: pointer;
}

.tag {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: #0369a1;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #bae6fd;
}

/* Quick Suggestions */
.quick-suggestions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeInUp 0.6s ease-out;
}

.suggestions-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    padding: 10px;
}

.suggestion-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.suggestion-card:hover {
    background: var(--primary-gradient);
    color: var(--white);
    border-color: #29A5DD;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-primary);
}

.suggestion-card:hover img {
    fill: var(--white);
    background-color: var(--white);
}

.suggestion-card svg {
    width: 24px;
    height: 24px;
    fill: #29A5DD;
    transition: var(--transition);
}

.suggestion-card:hover svg,
.suggestion-card:hover svg path {
    fill: var(--white);
}

.card-content {
    flex: 1;
}

.card-content h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: inherit;
}

.card-content p {
    margin: 4px 0 0;
    font-size: 13px;
    color: inherit;
    opacity: 0.8;
}

/* Form Styles */
#user-info-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.form-input {
    background: #f8fafc;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text-dark);
    outline: none;
    transition: var(--transition);
    width: 100%;
    font-family: inherit;
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-input:focus {
    border-color: #29A5DD;
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(41, 165, 221, 0.1);
}

#submit-info {
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px var(--shadow-primary);
}

#submit-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 165, 221, 0.4);
}

#submit-info:active {
    transform: translateY(0);
}

/* reCAPTCHA container spacing */
#recaptcha-container {
    margin: 6px 0;
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
}

/* Footer */
.chatbot-footer {
    background: var(--white);
    padding: 16px 20px 12px;
    border-top: 1px solid var(--border-light);
    position: relative;
    flex-shrink: 0;
}

.footer-gradient {
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
}

.input-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    background: #f8fafc;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 8px 12px;
    gap: 8px;
    transition: var(--transition);
    margin-bottom: 8px;
}

.input-container:focus-within {
    border-color: #29A5DD;
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(41, 165, 221, 0.1);
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.input-container textarea {
    border: none;
    background: transparent;
    padding: 8px 0;
    /* padding-right: 8px; */
    font-size: 14px;
    outline: none;
    color: var(--text-dark);
    resize: none;
    line-height: 1.5;
    max-height: 160px;
    width: 100%;
    font-family: inherit;
}

.input-container textarea::placeholder {
    color: var(--text-light);
}

.send-btn {
    background: var(--primary-gradient);
    color: var(--white);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    border: none;
    box-shadow: 0 2px 8px var(--shadow-primary);
    align-self: flex-end;
    margin-bottom: 2px;
}

.send-btn:hover {
    box-shadow: 0 4px 12px rgba(41, 165, 221, 0.4);
}


.send-btn:disabled {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.footer-branding {
    text-align: center;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 8px;
}

.footer-branding strong {
    color: #29A5DD;
    font-weight: 600;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    max-width: 80px;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-light);
    animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Bot Message Styling */
.bot-bubble a.bot-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #93c5fd;
    transition: all 0.2s ease;
    cursor: pointer;
    word-break: break-all;
}

.bot-bubble a.bot-link:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
    border-bottom-color: #2563eb;
    border-radius: 3px;
    padding: 1px 3px;
}

.bot-bubble strong {
    color: #29A5DD;
    font-weight: 700;
}

.bot-bubble .bot-heading {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 12px 0 8px;
    line-height: 1.3;
}

.bot-bubble ul.bot-list {
    margin: 8px 0;
    padding-left: 0;
    list-style: none;
}

.bot-bubble .bot-list-item {
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
}

.bot-bubble .bot-list-item::before {
    content: "•";
    color: #29A5DD;
    font-weight: 700;
    font-size: 18px;
    position: absolute;
    left: 0;
    top: 0;
}

.bot-bubble ol.bot-list {
    padding-left: 20px;
}

.bot-bubble ol.bot-list .bot-list-item::before {
    content: none;
}

.bot-bubble .bot-paragraph {
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.5;
    margin: 8px 0;
}

.bot-bubble blockquote.bot-quote {
    margin: 12px 0;
    padding: 10px 12px;
    border-left: 3px solid #29A5DD;
    background: #f8fafc;
    color: var(--text-dark);
}

.bot-bubble pre.bot-code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: var(--radius-md);
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 12px 0;
}

.bot-bubble code.bot-inline-code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 767px) {
    #chatbot-window {
        width: 80vw;
        height: 70vh;
        bottom: 90px;
        right: 50px;
    }
    
    .message-bubble {
        max-width: 75%;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}