* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --light-gray: #f3f4f6;
    --text-color: #374151;
    --message-user-bg: #2563eb;
    --message-bot-bg: #f3f4f6;
    --message-user-text: #ffffff;
    --message-bot-text: #374151;
    --timestamp-color: #9ca3af;
    --border-radius: 18px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    /* Unified background color */
    background-color: #f9fafb;
    min-height: 100vh;
    width: 100vw;
    color: var(--text-color);
    overflow-x: hidden;
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
}

/* Body styling for full-screen chatbot */
body.chatbot-open {
    overflow: hidden;
}

/* Animations for chatbot open/close */
@keyframes chatbotFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes chatbotFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    z-index: 1000;
    /* Full-screen chat positioning */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Chatbot Box - Now always visible and active */
.chatbot-box {
    /* Full screen positioning */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f9fafb; /* Changed to match body background */
    box-shadow: none; /* No shadow needed for full-screen */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 1;
    transform: scale(1);
    transition: var(--transition);
    z-index: 1000;
    animation: chatbotFadeIn 0.5s ease-out; /* Smooth entry animation when page loads */
}

/* Modern Chatbot Header */
.chatbot-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 3;
    height: 60px;
}

/* Brand section */
.header-brand {
    display: flex;
    align-items: center;
}

.header-brand h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Open Sans', sans-serif;
}

/* Header Controls Area */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Icon buttons */
.icon-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.icon-button i {
    font-size: 16px;
}

/* Auth buttons */
.header-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.auth-button i {
    font-size: 14px;
}

.login-button {
    background: rgba(255, 255, 255, 0.15);
}

.register-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Center title in chat area */
.center-title {
    margin: auto;
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    animation: fadeInUp 0.8s ease-out;
    background-color: transparent;
    box-shadow: none;
    border: none;
}

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

@keyframes fadeOutDown {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
        display: none;
    }
}

.center-title h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.center-title p {
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
    color: #4b5563;
    max-width: 500px;
    margin: 0 auto;
}

.close-button {
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.close-button:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.2);
}

.close-button i {
    font-size: 18px;
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    padding: 25px 20px 40px; /* Slightly reduced side padding to feel more like a chat app */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px; /* Slightly reduced gap between messages */
    background-color: #f9fafb;
    /* Add a subtle pattern to increase chatbot feel */
    background-image: linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
    background-size: 25px 25px; /* Create subtle grid pattern */
    background-position: center;
    align-items: center;
}

.message {
    max-width: 750px; /* Slightly reduced width for better readability */
    width: 75%; /* Use percentage width but with a max limit */
    padding: 16px 20px;
    border-radius: 18px;
    margin-bottom: 10px;
    word-wrap: break-word;
    position: relative;
    animation: messageAppear 0.3s forwards;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    font-size: 15px;
    line-height: 1.5;
}

/* Media query for small screens */
@media (max-width: 768px) {
    .message {
        width: 90%; /* Wider on small screens */
        max-width: none;
        margin-bottom: 8px;
    }
}

@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    background-color: #f0f4ff; /* Lighter blue tint for bot messages */
    color: #374151;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;  
    border-bottom-right-radius: 18px;
    margin-right: auto; /* Ensures proper alignment in centered container */
    position: relative;
}

.bot-message:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -6px;
    width: 12px;
    height: 12px;
    background-color: #f0f4ff;
    border-bottom-right-radius: 12px;
}

.bot-message:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -12px;
    width: 12px;
    height: 12px;
    background-color: #f9fafb; /* Match the background color */
    border-bottom-right-radius: 12px;
}

.user-message {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
    margin-left: auto; /* Ensures proper alignment in centered container */
    position: relative;
}

.user-message:before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -6px;
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-bottom-left-radius: 12px;
}

.user-message:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -12px;
    width: 12px;
    height: 12px;
    background-color: #f9fafb; /* Match the background color */
    border-bottom-left-radius: 12px;
}

.message-timestamp {
    font-size: 11px;
    color: var(--timestamp-color);
    margin-top: 5px;
    text-align: right;
    opacity: 0.8;
}

.bot-message .message-timestamp {
    color: #9ca3af;
}

.user-message .message-timestamp {
    color: rgba(255, 255, 255, 0.8);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    align-self: flex-start;
    background-color: #f0f4ff; /* Match the bot message color */
    padding: 14px 20px;
    border-radius: 18px;
    border-bottom-left-radius: 4px; /* Match the bot message shape */
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    min-width: 200px;
}

.typing-indicator:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -6px;
    width: 12px;
    height: 12px;
    background-color: #f0f4ff;
    border-bottom-right-radius: 12px;
}

.typing-indicator:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -12px;
    width: 12px;
    height: 12px;
    background-color: #f9fafb; /* Match the background color */
    border-bottom-right-radius: 12px;
}

/* Thinking message in typing indicator */
.thinking-message {
    font-size: 15px;
    color: #374151;
    font-weight: 500;
    letter-spacing: 0.3px;
    display: inline-block;
    position: relative;
    animation: thinking-text-pulse 2s infinite;
}

@keyframes thinking-text-pulse {
    0% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
    100% { opacity: 0.8; transform: scale(1); }
}

.thinking-message:after {
    content: "...";
    position: relative;
    display: inline-block;
    animation: ellipsis-animation 1.5s infinite;
    margin-left: 2px;
}

