/* Listing, FAQ MODAL */

/* ========================= */
/* LISTING MODAL - COMPACT VERSION */
/* This file overrides conflicting styles */
/* ========================= */

/* Full-Screen Listing Overlay */
#listingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 0;
}

#listingOverlay.hidden {
    display: none;
    opacity: 0;
    visibility: hidden;
}

.listing-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: white;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Modern Close Button */
.listing-close-btn {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border: none !important;
    border-radius: 50% !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.listing-close-btn:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: scale(1.1) !important;
}

.listing-close-btn svg {
    width: 20px !important;
    height: 20px !important;
    stroke: white !important;
}

/* Carousel */
.listing-carousel {
    position: relative;
    width: 100%;
    height: 55vh;
    background: #f8f9fa;
    overflow: hidden;
    touch-action: pan-y;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.carousel-slide img:hover {
    transform: scale(1.02);
}

.carousel-counter {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* COMPACT CONTENT AREA */
#listingOverlay .listing-content {
    padding: 16px 12px 30px !important;
}

/* COMPACT SUMMARY SECTION */
#listingOverlay .listing-summary {
    margin-bottom: 16px !important;
}

#listingOverlay .listing-price {
    font-size: 1.6rem !important;
    font-weight: 900 !important;
    color: #0b7d62 !important;
    margin-bottom: 6px !important;
    line-height: 1.2 !important;
}

#listingOverlay .listing-title {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    margin-bottom: 6px !important;
    line-height: 1.3 !important;
}

#listingOverlay .listing-meta {
    font-size: 0.9rem !important;
    color: #6b7280 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

/* COMPACT SECTIONS */
#listingOverlay .listing-section {
    margin-bottom: 12px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

#listingOverlay .listing-section:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

#listingOverlay .section-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    margin-bottom: 10px !important;
    color: #1f2937 !important;
}

#listingOverlay .listing-description {
    line-height: 1.5 !important;
    color: #4b5563 !important;
    font-size: 0.95rem !important;
}

#listingOverlay .listing-description p {
    margin-bottom: 12px !important;
}

#listingOverlay .listing-description p:last-child {
    margin-bottom: 0 !important;
}

/* ================================ */
/* ICON ACTION BAR – FACEBOOK MARKETPLACE STYLE */
/* ================================ */

#listingOverlay .icon-action-bar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    padding: 12px 8px !important;
    margin-top: 12px !important;
    gap: 0 !important;
}

#listingOverlay .icon-action-item {
    flex: 0 0 25% !important; /* 4 equal items */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

/* BIGGER, FACEBOOK-SIZED ICONS */
#listingOverlay .icon-action-btn {
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 18px !important;
    flex-shrink: 0 !important;
}

/* ICON SIZE INSIDE BUTTON */
#listingOverlay .icon-action-btn svg,
#listingOverlay .icon-action-btn i {
    width: 22px !important;
    height: 22px !important;
    font-size: 22px !important;
}

/* FACEBOOK-LIKE LABELS */
#listingOverlay .icon-action-label {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #606770 !important;
    line-height: 1.2 !important;
    height: 36px !important; /* PREVENT OVERLAP */
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

/* NEW COLORS - KEPT AS REQUESTED */
#listingOverlay .icon-action-btn.whatsapp-btn {
    background: #25D366 !important;
}

#listingOverlay .icon-action-btn.contact-info-btn {
    background: #5B8DB8 !important;
}

#listingOverlay .icon-action-btn.copy-btn {
    background: #8E8E93 !important;
}

#listingOverlay .icon-action-btn.report-btn {
    background: #8E8E93 !important;
}

#listingOverlay .icon-action-btn.message-btn {
    background: #008037 !important;
}

#listingOverlay .icon-action-label {
    font-size: 0.75rem !important;
    color: #666 !important;
    font-weight: 500 !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

/* Contact Actions */
#listingOverlay .contact-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

#listingOverlay .btn.full-width {
    width: 100% !important;
    padding: 16px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

#listingOverlay .whatsapp-btn {
    background: #008037 !important;
    color: white !important;
}

#listingOverlay .whatsapp-btn:hover {
    background: #006b2e !important;
    transform: translateY(-2px) !important;
}

#listingOverlay .contact-info-btn {
    background: #0b7d62 !important;
    color: white !important;
}

#listingOverlay .contact-info-btn:hover {
    background: #096c54 !important;
    transform: translateY(-2px) !important;
}

/* Related Listings */
#listingOverlay .related-scroll {
    display: flex !important;
    gap: 12px !important;
    overflow-x: auto !important;
    padding: 4px 0 8px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

