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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    overflow-x: hidden;
}

.main-content {
    min-height: 100vh;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.info {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.chat-widget.open {
    transform: translateY(0);
    opacity: 1;
}

.chat-header {
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-weight: bold;
    font-size: 14px;
}

.chat-title {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
}

.chat-back,
.chat-menu {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-back:hover,
.chat-menu:hover {
    background: rgba(255,255,255,0.3);
}

.chat-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
}

/* Pre-Chat Form */
.pre-chat-content {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background: white;
}

.pre-chat-content h3 {
    text-align: center;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
}

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

.form-group label {
    display: block;
    color: #34495e;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #dc3545;
}

.form-group select {
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.btn-continue {
    background: #dc3545;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 48px;
}

.btn-continue:hover {
    background: #c82333;
}

.btn-continue:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.form-hint {
    text-align: center;
    color: #7f8c8d;
    font-size: 12px;
    margin-top: 15px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: white;
}

/* Quick Reply Buttons */
.quick-replies {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    max-height: 150px;
    overflow-y: auto;
}

.quick-replies.hidden {
    display: none;
}

.quick-reply-btn {
    background: white;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

.quick-reply-btn:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.quick-reply-btn:active {
    transform: translateY(0);
}

.message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 90%;
    animation: fadeIn 0.3s ease;
    margin-bottom: 2px;
    overflow: visible;
}

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

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

.bot-message {
    align-self: flex-start;
    align-items: flex-start;
    justify-content: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.35;
    word-wrap: break-word;
    position: relative;
    overflow: visible;
}

.user-message .message-content {
    background: white;
    color: #2c3e50;
    border: 1px solid #e0e0e0;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.bot-message .message-content {
    background: #dc3545;
    color: white;
    border: none;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

/* Style bullet points and lists in bot messages */
.bot-message .message-content ul,
.bot-message .message-content ol {
    margin: 8px 0;
    padding-left: 20px;
    padding-right: 4px;
    list-style-position: outside;
    overflow: visible;
}

.bot-message .message-content li {
    margin: 6px 0;
    padding-left: 4px;
    padding-right: 4px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow: visible;
}

/* Icon-aligned info lists (for contact/location/hours blocks) */
.bot-message .message-content ul.info-list {
    list-style: none;
    padding-left: 0;
    margin: 8px 0;
    padding-right: 4px;
}

.bot-message .message-content ul.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0;
    padding: 4px 8px;
    padding-left: 4px;
    padding-right: 4px;
    overflow: visible;
}

.bot-message .message-content ul.info-list .icon {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
    font-size: 16px;
}

.bot-message .message-content ul.info-list .text {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

/* Style headings and paragraphs in bot messages */
.bot-message .message-content h3 {
    margin: 12px 0 8px 0;
    font-size: 15px;
    font-weight: 700;
    padding: 0 4px;
}

.bot-message .message-content h3:first-child {
    margin-top: 0;
}

.bot-message .message-content p {
    margin: 8px 0;
    padding: 0 4px;
    line-height: 1.6;
}

.bot-message .message-content strong {
    font-weight: 700;
}

/* Style overall bot message typography */
.bot-message .message-content {
    font-size: 13px;
}

/* Compact headings and paragraphs in bot messages (for model-generated HTML) */
.bot-message .message-content h3 {
    margin: 3px 0 1px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #ffe6ea;
}

.bot-message .message-content p {
    margin: 1px 0 2px;
    font-size: 13px;
    line-height: 1.35;
}

.bot-message .message-content::before {
    content: '';
    display: inline-block;
    margin-right: 4px;
}

/* Message meta (time + status) */
.message-meta {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #000000;
    padding: 0 2px;
    width: auto;
}

.user-message .message-meta {
    text-align: right;
}

.bot-message .message-meta {
    text-align: left;
}

/* Chat Input */
.chat-input-container {
    display: flex;
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    background: #f9f9f9;
}

.chat-input:focus {
    border-color: #dc3545;
    background: white;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.chat-input::placeholder {
    color: #999;
}

.send-button {
    background: #dc3545;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.send-icon {
    display: block;
    transform: translateX(1px) rotate(-45deg);
    font-weight: 700;
}

.send-button:hover:not(:disabled) {
    background: #c82333;
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.4);
}

.send-button:active:not(:disabled) {
    transform: scale(0.98);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Chat Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 999;
    transition: all 0.3s ease;
}

.chat-toggle:hover {
    background: #c82333;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.5);
    transform: translateY(-2px);
}

.chat-toggle.hidden {
    display: none;
}

.chat-icon {
    font-size: 20px;
}

/* Loading Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

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

.chat-messages::-webkit-scrollbar-track,
.pre-chat-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover,
.pre-chat-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-widget {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-toggle {
        bottom: 15px;
        right: 15px;
        padding: 14px 20px;
        font-size: 14px;
    }
}

