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

:root {
    --primary-color: #22884c;
    --primary-hover: #1a6b3d;
    --secondary-color: #f0f9f4;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
    --shadow: 0 4px 20px rgba(0,0,0,0.15);
    --radius: 16px;
    --font-size-base: 18px;
    --font-size-large: 20px;
    --font-size-xl: 24px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #ffffff;
    color: var(--text-color);
    line-height: 1.6;
    font-size: var(--font-size-base);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
}

.welcome-text {
    text-align: center;
    color: #666;
    font-size: var(--font-size-large);
    max-width: 600px;
}

.welcome-text h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 32px;
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    font-family: inherit;
}

/* Chat Toggle Button */
.chat-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chat-toggle:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

.chat-toggle:active {
    transform: scale(0.95);
}

.chat-toggle svg {
    width: 35px;
    height: 35px;
}

.chat-toggle .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 90vw;
    max-width: 450px;
    height: 70vh;
    max-height: 600px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid var(--primary-color);
}

.chat-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

/* Chat Header */
.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chat-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.chat-title {
    font-size: var(--font-size-large);
    font-weight: 600;
}

.chat-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255,255,255,0.2);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--light-gray);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 85%;
    padding: 15px 18px;
    border-radius: 18px;
    font-size: var(--font-size-base);
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    background: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    color: var(--text-color);
}

.message.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: white;
    padding: 20px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.typing-indicator.active {
    display: flex;
    gap: 6px;
}

.typing-dot {
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

/* Options/Buttons */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    animation: fadeIn 0.4s ease;
}

.option-btn {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 16px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: var(--font-size-base);
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.option-btn:hover {
    background: var(--secondary-color);
    transform: translateX(5px);
}

.option-btn:active {
    transform: scale(0.98);
}

.option-btn.selected {
    background: var(--primary-color);
    color: white;
}

.option-btn .arrow {
    font-size: 20px;
    opacity: 0.6;
}

/* Checkbox Options for Multi-select */
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: var(--font-size-base);
}

.checkbox-option:hover {
    border-color: var(--primary-color);
    background: var(--secondary-color);
}

.checkbox-option input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-option.selected {
    border-color: var(--primary-color);
    background: var(--secondary-color);
}

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

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34,136,76,0.3);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Location Results */
.location-result {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.location-result h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: var(--font-size-large);
}

.location-result p {
    color: #666;
    font-size: 16px;
    margin: 4px 0;
}

.phone-link {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 10px;
    font-weight: 600;
    transition: all 0.2s;
}

.phone-link:hover {
    background: var(--primary-hover);
}

/* Restart Button */
.restart-btn {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
    transition: all 0.2s;
}

.restart-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Mobile Optimizations */
@media (max-width: 600px) {
    .chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        z-index: 9999;
    }

    .chat-widget {
        bottom: 100px;
        right: 15px;
    }

    :root {
        --font-size-base: 20px;
        --font-size-large: 22px;
    }

    .option-btn {
        padding: 18px;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

*:focus {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .message.bot {
        border: 2px solid #000;
    }
    .option-btn {
        border-width: 3px;
    }
}

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