/* ========================================
   AI CHAT BUTTON STYLES
   Integrated with Constitutional Court Website Theme
   ======================================== */

/* AI Chat Button Core Styles */
.ai-chat-button {
    position: fixed;
    bottom: 30px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-700) 100%);
    color: white;
    border: none;
    border-radius: 60px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 116, 115, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    min-width: 60px;
    justify-content: center;
    font-family: inherit;
}

/* RTL and LTR positioning */
.container-RTL .ai-chat-button {
    left: 30px;
    right: auto;
}

.container-LTR .ai-chat-button {
    right: 30px;
    left: auto;
}

.ai-chat-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 116, 115, 0.5);
    background: linear-gradient(135deg, var(--bs-primary-700) 0%, var(--bs-primary) 100%);
    color: white;
    text-decoration: none;
}

.ai-chat-button:active {
    transform: translateY(-1px);
}

/* Chat Icon */
.chat-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Button Text */
.button-text {
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* Shining Animation for New Feature Promotion */
@keyframes shine {
    0% {
        box-shadow: 0 8px 25px rgba(0, 116, 115, 0.4);
        transform: translateY(0);
    }
    25% {
        box-shadow: 0 12px 35px rgba(0, 116, 115, 0.7);
        transform: translateY(-2px);
    }
    50% {
        box-shadow: 0 15px 45px rgba(0, 116, 115, 0.8);
        transform: translateY(-3px);
    }
    75% {
        box-shadow: 0 12px 35px rgba(0, 116, 115, 0.7);
        transform: translateY(-2px);
    }
    100% {
        box-shadow: 0 8px 25px rgba(0, 116, 115, 0.4);
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.ai-chat-button.shine {
    animation: shine 2.5s ease-in-out infinite, shimmer 3s linear infinite;
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-600) 30%, var(--bs-primary-200) 50%, var(--bs-primary-600) 70%, var(--bs-primary) 100%);
    background-size: 200% 100%;
}

/* Welcome Hint Tooltip */
.welcome-hint {
    position: fixed;
    bottom: 110px;
    z-index: 1001;
    background: white;
    color: #333;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--bs-primary);
    max-width: 280px;
    transform: translateX(20px) scale(0.8);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

/* RTL and LTR positioning for hint */
.container-RTL .welcome-hint {
    left: 30px;
    right: auto;
    transform: translateX(-20px) scale(0.8);
}

.container-LTR .welcome-hint {
    right: 30px;
    left: auto;
    transform: translateX(20px) scale(0.8);
}

.welcome-hint.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

/* Hint Arrow */
.welcome-hint::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.welcome-hint::before {
    content: '';
    position: absolute;
    bottom: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--bs-primary);
}

/* RTL arrows */
.container-RTL .welcome-hint::after {
    left: 40px;
}

.container-RTL .welcome-hint::before {
    left: 38px;
}

/* LTR arrows */
.container-LTR .welcome-hint::after {
    right: 40px;
}

.container-LTR .welcome-hint::before {
    right: 38px;
}

.hint-title {
    font-weight: 600;
    color: var(--bs-primary);
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint-text {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
}

.hint-close {
    position: absolute;
    top: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* RTL and LTR close button positioning */
.container-RTL .hint-close {
    left: 8px;
    right: auto;
}

.container-LTR .hint-close {
    right: 8px;
    left: auto;
}

.hint-close:hover {
    background: #f0f0f0;
    color: #666;
}

.hint-action {
    background: var(--bs-primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.hint-action:hover {
    background: var(--bs-primary-700);
}

/* New Feature Badge */
.new-badge {
    position: absolute;
    top: -8px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: bounce 2s infinite;
}

/* RTL and LTR badge positioning */
.container-RTL .new-badge {
    right: -8px;
    left: auto;
}

.container-LTR .new-badge {
    left: -8px;
    right: auto;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-chat-button {
        bottom: 20px;
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .container-RTL .ai-chat-button {
        left: 20px;
    }
    
    .container-LTR .ai-chat-button {
        right: 20px;
    }
    
    .chat-icon {
        width: 20px;
        height: 20px;
    }
    
    .welcome-hint {
        bottom: 90px;
        max-width: 250px;
        padding: 14px 16px;
    }
    
    .container-RTL .welcome-hint {
        left: 20px;
    }
    
    .container-LTR .welcome-hint {
        right: 20px;
    }
    
    .container-RTL .welcome-hint::after {
        left: 30px;
    }
    
    .container-RTL .welcome-hint::before {
        left: 28px;
    }
    
    .container-LTR .welcome-hint::after {
        right: 30px;
    }
    
    .container-LTR .welcome-hint::before {
        right: 28px;
    }
}

@media (max-width: 480px) {
    .ai-chat-button {
        padding: 12px;
        border-radius: 50%;
        min-width: 56px;
        min-height: 56px;
    }
    
    .container-RTL .ai-chat-button {
        left: 15px;
    }
    
    .container-LTR .ai-chat-button {
        right: 15px;
    }
    
    .button-text {
        display: none;
    }
    
    .welcome-hint {
        bottom: 85px;
        max-width: none;
    }
    
    .container-RTL .welcome-hint {
        left: 15px;
        right: 15px;
    }
    
    .container-LTR .welcome-hint {
        right: 15px;
        left: 15px;
    }
    
    .container-RTL .welcome-hint::after {
        left: 35px;
    }
    
    .container-RTL .welcome-hint::before {
        left: 33px;
    }
    
    .container-LTR .welcome-hint::after {
        right: 35px;
    }
    
    .container-LTR .welcome-hint::before {
        right: 33px;
    }
}

/* Compact mode for icon-only button */
.ai-chat-button.compact {
    padding: 14px;
    border-radius: 50%;
    min-width: 56px;
    min-height: 56px;
}

.ai-chat-button.compact .button-text {
    display: none;
}
