/* Luxury Popup Chat Styles - Simplified */
:root {
    /* Core colors */
    --primary-color: #9b87f5;
    --primary-dark: #7E69AB;
    --primary-light: #E5DEFF;
    --gray-900: #1A1F2C;
    --gray-800: #333333;
    --gray-700: #4A4A4A;
    --gray-500: #8E9196;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    
    /* Simplified design tokens */
    --radius: 0.5rem;
    --radius-large: 1rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Simplified Popup Button */
.ai-chat-popup-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1000;
}

.ai-chat-popup-button:hover {
    transform: translateY(-3px);
    background: var(--primary-dark);
}

.ai-chat-popup-button i {
    color: var(--white);
    font-size: 24px;
    transition: var(--transition);
}

/* Simplified Popup Container */
.ai-chat-popup {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 360px;
    height: 580px;
    background: var(--white);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 999;
}

.ai-chat-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Simplified Header */
.ai-chat-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Enhanced Close Button */
.ai-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ai-chat-close::before,
.ai-chat-close::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    background-color: var(--white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-close::before {
    transform: rotate(45deg);
}

.ai-chat-close::after {
    transform: rotate(-45deg);
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.ai-chat-close:hover::before {
    width: 16px;
    background-color: var(--white);
}

.ai-chat-close:hover::after {
    width: 16px;
    background-color: var(--white);
}

.ai-chat-close:active {
    transform: rotate(90deg) scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

/* Remove the old close button styles */
.ai-chat-close i {
    display: none;
}

/* Enhanced Token Counter */
.ai-chat-token-counter {
    background: var(--gray-50);
    padding: 12px 20px;
    font-size: 0.9rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.ai-chat-token-progress {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.ai-chat-token-progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* Enhanced Messages Container */
.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Enhanced Message Styles */
.ai-chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--radius-large);
    position: relative;
    animation: messageAppear 0.3s ease;
    line-height: 1.5;
    font-size: 0.95rem;
}

@keyframes messageAppear {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* User Message Style */
.ai-chat-message.user {
    background: var(--primary-light);
    color: var(--primary-dark);
    margin-left: auto;
    border-bottom-right-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(155, 135, 245, 0.2);
}

/* Assistant Message Style */
.ai-chat-message.assistant {
    background: var(--primary-color);
    color: var(--white);
    margin-right: auto;
    border-bottom-left-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.ai-chat-message.assistant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1));
    border-radius: inherit;
}

.ai-chat-message.rtl {
    direction: rtl;
    text-align: right;
}

/* Simplified Input Area */
.ai-chat-input-area {
    padding: 16px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.ai-chat-form {
    display: flex;
    gap: 10px;
}

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-large);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-800);
}

.ai-chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(155, 135, 245, 0.1);
}

.ai-chat-send-button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-large);
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-send-button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.ai-chat-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Simplified Typing Indicator */
.ai-chat-typing {
    background: var(--gray-100);
    padding: 8px 16px;
    border-radius: var(--radius-large);
    font-style: italic;
    color: var(--gray-700);
    animation: pulse 1.5s infinite;
    width: fit-content;
    margin: 4px 0;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Simplified Scrollbar */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: var(--gray-50);
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Simplified Clear Chat Button */
.ai-chat-clear-form {
    margin: 0;
    padding: 8px 16px;
    text-align: center;
}

.ai-chat-clear-button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-chat-clear-button:hover {
    color: var(--primary-dark);
    background: var(--primary-light);
}

/* Simplified Error Message */
.ai-chat-message.error {
    background: var(--gray-100);
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 8px 0;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 480px) {
    .ai-chat-popup {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .ai-chat-popup-button {
        bottom: 20px;
        right: 20px;
    }
}

/* Simple Loading Animation */
.ai-chat-loading {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-large);
    width: fit-content;
    margin: 4px 0;
}

.ai-chat-loading span {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.ai-chat-loading span:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
} 

















.gift-message-toggle {
    margin-bottom: 1.5rem;
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.gift-message-toggle:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: var(--gray-700);
}

.toggle-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 3.5rem;
    height: 2rem;
    background-color: var(--gray-200);
    border-radius: 2rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.toggle-label input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-dark);
}

.toggle-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--white);
    top: 0.1rem;
    right: 0.1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle-label input[type="checkbox"]:checked::before {
    right: calc(100% - 1.7rem);
}

.toggle-label span {
    font-size: 1.1rem;
    color: var(--gray-700);
}

.gift-message-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background-color: var(--gray-50);
    transition: var(--transition);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gift-message-info {
    color: var(--gray-600);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 0.75rem;
    background-color: var(--soft-purple);
    border-radius: var(--radius);
    border-right: 4px solid var(--primary-color);
}

#giftMessage {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--gray-700);
    transition: var(--transition);
}

#giftMessage:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--soft-purple);
}

#giftMessage::placeholder {
    color: var(--gray-400);
}

/* Add a nice icon to the gift message section */
.gift-message-toggle::before {
    content: '🎁';
    font-size: 1.5rem;
    margin-left: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .gift-message-toggle {
        padding: 1rem;
    }
    
    .toggle-label {
        font-size: 0.95rem;
    }
    
    .toggle-label input[type="checkbox"] {
        width: 3rem;
        height: 1.75rem;
    }
    
    .toggle-label input[type="checkbox"]::before {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .gift-message-container {
        padding: 1rem;
    }
}
