/* --- Daleel Chat: Gemini Minimal Style --- */
:root {
    --daleel-bg: #ffffff;
    --daleel-text: #1f1f1f;
    --daleel-accent: #000000;
    --daleel-grey: #f0f4f9;
    /* Gemini light grey */
    --daleel-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.daleel-home-wrapper {
    max-width: 880px;
    /* Narrower for chat focus */
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
    text-align: right;
}

/* --- Chat Interface Container --- */
.daleel-chat-interface {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Pushes content to bottom */
    margin-bottom: 60px;
    position: relative;
}

/* --- Header --- */
.daleel-chat-header {
    text-align: center;
    margin-bottom: 40px;
    /* Added space to move heading up from search box */
    padding: 20px 0;
    transition: all 0.5s ease;
}

.daleel-chat-header h2 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #1f1f1f 0%, #555 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0;
    /* Eliminated margin */
}

.daleel-subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* --- Response Area --- */
#daleel-chat-response {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    /* Eliminated margin */
    animation: fadeIn 0.5s ease;
}

.daleel-ai-message {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4285f4, #9b72cb);
    /* Gemini Colors */
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.daleel-ai-content {
    background: var(--daleel-grey);
    padding: 20px;
    border-radius: 18 0px 18px 18px;
    /* Chat bubble shape */
    color: var(--daleel-text);
    line-height: 1.6;
    font-size: 1rem;
    width: 100%;
}

.daleel-ai-typing {
    padding-right: 50px;
    margin-top: 10px;
    color: #888;
}

/* Typing Dots Animation */
.dot {
    height: 8px;
    width: 8px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Input Area (Floating Pill) --- */
.daleel-input-wrapper {
    position: relative;
    z-index: 10;
    background: var(--daleel-bg);
    padding: 0;
    /* Reduced padding */
}

/* --- Filters (Near Me) --- */
.daleel-filters {
    display: flex;
    flex-wrap: wrap;
    /* Added to allow tags to wrap */
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 10px;
    margin-bottom: 0;
    padding: 0 10px;
}

/* --- Service Suggestion Tags --- */
.daleel-chat-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-suggest-tag {
    cursor: pointer;
    background: #f0f4f9;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-suggest-tag:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: #fff;
}



.daleel-search-box {
    background: #f0f4f9;
    /* Light grey bg */
    border-radius: 32px;
    /* Slightly more rounded for taller height */
    display: flex;
    align-items: flex-end;
    /* Align button to bottom */
    padding: 16px 20px 16px 25px;
    transition: 0.3s;
    border: 1px solid transparent;
    min-height: 120px;
    cursor: text;
    /* Shows it's clickable */
}

.daleel-search-box:focus-within {
    background: #fff;
    box-shadow: var(--daleel-shadow);
    border-color: #e0e0e0;
}

#daleel-chat-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 1.15rem;
    color: #1f1f1f;
    outline: none;
    text-align: right;
    resize: none;
    overflow-y: hidden;
    line-height: 1.5;
    max-height: 200px;
    display: flex;
    align-items: center;
}

#daleel-chat-submit {
    background: #fff;
    /* White button inside grey bar */
    color: #1f1f1f;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: 0.2s;
    flex-shrink: 0;
    margin-bottom: 0px;
    align-self: flex-end;
}

#daleel-chat-submit:hover {
    background: #e0e0e0;
}

/* --- Listings Grid --- */
.daleel-listings-section h3 {
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: #1f1f1f;
    display: flex;
    align-items: center;
    gap: 10px;
}

.daleel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.daleel-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;

    /* FORCE ARABIC DIRECTION */
    direction: rtl;
    text-align: right;
}

.daleel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: #d0d0d0;
}

.daleel-card h4 a {
    text-decoration: none;
    color: #1f1f1f;
    font-weight: 700;
    display: block;
    /* Ensure title fills width */
}

.daleel-card p {
    margin: 8px 0;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.5;

    /* FLEXBOX ALIGNMENT FIX */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* 'Start' in RTL means Right */
    gap: 10px;
    /* Space between Icon and Text */
    flex-direction: row;
    /* Ensure natural flow (Right to Left) */
}

.daleel-card i {
    color: #000;
    font-size: 1.1rem;
    margin-left: 0;
    /* Reset margins */
}

/* --- Chat Links (Phone & Map) --- */
.chat-link {
    display: inline-block;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 4px 12px;
    border-radius: 12px;
    color: #1f1f1f;
    text-decoration: none;
    font-size: 0.9rem;
    margin: 0 4px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-link:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    transform: translateY(-2px);
}

/* --- Enhanced Chat Action Buttons --- */
.chat-action-btn {
    display: inline-flex;
    /* Keeps icon and text aligned */
    align-items: center;
    gap: 6px;
    /* Space between icon and text */

    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    /* Full Pill Shape */

    padding: 6px 14px;
    margin: 5px 0 5px 8px;
    /* Spacing around buttons */

    color: #1f1f1f;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;

    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon specific styling inside button */
.chat-action-btn i {
    font-size: 1.1rem;
    color: #555;
    /* Slightly lighter icon */
}

/* Hover Effect */
.chat-action-btn:hover {
    background-color: #f8f9fa;
    border-color: #000;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.chat-action-btn:hover i {
    color: #000;
}

/* Active / Click Effect */
.chat-action-btn:active {
    transform: translateY(0);
    box-shadow: none;
    background-color: #f0f0f0;
}

/* --- Live Local Results --- */
#daleel-local-results {
    width: 100%;
    margin-bottom: 15px;
    /* Space above filters */
    z-index: 100;
}