#listingOverlay .related-scroll::-webkit-scrollbar {
    display: none !important;
}

#listingOverlay .related-card {
    flex: 0 0 200px !important;
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#listingOverlay .related-card:hover {
    transform: translateY(-2px) !important;
    border-color: #0b7d62 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

#listingOverlay .related-image {
    width: 100% !important;
    height: 120px !important;
    object-fit: cover !important;
}

#listingOverlay .related-details {
    padding: 12px !important;
}

#listingOverlay .related-price {
    font-weight: 700 !important;
    color: #0b7d62 !important;
    font-size: 0.9rem !important;
    margin-bottom: 4px !important;
}

#listingOverlay .related-title {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

#listingOverlay .related-location {
    font-size: 0.75rem !important;
    color: #6b7280 !important;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    #listingOverlay {
        padding: 20px;
    }
    
    .listing-container {
        max-width: 500px;
        max-height: 90vh;
        height: auto;
        border-radius: 16px;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }
    
    .listing-carousel {
        height: 300px;
        border-radius: 16px 16px 0 0;
    }
    
    .listing-close-btn {
        top: 24px !important;
        right: 24px !important;
    }
}

/* Prevent body scroll when listing is open */
body.listing-open {
    overflow: hidden !important;
}

@media (max-width: 480px) {
    #listingOverlay .icon-action-item {
        min-width: 0 !important;
    }
    
    #listingOverlay .icon-action-label {
        font-size: 0.7rem !important;
    }
}

/* ===========================================
   FAQ MODAL - FULL SCREEN
   Beautiful, modern FAQ interface
   Matches AppLoads design language
   =========================================== */

/* Modal Backdrop - FULL SCREEN */
.faq-fullscreen-modal {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.faq-fullscreen-modal.show {
    display: block !important;
    opacity: 1;
}

/* Modal Container - FULL SCREEN */
.faq-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
}

/* =========================
   Modal Header
   ========================= */
.faq-modal-header {
    position: relative;
    padding: 20px 60px 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #ffffff;
}

.faq-header-content {
    max-width: 100%;
}

.faq-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #101828;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.faq-modal-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Close Button - TOP RIGHT */
.faq-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #374151;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 10;
}

.faq-modal-close:hover {
    background: #e5e7eb;
    transform: scale(1.08);
}

.faq-modal-close:active {
    transform: scale(0.95);
}

/* =========================
   Search Bar
   ========================= */
.faq-search-container {
    padding: 16px 24px 12px 24px;
    background: #ffffff;
    flex-shrink: 0;
}

.faq-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0 14px;
    transition: all 0.2s ease;
}

.faq-search-wrapper:focus-within {
    background: #ffffff;
    border-color: #0b7d62;
    box-shadow: 0 0 0 3px rgba(11, 125, 98, 0.1);
}

.faq-search-icon {
    color: #9ca3af;
    flex-shrink: 0;
    margin-right: 10px;
}

.faq-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 15px;
    color: #111827;
    outline: none;
}

.faq-search-input::placeholder {
    color: #9ca3af;
}

.faq-search-clear {
    background: none;
    border: none;
    color: #9ca3af;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 6px;
    flex-shrink: 0;
}

.faq-search-clear:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
}

.faq-search-clear:active {
    transform: scale(0.9);
}

/* =========================
   Category Filter
   ========================= */
.faq-category-filter {
    display: flex;
    gap: 8px;
    padding: 0 24px 16px 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
}

.faq-category-filter::-webkit-scrollbar {
    display: none;
}

.faq-category-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.faq-category-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.faq-category-btn.active {
    background: linear-gradient(135deg, #0b7d62, #20a58a);
    border-color: #0b7d62;
    color: #ffffff;
}

.faq-category-btn:active {
    transform: scale(0.96);
}

/* =========================
   Modal Body - Scrollable
   ========================= */
.faq-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 24px 40px 24px;
}

/* =========================
   FAQ Content List
   ========================= */
.faq-content-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* =========================
   FAQ Item
   ========================= */
.faq-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Question Button */
.faq-question-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.faq-question-btn:hover {
    background: #f9fafb;
}

.faq-question-btn:active {
    background: #f3f4f6;
}

.faq-question-text {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    line-height: 1.5;
}

