/* ==========================================
   WhatsApp Consultants Popup
   YourUni Style - Matching Design
   ========================================== */

/* ===== FLOATING TRIGGER BUTTON ===== */
.whatsapp-float-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9998;
    background: #5cb85c;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(92, 184, 92, 0.4);
    transition: all 0.3s ease;
    direction: rtl;
}

.whatsapp-float-btn:hover {
    background: #4cae4c;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(92, 184, 92, 0.5);
}

.whatsapp-float-btn svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    flex-shrink: 0;
}

/* ===== OVERLAY ===== */
.whatsapp-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.whatsapp-popup-overlay.active {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    opacity: 1;
}

/* ===== POPUP CONTAINER ===== */
.whatsapp-popup {
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 420px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
    position: fixed;
    left: 0;
    bottom: 0;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
    font-family: 'Tajawal', 'Cairo', 'Arial', sans-serif;
    direction: rtl;
}

.whatsapp-popup-overlay.active .whatsapp-popup {
    transform: translateY(0);
    opacity: 1;
}

/* ===== HEADER - Yellow/Green like YourUni ===== */
.whatsapp-popup-header {
    background: linear-gradient(160deg, #da7900 0%, #da7900 60%, #da7900 100%);
    padding: 30px 20px 25px;
    text-align: right;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.whatsapp-popup-title {
    color: #ffffff;
    font-size: 1.45rem;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.whatsapp-popup-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ===== CLOSE BUTTON ===== */
.whatsapp-popup-close {
    position: absolute;
    top: 12px;
    left: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.whatsapp-popup-close:hover {
    background: rgba(255,255,255,0.4);
    transform: rotate(90deg);
}

/* ===== CONSULTANTS LIST ===== */
.whatsapp-consultants-list {
    padding: 8px 0;
    background: #fff;
}

/* ===== CONSULTANT CARD ===== */
.whatsapp-consultant-card {
    background: #ffffff;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
    direction: rtl;
}

.whatsapp-consultant-card:last-child {
    border-bottom: none;
}

.whatsapp-consultant-card:hover {
    background: #f9fafb;
}

.whatsapp-consultant-card:active {
    background: #f0fdf4;
}

/* ===== AVATAR ===== */
.whatsapp-consultant-avatar {
    position: relative;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
}

.whatsapp-consultant-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8e8e8;
}

.whatsapp-consultant-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    font-weight: 700;
    border: 2px solid #e8e8e8;
}

/* WhatsApp badge on avatar */
.whatsapp-status-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: #25D366;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-status-indicator::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ===== CONSULTANT INFO ===== */
.whatsapp-consultant-info {
    flex: 1;
    text-align: right;
}

.whatsapp-consultant-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 3px;
    line-height: 1.3;
}

.whatsapp-consultant-role {
    font-size: 0.85rem;
    color: #9ca3af;
    margin: 0;
    font-weight: 400;
}

/* Hide phone number - not shown in design */
.whatsapp-consultant-phone {
    display: none;
}

/* ===== WHATSAPP ICON ON CARD ===== */
.whatsapp-consultant-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.whatsapp-consultant-card:hover .whatsapp-consultant-icon {
    background: #128C7E;
    transform: scale(1.08);
}

.whatsapp-consultant-icon svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

/* ===== FOOTER - "Powered by YourUni" ===== */
.whatsapp-popup-footer {
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.whatsapp-popup-footer-text {
    font-size: 0.8rem;
    color: #b0b0b0;
    margin: 0;
}

.whatsapp-popup-footer-link {
    color: #25D366;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.whatsapp-popup-footer-link:hover {
    color: #128C7E;
}

/* ===== BOTTOM STICKY BUTTON inside popup ===== */
.whatsapp-popup-bottom-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    background: #5cb85c;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 15px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s ease;
    direction: rtl;
    text-decoration: none;
}

.whatsapp-popup-bottom-btn:hover {
    background: #4cae4c;
}

.whatsapp-popup-bottom-btn svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

/* ===== SCROLLBAR ===== */
.whatsapp-popup::-webkit-scrollbar { width: 4px; }
.whatsapp-popup::-webkit-scrollbar-track { background: #f8f8f8; }
.whatsapp-popup::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* ===== CARD ANIMATIONS ===== */
.whatsapp-popup-overlay.active .whatsapp-consultant-card {
    animation: fadeSlideIn 0.4s ease forwards;
    opacity: 0;
}
.whatsapp-popup-overlay.active .whatsapp-consultant-card:nth-child(1) { animation-delay: 0.15s; }
.whatsapp-popup-overlay.active .whatsapp-consultant-card:nth-child(2) { animation-delay: 0.25s; }
.whatsapp-popup-overlay.active .whatsapp-consultant-card:nth-child(3) { animation-delay: 0.35s; }
.whatsapp-popup-overlay.active .whatsapp-consultant-card:nth-child(4) { animation-delay: 0.45s; }

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

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
    .whatsapp-popup {
        left: 20px;
        bottom: 20px;
        border-radius: 20px;
        max-width: 400px;
        transform: translateY(20px);
        opacity: 0;
    }

    .whatsapp-popup-overlay.active .whatsapp-popup {
        transform: translateY(0);
        opacity: 1;
    }

    .whatsapp-popup-overlay.active {
        align-items: flex-end;
        justify-content: flex-start;
        padding: 0 0 0 20px;
    }
}

/* ===== ACCESSIBILITY ===== */
.whatsapp-consultant-card:focus {
    outline: 2px solid #25D366;
    outline-offset: -2px;
}
.whatsapp-popup-close:focus {
    outline: 2px solid rgba(255,255,255,0.8);
}