@keyframes ellipsis-animation {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

/* Thinking indicator */
.thinking-indicator {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background-color: #f0f4ff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.thinking-text {
    font-size: 15px;
    color: #374151;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: thinking-pulse 2s infinite;
}

@keyframes thinking-pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.7; }
}

.thinking-indicator:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -6px;
    width: 12px;
    height: 12px;
    background-color: #f0f4ff;
    border-bottom-right-radius: 12px;
}

.thinking-indicator:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -12px;
    width: 12px;
    height: 12px;
    background-color: #f9fafb; /* Match the background color */
    border-bottom-right-radius: 12px;
}

/* Glow effect */
.thinking-indicator {
    position: relative;
    animation: thinking-glow 2s infinite alternate;
}

@keyframes thinking-glow {
    from { box-shadow: 0 0 5px rgba(37, 99, 235, 0.2); }
    to { box-shadow: 0 0 10px rgba(37, 99, 235, 0.5); }
}

/* Quick Chat Starters */
.quick-chat-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 30px;
    margin-bottom: 10px;
}

.quick-chat-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    backdrop-filter: blur(3px);
}

.quick-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.quick-chat-button:active {
    transform: translateY(0);
}

.quick-chat-button i {
    color: var(--primary-color);
    font-size: 16px;
}

@media (max-width: 768px) {
    .quick-chat-options {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .quick-chat-button {
        width: 100%;
        max-width: 450px;
    }
}

/* Modern Chatbot Input */
.chatbot-input {
    padding: 15px 25px 20px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
    background-color: transparent;
    border-top: none;
    box-shadow: none;
}

.chatbot-input-inner {
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 5px 5px 5px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(2px);
}

.input-attachment-button {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #9ca3af;
}

.input-attachment-button:hover {
    background-color: #f3f4f6;
    color: var(--primary-color);
    transform: translateY(-1px);
}

.input-attachment-button i {
    font-size: 18px;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    outline: none;
    height: 44px;
    background: transparent;
}

.chatbot-input input:focus {
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Media query for small screens */
@media (max-width: 768px) {
    .chatbot-input {
        padding: 15px;
    }
    
    .chatbot-input-inner {
        max-width: 100%;
    }
    
    .chatbot-input input {
        font-size: 15px;
    }
    
    .input-attachment-button {
        width: 36px;
        height: 36px;
    }
    
    .input-attachment-button i {
        font-size: 16px;
    }
}

.chatbot-input button#send-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.chatbot-input button#send-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.chatbot-input button#send-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.2);
}

.chatbot-input button#send-button i {
    line-height: 1;
}

/* Form Styles */
.insurance-form {
    padding: 25px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background-color: #ffffff;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 800px; /* Better width for full-screen */
}

.insurance-form h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--primary-dark);
    text-align: center;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Radio and Checkbox Alignment */
.radio-group {
    margin-top: 8px; /* Add some space below the label */
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center; /* Vertically center align items */
    margin-bottom: 8px; /* Space between options */
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    margin-right: 8px; /* Space between input and label */
    width: 16px; /* Explicit width */
    height: 16px; /* Explicit height */
    cursor: pointer;
    accent-color: var(--primary-color); /* Style the check/radio dot */
}

.radio-option label,
.checkbox-option label {
    margin-bottom: 0; /* Override default label margin */
    font-weight: 400; /* Normal weight for options */
    flex: 1; /* Allow label to take remaining space */
    cursor: pointer;
}

.error-message {
    color: #dc2626; /* Red color for errors */
    font-size: 12px;
    margin-top: 4px;
}

.submit-button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.submit-button:hover {
    background-color: var(--primary-dark);
}

/* OTP Styles */
.otp-container {
    text-align: center;
}

.otp-container p {
    margin-bottom: 15px;
    font-size: 14px;
}

.otp-input {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.otp-input input {
    width: 40px;
    height: 45px;
    text-align: center;
    font-size: 18px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.otp-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.otp-timer {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.otp-resend button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.otp-resend button:disabled {
    color: #9ca3af;
    cursor: not-allowed;
    text-decoration: none;
}

/* Quote Styles */
.quotes-container {
    padding: 25px;
    border-radius: 12px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 800px; /* Better width for full-screen */
}

.quotes-container h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--primary-dark);
    text-align: center;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
}

.quote-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
}

.quote-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.cheapest-tag {
    position: absolute;
    top: 10px;
    right: -30px;
    background-color: #10b981; /* Green tag */
    color: white;
    padding: 3px 30px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    transform: rotate(45deg);
    transform-origin: top right;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    border-bottom: 1px dashed #e5e7eb;
    padding-bottom: 10px;
}

.company-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.quote-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 3px;
}

.price-period {
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    margin-left: 3px;
}

.company-logo {
    max-width: 80px;
    max-height: 35px;
    object-fit: contain;
    margin-left: 10px;
}

.quote-details {
    margin-bottom: 15px;
}

.quote-feature {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 6px;
}

.quote-feature svg {
    width: 16px;
    height: 16px;
    fill: #10b981; /* Green checkmark */
    margin-right: 6px;
    flex-shrink: 0;
}

.buy-button {
    width: 100%;
    padding: 10px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.buy-button:hover {
    background-color: #1d4ed8;
}

.compare-link {
    text-align: center;
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
    margin-top: 10px;
    text-decoration: underline;
}

.compare-link:hover {
    color: var(--primary-dark);
}