/* Chevron Icon */
.faq-chevron {
    color: #6b7280;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

/* Answer Container */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer-text {
    padding: 0 20px 20px 20px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.65;
    margin: 0;
}

/* Search Highlight */
.faq-highlight {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 500;
}

/* =========================
   No Results State
   ========================= */
.faq-no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.faq-no-results svg {
    color: #d1d5db;
    margin-bottom: 16px;
}

.faq-no-results p {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 6px 0;
}

.faq-no-results span {
    font-size: 14px;
    color: #9ca3af;
}

/* =========================
   Mobile Responsive
   ========================= */
@media (max-width: 640px) {
    .faq-modal-header {
        padding: 18px 56px 18px 20px;
    }

    .faq-modal-title {
        font-size: 1.25rem;
    }

    .faq-modal-subtitle {
        font-size: 0.9rem;
    }

    .faq-modal-close {
        top: 14px;
        right: 16px;
        width: 34px;
        height: 34px;
        font-size: 24px;
    }

    .faq-search-container {
        padding: 14px 20px 10px 20px;
    }

    .faq-category-filter {
        padding: 0 20px 14px 20px;
        gap: 6px;
    }

    .faq-category-btn {
        padding: 7px 14px;
        font-size: 13px;
    }

    .faq-modal-body {
        padding: 6px 20px 40px 20px;
    }

    .faq-item {
        border-radius: 10px;
    }

    .faq-question-btn {
        padding: 16px 18px;
        gap: 12px;
    }

    .faq-question-text {
        font-size: 14px;
    }

    .faq-answer-text {
        padding: 0 18px 18px 18px;
        font-size: 13px;
    }
}

/* =========================
   Prevent Body Scroll
   ========================= */
body:has(.faq-fullscreen-modal.show) {
    overflow: hidden;
}

/* Fallback for browsers without :has() */
body.faq-modal-open {
    overflow: hidden;
}

/* =========================
   Dark Mode Support
   ========================= */
@media (prefers-color-scheme: dark) {
    .faq-fullscreen-modal {
        background: #1c1c1d;
    }

    .faq-modal-container {
        background: #1c1c1d;
    }

    .faq-modal-header {
        background: #1c1c1d;
        border-bottom-color: #2f2f31;
    }

    .faq-modal-close {
        background: #2a2a2c;
        color: #f9fafb;
    }

    .faq-modal-close:hover {
        background: #3a3a3c;
    }

    .faq-modal-title {
        color: #ffffff;
    }

    .faq-modal-subtitle {
        color: #9ca3af;
    }

    .faq-search-container {
        background: #1c1c1d;
    }

    .faq-search-wrapper {
        background: #2a2a2c;
        border-color: #3a3a3c;
    }

    .faq-search-wrapper:focus-within {
        background: #2a2a2c;
        border-color: #20a58a;
        box-shadow: 0 0 0 3px rgba(32, 165, 138, 0.15);
    }

    .faq-search-input {
        color: #f9fafb;
    }

    .faq-search-input::placeholder {
        color: #6b7280;
    }

    .faq-search-clear:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .faq-category-btn {
        background: #2a2a2c;
        border-color: #3a3a3c;
        color: #9ca3af;
    }

    .faq-category-btn:hover {
        background: #3a3a3c;
        border-color: #4a4a4c;
    }

    .faq-category-btn.active {
        background: linear-gradient(135deg, #0b7d62, #20a58a);
        border-color: #20a58a;
        color: #ffffff;
    }

    .faq-item {
        background: #2a2a2c;
        border-color: #3a3a3c;
    }

    .faq-item:hover {
        border-color: #4a4a4c;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .faq-question-btn:hover {
        background: #3a3a3c;
    }

    .faq-question-btn:active {
        background: #4a4a4c;
    }

    .faq-question-text {
        color: #f9fafb;
    }

    .faq-chevron {
        color: #9ca3af;
    }

    .faq-answer-text {
        color: #d1d5db;
    }

    .faq-highlight {
        background: #78350f;
        color: #fef3c7;
    }

    .faq-no-results svg {
        color: #4b5563;
    }

    .faq-no-results p {
        color: #f9fafb;
    }

    .faq-no-results span {
        color: #6b7280;
    }
}

/* =========================
   Accessibility
   ========================= */
@media (prefers-reduced-motion: reduce) {
    .faq-fullscreen-modal,
    .faq-modal-container,
    .faq-item,
    .faq-chevron,
    .faq-answer {
        transition: none;
    }
}

.faq-question-btn:focus {
    outline: 2px solid #0b7d62;
    outline-offset: -2px;
}

.faq-modal-close:focus {
    outline: 2px solid #0b7d62;
    outline-offset: 2px;
}

.faq-category-btn:focus {
    outline: 2px solid #0b7d62;
    outline-offset: 2px;
}