

/* Base Styles */
.whatsapp-widget {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 9999;
    font-family: Arial, sans-serif;
    font-size: 13px;
}

#whatsapp-toggle {
    display: none;
}


/* Add these styles to your existing CSS */
.quick-btn {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(245,245,245,0.9);
    transition: all 0.3s ease;
}

.quick-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: 0;
    background: linear-gradient(
        90deg,
        rgba(0,122,255,0) 0%,
        rgba(0,122,255,0.3) 50%,
        rgba(0,122,255,0) 100%
    );
    background-size: 200% auto;
    border-radius: 8px;
    opacity: 0;
    animation: siriEdgeFlow 3s linear infinite;
}

.quick-btn:hover::before {
    opacity: 1;
}

.quick-btn:active::before {
    background: linear-gradient(
        90deg,
        rgba(50,215,75,0) 0%,
        rgba(50,215,75,0.5) 50%,
        rgba(50,215,75,0) 100%
    );
    animation: siriEdgeFlow 1s linear infinite;
}

@keyframes siriEdgeFlow {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* RTL adjustments */
.rtl .quick-btn::before {
    animation-direction: reverse;
}



.whatsapp-btn {
    width: 50px;
    height: 50px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.whatsapp-btn:hover {
    transform: scale(1.05);
}

.chat-box {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 280px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
}

#whatsapp-toggle:checked + .whatsapp-btn + .chat-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header */
.chat-header {
    padding: 12px;
    background: #075E54;
    color: white;
    border-radius: 10px 10px 0 0;
}

.header-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.chat-logo {
    width: 70px;
    height: 70px;
    border-radius: 15%;
    object-fit: contain;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.chat-header h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.status {
    font-size: 11px;
    opacity: 0.9;
    display: block;
}

/* Language Circle Selector */
.language-circle {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    flex-shrink: 0;
    margin-left: auto;
}

.rtl .language-circle {
    margin-left: 0;
    margin-right: auto;
}

.language-selector {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.language-display {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #555;
    z-index: 1;
    pointer-events: none;
}

/* Chat Body */
.chat-body {
    padding: 12px;
}

.form-group {
    margin-bottom: 10px;
}

.form-control, .file-upload {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

.file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f9f9f9;
    transition: background 0.2s;
}

.file-upload:hover {
    background: #f0f0f0;
}

.file-upload i {
    margin-right: 8px;
}

.messages {
    height: 140px;
    overflow-y: auto;
    padding: 10px 0;
    margin: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.message {
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 12px;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.4;
}

.bot {
    background: #f1f1f1;
    margin-right: auto;
}

.user {
    background: #25D366;
    color: white;
    margin-left: auto;
}

/* Updated Quick Questions Grid */
.quick-questions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 10px 0;
}
.quick-btn .question-text {
    display: inline; /* Ensure text is always visible */
    width: 100%;
    overflow: visible;
    white-space: normal;
}

.quick-btn {
    padding: 8px 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 11px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    white-space: normal; /* Changed from nowrap to normal */
    overflow: visible; /* Changed from hidden to visible */
    text-overflow: clip; /* Changed from ellipsis to clip */
    height: auto; /* Ensure height adjusts to content */
    min-height: 36px; /* Minimum height for consistency */
    display: flex;
    align-items: center;
    justify-content: center;
}
.quick-btn:hover {
    background: #eee;
}

.input-group {
    display: flex;
    margin-top: 10px;
}

#user-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
}

#send-btn {
    width: 36px;
    height: 36px;
    margin-left: 8px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

.whatsapp-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #25D366;
    color: white;
    text-decoration: none;
    border-radius: 0 0 10px 10px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.whatsapp-action-btn:hover {
    background: #128C7E;
}

.whatsapp-action-btn i {
    margin-right: 8px;
}

/* RTL Support */
.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Tahoma', Arial, sans-serif;
}

.rtl .whatsapp-action-btn i {
    margin-right: 0;
    margin-left: 8px;
}

.rtl .file-upload i {
    margin-right: 0;
    margin-left: 8px;
}

.rtl .quick-btn {
    text-align: right;
}

/* Welcome Text */
.welcome-text {
    font-family: "Noto Sans Arabic", "Segoe UI", sans-serif !important;
    direction: rtl;
    unicode-bidi: isolate;
    font-weight: bold;
    color: #ffffff;
}

/* File List */
.file-list {
    margin-top: 5px;
    font-size: 11px;
    color: #666;
    max-height: 60px;
    overflow-y: auto;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .quick-questions {
        grid-template-columns: 1fr;
    }
    
    .quick-btn {
        min-height: 40px; /* Slightly taller on mobile */
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .chat-box {
        width: 300px; /* slightly narrower */
        max-height: 80vh; /* max height to prevent it from being too tall */
        overflow-y: auto;
    }
}