/* Enhanced Modern Chatbot Styles with Advanced Effects */
:root {
    --chatbot-primary: #C0A080;
    --chatbot-secondary: #d4b795;
    --chatbot-accent: #8a8370;
    --chatbot-text: #333333;
    --chatbot-light: #f8f9fa;
    --chatbot-dark: #343a40;
    --chatbot-success: #28a745;
    --chatbot-border-radius: 15px;
    --chatbot-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --chatbot-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chatbot Wrapper */
.chatbot-wrapper {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 10000;
    font-family: 'Heebo', sans-serif;
}

/* Enhanced Chatbot Toggle Button */
.chatbot-toggle {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    transition: var(--chatbot-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--chatbot-secondary), var(--chatbot-primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.chatbot-toggle:hover::before {
    opacity: 1;
}

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

.chatbot-toggle i {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.chatbot-toggle:hover i {
    transform: scale(1.1);
}

/* Enhanced Notification Badge */
.chatbot-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 8px rgba(255, 71, 87, 0.3);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(255, 71, 87, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 12px rgba(255, 71, 87, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(255, 71, 87, 0.3);
    }
}

/* Enhanced Chatbot Container */
.chatbot-container {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 380px;
    max-width: 90vw;
    height: 600px;
    max-height: 75vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--chatbot-border-radius);
    box-shadow: var(--chatbot-shadow);
    z-index: 9999;
    overflow: hidden;
    display: none;
    flex-direction: column;
    transition: var(--chatbot-transition);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    direction: rtl;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chatbot-container.active {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Enhanced Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    background-size: 200% 200%;
    animation: gradientAnimation 5s ease infinite;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: var(--chatbot-border-radius);
    border-top-right-radius: var(--chatbot-border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50% }
    50% { background-position: 100% 50% }
    100% { background-position: 0% 50% }
}

/* Enhanced Avatar */
.chatbot-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Enhanced Title */
.chatbot-title {
    flex: 1;
    margin-right: 15px;
}

.chatbot-title h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--chatbot-success);
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

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

/* Enhanced Controls */
.chatbot-controls {
    display: flex;
    gap: 8px;
}

.chatbot-controls button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--chatbot-transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(5px);
}

.chatbot-controls button:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.3);
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

/* Enhanced Body */
.chatbot-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--chatbot-light);
}

/* Enhanced Messages */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--chatbot-secondary) transparent;
}

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

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

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

/* Enhanced Message Styles */
.chatbot-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.chatbot-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(192, 160, 128, 0.2);
}

.chatbot-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-message-content {
    flex: 1;
    min-width: 0;
}

.chatbot-message-text {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.chatbot-message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

/* Bot Message */
.chatbot-message.bot {
    align-self: flex-start;
}

.chatbot-message.bot .chatbot-message-text {
    background: white;
    color: var(--chatbot-text);
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(192, 160, 128, 0.1);
}

.chatbot-message.bot .chatbot-message-text strong {
    color: var(--chatbot-primary);
}

.chatbot-message.bot .chatbot-message-text a {
    color: var(--chatbot-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.chatbot-message.bot .chatbot-message-text a:hover {
    color: var(--chatbot-secondary);
    text-decoration: underline;
}

/* User Message */
.chatbot-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-message.user .chatbot-message-content {
    text-align: left;
}

.chatbot-message.user .chatbot-message-text {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
    border-bottom-right-radius: 5px;
}

.chatbot-message.user .chatbot-message-time {
    text-align: left;
}

/* Enhanced Typing Indicator */
.chatbot-message.typing .chatbot-message-content {
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(192, 160, 128, 0.1);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--chatbot-secondary);
    border-radius: 50%;
    animation: typingAnimation 1.5s infinite ease-in-out;
}

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

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

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

@keyframes typingAnimation {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Enhanced Suggested Questions */
.chatbot-suggested-questions {
    padding: 15px 20px;
    border-top: 1px solid rgba(192, 160, 128, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
}

.suggested-question {
    background: var(--chatbot-light);
    border: 1px solid rgba(192, 160, 128, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--chatbot-text);
    cursor: pointer;
    transition: var(--chatbot-transition);
    white-space: nowrap;
    font-family: inherit;
}

.suggested-question:hover {
    background: var(--chatbot-primary);
    color: white;
    border-color: var(--chatbot-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 160, 128, 0.3);
}

/* Enhanced Footer */
.chatbot-footer {
    border-top: 1px solid rgba(192, 160, 128, 0.1);
    background: white;
}

.chatbot-input-container {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    align-items: center;
}

.chatbot-input-container:focus-within {
    box-shadow: 0 0 0 2px rgba(192, 160, 128, 0.2);
    border-radius: 8px;
    margin: 5px;
}

#chatbotInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(192, 160, 128, 0.2);
    border-radius: 25px;
    font-size: 0.9rem;
    transition: var(--chatbot-transition);
    font-family: inherit;
    background: var(--chatbot-light);
}

#chatbotInput:focus {
    border-color: var(--chatbot-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(192, 160, 128, 0.1);
    background: white;
}

.chatbot-send {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--chatbot-transition);
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(192, 160, 128, 0.3);
}

.chatbot-send:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 12px rgba(192, 160, 128, 0.4);
}

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

/* Enhanced Link Styles */
.chatbot-message-text a {
    color: var(--chatbot-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.chatbot-message-text a:hover {
    color: var(--chatbot-secondary);
    border-bottom-color: var(--chatbot-secondary);
}

.chatbot-message.bot .chatbot-message-text a {
    color: var(--chatbot-primary);
}

.chatbot-message.user .chatbot-message-text a {
    color: white;
    border-bottom-color: rgba(255,255,255,0.5);
}

/* Responsive Design */
@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: 70vh;
        left: 20px;
        right: 20px;
    }
    
    .chatbot-message-content {
        max-width: 90%;
    }
    
    .chatbot-suggested-questions {
        padding: 10px 15px;
    }
    
    .suggested-question {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Enhanced Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Enhanced Focus States */
.chatbot-toggle:focus,
.chatbot-controls button:focus,
.chatbot-send:focus,
.suggested-question:focus {
    outline: 2px solid var(--chatbot-primary);
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chatbot-container {
        background: rgba(30, 30, 30, 0.98);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .chatbot-body {
        background: #1a1a1a;
    }
    
    .chatbot-message.bot .chatbot-message-text {
        background: #2a2a2a;
        color: #e0e0e0;
        border-color: rgba(192, 160, 128, 0.2);
    }
    
    .chatbot-footer,
    .chatbot-suggested-questions {
        background: #2a2a2a;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .chatbot-input-container {
        background: #2a2a2a;
    }
    
    #chatbotInput {
        background: #1a1a1a;
        color: #e0e0e0;
        border-color: rgba(192, 160, 128, 0.3);
    }
    
    .suggested-question {
        background: #1a1a1a;
        color: #e0e0e0;
        border-color: rgba(192, 160, 128, 0.3);
    }
} 