/* AI Chat Styles 
#ai-chat-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background-color: #007bff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 9998;
}

#ai-chat-icon svg {
    width: 30px;
    height: 30px;
    fill: white;
}  */
/* Welcome Bubble Styles */
#welcome-bubble {
    position: fixed;
    bottom: 90px;
    left: 20px;
    background-color: #007bff;
    color: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 250px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 9997;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

#welcome-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

#welcome-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #007bff transparent transparent;
}

/* AI Chat Styles */
#ai-chat-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background-image: url('ai_chat.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 9998;
}

#ai-chat-welcome-bubble {
    position: absolute;
    bottom: 75px; /* Position above the icon */
    left: 50%;
    transform: translateX(-50%);
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none; /* So it doesn't block clicks on the icon */
}

#ai-chat-welcome-bubble.show {
    opacity: 1;
}

#ai-chat-welcome-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #007bff transparent transparent transparent;
}

/* The SVG is no longer needed, so we can remove its styling. */

/* AI Chat Window Styles */
#ai-chat-window {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    direction: rtl; /* Right-to-left for Arabic */
}

#ai-chat-header {
    padding: 15px;
    background-color: #007bff;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#ai-chat-close-btn {
    cursor: pointer;
    font-size: 20px;
}

#ai-chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100% - 120px); /* Adjust based on header and input height */
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
    scroll-behavior: smooth;
}

/* Custom scrollbar for WebKit browsers (Chrome, Safari, etc.) */
#ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#ai-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#ai-chat-messages::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 3px;
}

#ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.ai-chat-message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-break: break-word;
}

/* Style for links in chat messages */
.ai-chat-message a {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
}

.ai-chat-message a:hover {
    text-decoration: underline;
}

/* Different color for links in user messages */
.ai-chat-message.user a {
    color: #e6f0ff;
    text-decoration: underline;
}

.ai-chat-message.user a:hover {
    text-decoration: none;
}

.ai-chat-message.user {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.ai-chat-message.bot {
    background-color: #f1f1f1;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

/* Weather Response Styles */
.weather-response {
    font-family: 'Cairo', sans-serif;
    width: 100%;
}

.weather-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.weather-header h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.weather-header small {
    color: #7f8c8d;
    font-size: 0.8em;
}

.weather-current {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    padding: 10px 15px;
    background: #f0f2f5;
    border-radius: 18px;
    margin: 5px 0;
    width: fit-content;
    align-self: flex-start;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #65676b;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.weather-icon {
    width: 50px;
    height: 50px;
}

.weather-temp {
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}

.weather-desc {
    font-size: 0.9em;
    color: #7f8c8d;
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.weather-detail {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85em;
}

.weather-label {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 3px;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .weather-details {
        grid-template-columns: 1fr;
    }
    
    .weather-main {
        flex-direction: column;
        text-align: center;
    }
}

#ai-chat-faq-container {
    border-top: 1px solid #eee;
    position: relative;
}

#ai-chat-faq-toggle {
    padding: 10px 15px;
    background-color: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    user-select: none;
}

#ai-chat-faq-toggle:hover {
    background-color: #e9ecef;
}

#ai-chat-faq-toggle::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #495057;
    margin-right: 5px;
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

#ai-chat-faq-container.collapsed #ai-chat-faq-toggle::after {
    transform: rotate(180deg);
}

#ai-chat-faq {
    padding: 10px 15px;
    max-height: 200px;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
    opacity: 1;
}

#ai-chat-faq-container.collapsed #ai-chat-faq {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

/* Custom scrollbar for FAQ */
#ai-chat-faq::-webkit-scrollbar {
    width: 4px;
}

#ai-chat-faq::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#ai-chat-faq::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 3px;
}

#ai-chat-faq.collapsed {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
    border-top: none;
}

#ai-chat-faq h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #555;
}

.faq-question {
    background-color: #e9ecef;
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    margin: 4px 2px;
    cursor: pointer;
    font-size: 12px;
    display: inline-block;
}

#ai-chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
}

#ai-chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
}

#ai-chat-send-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
    color: #007bff;
}

#ai-chat-send-btn svg {
    width: 24px;
    height: 24px;
}