.daleel-live-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    /* Align right for RTL */
}

.daleel-live-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1f1f1f;
    min-width: 200px;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    animation: slideUp 0.3s ease;
}

.daleel-live-item:hover {
    border-color: #000;
    transform: translateY(-3px);
}

.live-icon {
    width: 36px;
    height: 36px;
    background: #f0f4f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.live-info {
    display: flex;
    flex-direction: column;
}

.live-info strong {
    font-size: 1rem;
    font-weight: 600;
}

.live-info span {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Fade Effect */
.daleel-chat-header.faded {
    opacity: 0.3;
    filter: blur(2px);
}

/* --- Filters (Near Me) --- */
.daleel-filters {
    display: flex;
    justify-content: flex-start;
    /* Align to start of input */
    margin-bottom: 8px;
    padding: 0 5px;
}

#daleel-geo-btn {
    background: #f8f9fa;
    color: #666;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 20px;
    /* Pill shape matches input */
    border: 1px solid #e0e0e0;
    transition: 0.2s;
}

#daleel-geo-btn:hover {
    background: #c0c5cd;
    color: #000000;
    border-color: #d2e3fc;
}






/* --- Chat Mini Cards (Hybrid Response) --- */
.daleel-chat-cards {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.daleel-mini-card {
    background: #ffffff;
    border: 1px solid #eee;
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.daleel-mini-card:hover {
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.mini-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Space between Title and Meta Row */
}

.mini-card-title {
    font-weight: 700;
    color: #1f1f1f;
    text-decoration: none;
    font-size: 0.95rem;
}

.mini-card-cat {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Round Call Button */
.btn-mini-call {
    background: #eef;
    color: #0073aa;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.2s;
    border: 1px solid transparent;
}

.btn-mini-call:hover {
    background: #0073aa;
    color: #fff;
    border-color: #005a87;
}

/* Black View Details Button */
.btn-mini-view {
    background: #000;
    color: #fff;
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}

.btn-mini-view:hover {
    background: #333;
    transform: translateY(-1px);
}


/* --- WhatsApp Button Style --- */
.btn-mini-whatsapp {
    background: #e5f9ed;
    /* Light Green Background */
    color: #25D366;
    /* Official WhatsApp Green */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.2s;
    border: 1px solid transparent;
}

.btn-mini-whatsapp:hover {
    background: #25D366;
    color: #fff;
    border-color: #1ebc57;
    transform: translateY(-2px);
}

/* Ensure icons are centered */
.btn-mini-whatsapp i {
    font-size: 1.1rem;
}





/* --- Mobile Fix for Chat Cards --- */
@media (max-width: 480px) {
    .daleel-mini-card {
        flex-direction: column;
        /* Stack vertically */
        align-items: flex-start;
        /* Align to right (RTL start) */
        gap: 12px;
    }

    .mini-card-info {
        width: 100%;
    }

    .mini-card-actions {
        width: 100%;
        justify-content: flex-end;
        /* Push buttons to the left (RTL end) */
        border-top: 1px solid #f0f0f0;
        padding-top: 10px;
    }

    /* Make buttons slightly bigger on touch */
    .btn-mini-call,
    .btn-mini-whatsapp {
        width: 40px;
        height: 40px;
    }

    .btn-mini-view {
        padding: 8px 16px;
    }
}




/* --- Card Meta Info (Category & Location) --- */
.mini-card-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Space between "Company" and "Location" badges */
    flex-wrap: wrap;
    /* Safe wrapping for very small screens */
}

.mini-card-cat,
.mini-card-loc {
    font-size: 0.75rem;
    color: #888;
    /* Match the grey text color */
    display: inline-flex;
    /* Keeps them inline */
    align-items: center;
    gap: 4px;
    background: transparent;
    /* Remove background box if you want it clean like screenshot */
    padding: 0;
    /* Remove padding */
    border: none;
    /* Remove border */
}

.mini-card-cat i,
.mini-card-loc i {
    font-size: 0.9rem;
    color: #888;
    /* Unified Grey Color */
}







/* --- User Message Bubble --- */
.daleel-user-message {
    display: flex;
    justify-content: flex-end;
    /* Align to Left (since RTL) -> looks like "Me" side */
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideUp 0.3s ease;
}

.user-text {
    background: #1f1f1f;
    /* Dark bubble */
    color: #fff;
    padding: 12px 20px;
    border-radius: 0px 18px 18px 18px;
    /* Rounded except top-right */
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #eee;
    color: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Ensure AI Message is distinct */
.daleel-ai-message {
    margin-bottom: 30px;
    /* More space after AI reply */
}