/* HostGPT Modern Public Styles */
:root {
    --hostgpt-primary: #2563eb;
    --hostgpt-primary-dark: #1d4ed8;
    --hostgpt-primary-light: #3b82f6;
    --hostgpt-secondary: #64748b;
    --hostgpt-success: #10b981;
    --hostgpt-light: #f8fafc;
    --hostgpt-border: #e2e8f0;
    --hostgpt-text: #1e293b;
    --hostgpt-text-muted: #64748b;
    --hostgpt-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hostgpt-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#hostgpt-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 9999;
    --webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#hostgpt-container.floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
}

#hostgpt-toggle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--hostgpt-primary) 0%, var(--hostgpt-primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    box-shadow: var(--hostgpt-shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

#hostgpt-toggle:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#hostgpt-toggle svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

#hostgpt-widget {
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--hostgpt-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--hostgpt-border);
    backdrop-filter: blur(20px);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

#hostgpt-container.embedded #hostgpt-widget {
    width: 100%;
    height: 700px;
    margin: 0;
    border-radius: 12px;
}

.hostgpt-header {
    background: linear-gradient(135deg, var(--hostgpt-primary) 0%, var(--hostgpt-primary-dark) 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hostgpt-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.1;
}

.hostgpt-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hostgpt-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.hostgpt-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.hostgpt-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(to bottom, #fafafa 0%, #ffffff 100%);
}

.hostgpt-messages::-webkit-scrollbar {
    width: 6px;
}

.hostgpt-messages::-webkit-scrollbar-track {
    background: transparent;
}

.hostgpt-messages::-webkit-scrollbar-thumb {
    background: var(--hostgpt-border);
    border-radius: 3px;
}

.hostgpt-messages::-webkit-scrollbar-thumb:hover {
    background: var(--hostgpt-secondary);
}

.hostgpt-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    animation: messageSlide 0.3s ease;
}

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

.hostgpt-message.user-message {
    background: linear-gradient(135deg, var(--hostgpt-primary) 0%, var(--hostgpt-primary-light) 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

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

.hostgpt-message.bot-message ul {
    margin: 8px 0;
    padding-left: 20px;
}

.hostgpt-message.bot-message li {
    margin: 4px 0;
    line-height: 1.4;
}

.hostgpt-message.bot-message strong {
    font-weight: 600;
    color: var(--hostgpt-primary);
}

.hostgpt-message.bot-message em {
    font-style: italic;
    color: var(--hostgpt-text-muted);
}

.hostgpt-quick-questions {
    padding: 0 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hostgpt-quick-question {
    background: white;
    border: 2px solid var(--hostgpt-border);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: var(--hostgpt-text);
    position: relative;
    overflow: hidden;
}

.hostgpt-quick-question::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s ease;
}

.hostgpt-quick-question:hover {
    border-color: var(--hostgpt-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.hostgpt-quick-question:hover::before {
    left: 100%;
}

.hostgpt-input-area {
    padding: 20px 24px;
    border-top: 1px solid var(--hostgpt-border);
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: white;
}

#hostgpt-input {
    flex: 1;
    border: 2px solid var(--hostgpt-border);
    border-radius: 12px;
    padding: 14px 18px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    max-height: 120px;
    min-height: 20px;
    transition: all 0.2s ease;
    background: var(--hostgpt-light);
}

#hostgpt-input:focus {
    outline: none;
    border-color: var(--hostgpt-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#hostgpt-input::placeholder {
    color: var(--hostgpt-text-muted);
}

.hostgpt-send {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--hostgpt-primary) 0%, var(--hostgpt-primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.hostgpt-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.hostgpt-send:disabled {
    background: var(--hostgpt-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hostgpt-send svg {
    width: 20px;
    height: 20px;
}

.hostgpt-typing {
    padding: 0 24px 16px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.hostgpt-typing span {
    width: 8px;
    height: 8px;
    background: var(--hostgpt-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #hostgpt-container.floating {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    
    #hostgpt-widget {
        width: 100%;
        height: 80vh;
        border-radius: 16px 16px 0 0;
    }
    
    #hostgpt-toggle {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }
    
    .hostgpt-messages {
        padding: 16px;
    }
    
    .hostgpt-input-area {
        padding: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --hostgpt-light: #1e293b;
        --hostgpt-border: #334155;
        --hostgpt-text: #f1f5f9;
        --hostgpt-text-muted: #94a3b8;
    }
    
    #hostgpt-widget {
        background: #0f172a;
        border-color: var(--hostgpt-border);
    }
    
    .hostgpt-messages {
        background: linear-gradient(to bottom, #1e293b 0%, #0f172a 100%);
    }
    
    .hostgpt-message.bot-message {
        background: #1e293b;
        border-color: var(--hostgpt-border);
        color: var(--hostgpt-text);
    }
    
    .hostgpt-quick-question {
        background: #1e293b;
        border-color: var(--hostgpt-border);
        color: var(--hostgpt-text);
    }
    
    #hostgpt-input {
        background: #1e293b;
        border-color: var(--hostgpt-border);
        color: var(--hostgpt-text);
    }
    
    #hostgpt-input:focus {
        background: #0f172a;
    }
    
    .hostgpt-input-area {
        background: #0f172a;
        border-color: var(--hostgpt-border);
    }
}