/* Modern Chatbot Styles */

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content p {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: white;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 1000px;
    height: 95vh;
    max-height: 900px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: rgb(246, 4, 4);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header h2 {
    font-size: 22px;
    font-weight: 600;
}

.user-info {
    font-size: 14px;
    opacity: 0.9;
    display: none; /* Hidden by default */
    align-items: center;
    gap: 8px;
}

.support-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #ff6b6b;
    border: 2px solid #ff5252;
    border-radius: 25px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.support-button:hover {
    background: #ff5252;
    border-color: #ff4444;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.support-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.4);
}

.support-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.support-button:disabled:hover {
    transform: none;
    background: #ff6b6b;
    border-color: #ff5252;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.support-button svg {
    flex-shrink: 0;
}

.support-label-mobile {
    display: none;
}

#userName {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

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

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

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

.welcome-message {
    text-align: center;
    padding: 20px;
    color: #718096;
}

.welcome-message p {
    font-size: 16px;
    line-height: 1.6;
}

.message {
    display: flex;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease-in;
}

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

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-content {
    max-width: 75%;
    padding: 15px 20px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 15px;
}

.message-content h1,
.message-content h2,
.message-content h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.message-content h1 {
    font-size: 1.5em;
}

.message-content h2 {
    font-size: 1.3em;
}

.message-content h3 {
    font-size: 1.1em;
}

.message-content p {
    margin-bottom: 0.8em;
}

.message-content ul,
.message-content ol {
    margin: 0.8em 0;
    padding-left: 1.5em;
}

.message-content li {
    margin-bottom: 0.5em;
}

.message-content strong {
    font-weight: 600;
    color: #2d3748;
}

.message-content code {
    background: #f7f9fc;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.message-content pre {
    background: #f7f9fc;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.8em 0;
}

.message-content pre code {
    background: none;
    padding: 0;
}

.message.user .message-content {
    background: rgb(200, 50, 50);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: white;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-input-container {
    padding: 20px 25px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #a0aec0;
    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);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-input-form {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: rgb(246, 4, 4);
    box-shadow: 0 0 0 3px rgba(246, 4, 4, 0.1);
}

.send-button {
    width: 48px;
    height: 48px;
    border: none;
    background: rgb(246, 4, 4);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(246, 4, 4, 0.4);
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(246, 4, 4, 0.6);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    padding: 15px;
    margin: 0 25px 20px;
    background: #fed7d7;
    color: #c53030;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .chat-container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 15px 15px;
        flex-wrap: nowrap;
        min-height: 60px;
    }
    
    .chat-header h2 {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
    }
    
    .header-actions {
        gap: 10px;
        flex-shrink: 0;
    }
    
    .support-button {
        padding: 8px 12px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .support-button svg {
        width: 20px;
        height: 20px;
    }
    
    .support-label-full {
        display: none;
    }
    
    .support-label-mobile {
        display: inline-block;
        margin-left: 6px;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .message-content {
        max-width: 85%;
    }
}


