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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f2b4a 0%, #1a4c7d 50%, #1565a0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#chat-container {
    width: 100%;
    max-width: 560px;
    height: 92vh;
    max-height: 750px;
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

/* Header */
#chat-header {
    background: linear-gradient(135deg, #1a4c7d, #66bed2);
    color: white;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.logo-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    backdrop-filter: blur(10px);
}

.header-text h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-text p {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Messages */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

#chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

.message {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: fadeIn 0.3s ease;
}

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

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #1a4c7d, #66bed2);
    color: white;
}

.message.user .message-avatar {
    background: #f1f5f9;
    color: #64748b;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.65;
}

.message.bot .message-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #1a4c7d, #2563a0);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble strong {
    color: #1a4c7d;
    font-weight: 600;
}

.message.user .message-bubble strong {
    color: #93c5fd;
}

.message-bubble ul, .message-bubble ol {
    margin: 8px 0;
    padding-left: 18px;
}

.message-bubble li {
    margin-bottom: 4px;
}

.message-bubble em {
    font-style: italic;
    opacity: 0.85;
}

/* CTA Buttons */
.message-bubble .cta-primary {
    display: inline-block;
    margin-top: 12px;
    margin-right: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #1a4c7d, #66bed2);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
}

.message-bubble .cta-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 76, 125, 0.35);
    color: white;
}

.message-bubble .cta-secondary {
    display: inline-block;
    margin-top: 12px;
    padding: 9px 16px;
    background: transparent;
    color: #1a4c7d;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1.5px solid #1a4c7d;
    transition: background 0.2s;
}

.message-bubble .cta-secondary:hover {
    background: #f1f5f9;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    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.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Suggestions */
#suggestions {
    padding: 0 20px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.suggestion-btn {
    padding: 8px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12.5px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.suggestion-btn:hover {
    background: #e2e8f0;
    border-color: #1a4c7d;
    color: #1a4c7d;
}

/* Input */
#chat-input-area {
    padding: 14px 20px 10px;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
    flex-shrink: 0;
}

#chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

#chat-input:focus {
    border-color: #66bed2;
    box-shadow: 0 0 0 3px rgba(102, 190, 210, 0.15);
}

#chat-input:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

#send-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, #1a4c7d, #66bed2);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

#send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(26, 76, 125, 0.3);
}

#send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#chat-footer {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
    padding-bottom: 2px;
}

#chat-footer a {
    color: #64748b;
    text-decoration: none;
}

#chat-footer a:hover {
    text-decoration: underline;
}

/* Error message */
.error-bubble {
    background: #fef2f2 !important;
    border: 1px solid #fecaca;
    color: #991b1b !important;
}

/* Modal Cal.com */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    width: 100%;
    max-width: 650px;
    height: 85vh;
    max-height: 700px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    font-size: 22px;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 0;
    }

    #chat-container {
        max-width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    .modal-content {
        max-width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
}
