/* CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
}
/* ===== CHAT WIDGET STYLES ===== */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: 90vw;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid var(--primary-color, #667eea);
}

.chat-widget.active {
    display: flex;
    animation: slideInUp 0.3s ease-out;
}

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

.chat-widget-minimized {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}

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

.chat-widget-header {
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-widget-title {
    font-weight: 700;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.chat-widget-messages {
    flex: 1;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.chat-message.bot .message-avatar {
    background: var(--primary-color, #667eea);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 0.8em;
}

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

.chat-message.user .message-content {
    background: var(--primary-color, #667eea);
    color: white;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.chat-option {
    background: white;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 0.95em;
    font-family: inherit;
}

.chat-option:hover {
    border-color: var(--primary-color, #667eea);
    background: #f8f9ff;
    transform: translateY(-2px);
}

.chat-option.selected {
    background: var(--primary-color, #667eea);
    color: white;
    border-color: var(--primary-color, #667eea);
}

.chat-inputs {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: white;
}

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

.chat-text-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 0.95em;
    font-family: inherit;
}

.chat-submit {
    background: var(--accent-color, #ff6b6b);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-family: inherit;
}

.chat-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,107,0.3);
}

.chat-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.qualification-result {
    background: linear-gradient(135deg, #f8fff8 0%, #f0fff0 100%);
    border: 2px solid var(--success-color, #2ecc71);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
}

.recommendation-badge {
    background: var(--success-color, #2ecc71);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px;
    color: #666;
    font-style: italic;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chat-widget {
        width: 95vw;
        right: 2.5vw;
        bottom: 10px;
        max-width: none;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .chat-input-row {
        flex-direction: column;
    }
    
    .chat-widget-minimized {
        bottom: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
    }
}

/* Ensure CSS variables have fallbacks */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #ff6b6b;
    --success-color: #2ecc71;
}
