/* Simple ListingPro Contact Reveal Styles */

/* Hide ListingPro default call/phone buttons (but keep our custom ones) */
.lp-show-phone,
.phone-link:not(.tp-contact-trigger):not(.tp-phone-reveal),
.show-number:not(.tp-contact-trigger):not(.tp-phone-reveal),
.show-number-wrap .show-number:not(.tp-contact-trigger):not(.tp-phone-reveal),
.show-number-wrap:not(:has(.tp-contact-trigger)):not(:has(.tp-phone-reveal)),
.grind-number:not(.tp-contact-trigger):not(.tp-phone-reveal),
.lp-phone-btn,
.listing-phone:not(.tp-contact-trigger):not(.tp-phone-reveal),
.call-button:not(.tp-contact-trigger):not(.tp-phone-reveal) {
    display: none !important;
}

/* Hide tel: links that are NOT our buttons */
a[href^="tel:"]:not(.tp-contact-trigger):not(.tp-phone-reveal) {
    display: none !important;
}

/* Hide ListingPro's phone icon that appears before Call Now text */
a:not(.tp-contact-trigger):not(.tp-phone-reveal) > i.fa-phone,
a:not(.tp-contact-trigger):not(.tp-phone-reveal) > .fa.fa-phone,
a:not(.tp-contact-trigger):not(.tp-phone-reveal) > i.icon-phone,
span:not(.tp-contact-trigger):not(.tp-phone-reveal) > i.fa-phone,
span:not(.tp-contact-trigger):not(.tp-phone-reveal) > .fa.fa-phone {
    display: none !important;
}

/* Hide pseudo-element icons (::before) from ListingPro theme */
a:not(.tp-contact-trigger):not(.tp-phone-reveal)::before,
.show-number::before,
.phone-link::before,
[class*="call"]::before:not(.tp-contact-trigger::before):not(.tp-phone-reveal::before) {
    display: none !important;
    content: none !important;
}

/* Remove ALL icons from our button and add fresh one */
.tp-contact-trigger::before,
.tp-phone-reveal::before {
    display: none !important;
    content: none !important;
}

/* Hide all child icons EXCEPT our explicitly added one */
.tp-contact-trigger > *:not(i):not(.fa):not(.fa-phone),
.tp-phone-reveal > *:not(i):not(.fa):not(.fa-phone) {
    display: none !important;
}

/* Hide ListingPro's standalone phone icon and text when our button exists */
.show-number-wrap:has(.tp-contact-trigger) > p > i.fa-phone,
.show-number-wrap:has(.tp-phone-reveal) > p > i.fa-phone,
.show-number-wrap:has(.tp-contact-trigger) > p > .show-number,
.show-number-wrap:has(.tp-phone-reveal) > p > .show-number,
.show-number-wrap:has(.tp-contact-trigger) .show-number,
.show-number-wrap:has(.tp-phone-reveal) .show-number {
    display: none !important;
}

/* Hide any standalone phone icons in the same container as our button */
p:has(.tp-contact-trigger) > i.fa-phone:not(.tp-contact-trigger i),
p:has(.tp-phone-reveal) > i.fa-phone:not(.tp-phone-reveal i) {
    display: none !important;
}

/* Hide any remaining phone elements near Direction/Map buttons (but not our buttons) */
.listing-detail-action a[href^="tel:"]:not(.tp-contact-trigger):not(.tp-phone-reveal),
.listing-meta a[href^="tel:"]:not(.tp-contact-trigger):not(.tp-phone-reveal),
.lp-detail-action a[href^="tel:"]:not(.tp-contact-trigger):not(.tp-phone-reveal) {
    display: none !important;
}

/* SHOW our processed call buttons - IMPORTANT! */
.tp-contact-trigger,
.tp-phone-reveal,
a.tp-contact-trigger,
a.tp-phone-reveal {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Show our icons - IMPORTANT! */
.tp-contact-trigger .fa,
.tp-contact-trigger .fa-phone,
.tp-phone-reveal .fa,
.tp-phone-reveal .fa-phone,
.tp-contact-trigger i,
.tp-phone-reveal i {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Keep original ListingPro phone/CTA visible; JS will hook into clicks */

/* Show our contact reveal buttons */
.tp-contact-reveal-wrap {
    display: block !important;
    margin-bottom: 6px;
}

/* Inline layout so Call Now and Show Map align perfectly */
.tp-inline-contact-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Ensure our contact links are visible */
.tp-contact-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

.tp-inline-contact-links .tp-contact-reveal-link,
.tp-inline-contact-links .tp-show-map-link {
    display: inline-flex;
    align-items: center;
}

.tp-contact-reveal-container {
    margin: 20px 0;
    text-align: center;
    display: block !important;
}

/* Make our Call Now link look like Show Map */

.tp-contact-reveal-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: transparent; /* match normal Show Map */
    color: inherit !important; /* inherit text color to match */
    border-radius: 4px;
    font: inherit; /* font weight/size same as neighbors */
    text-decoration: none !important;
    vertical-align: middle;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tp-contact-reveal-link .fa,
.tp-contact-reveal-link i {
    margin-right: 4px;
    color: inherit; /* match Show Map icon text color */
}

.tp-contact-reveal-link:hover {
    background: #e6f7f5; /* hover effect only */
    color: #00c48c !important;
}

.tp-simple-modal {
    position: fixed;
    inset: 0;
    background: rgba(12, 18, 32, 0.55);
    backdrop-filter: blur(8px);
    z-index: 999900;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* When modal is visible, use flexbox to center */
.tp-simple-modal[style*="display: flex"],
.tp-simple-modal[style*="display:flex"] {
    display: flex !important;
}

.tp-simple-modal__content {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.25);
    position: relative;
    overflow: hidden;
}

.tp-simple-header {
    padding: 28px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 196, 140, 0.1));
}

.tp-simple-header h3 {
    margin: 0;
    font-size: 16px !important;
    font-weight: 600;
    color: #0e1b2b;
    letter-spacing: -0.3px;
}

.tp-simple-fields {
    padding: 24px 28px 10px 28px;
    display: flex;
    flex-direction: row;
    gap: 18px;
}

.tp-simple-field {
    flex: 1;
}

/* Stack vertically on mobile */
@media (max-width: 600px) {
    .tp-simple-fields {
        flex-direction: column;
    }
}

.tp-simple-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #6b7688;
    margin-bottom: 8px;
}

.tp-simple-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #0f1f33;
    background: #f7f9fc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.tp-simple-field input:focus {
    border-color: rgba(0, 120, 212, 0.65);
    box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.15);
    background-color: #ffffff;
    outline: none;
}

.tp-simple-submit {
    width: calc(100% - 56px);
    margin: 14px 28px 28px 28px;
    padding: 14px;
    background: linear-gradient(90deg, #0078d4, #00c48c);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 20px 36px rgba(0, 120, 212, 0.25);
}

.tp-simple-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 42px rgba(0, 120, 212, 0.32);
}

.tp-simple-submit:active {
    transform: translateY(0);
    box-shadow: 0 12px 24px rgba(0, 120, 212, 0.2);
}

.tp-close {
    font-size: 20px;
    cursor: pointer;
    color: #8a94a6;
    background: rgba(15, 23, 42, 0.05);
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tp-close:hover {
    background-color: rgba(0, 120, 212, 0.12);
    color: #00508a;
}

@media (max-width: 768px) {
    .tp-simple-modal__content {
        max-width: 92vw;
        margin: 10px;
    }

    .tp-simple-fields {
        flex-direction: column;
        gap: 14px;
        padding: 24px 24px 10px 24px;
    }

    .tp-simple-submit {
        width: calc(100% - 48px);
        margin: 12px 24px 24px 24px;
    }

    .tp-contact-reveal-container {
        margin: 12px 0;
    }

    .tp-contact-reveal-btn,
    .tp-contact-revealed-btn {
        width: 100%;
        margin: 6px 0;
    }
}

@media (max-width: 480px) {
    .tp-contact-reveal-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* Success Modal Styles */
.tp-success-header {
    background: linear-gradient(135deg, rgba(0, 196, 140, 0.15), rgba(0, 120, 212, 0.15)) !important;
}

.tp-success-header h3 {
    color: #00c48c !important;
}

.tp-success-content {
    padding: 32px 28px;
}

.tp-success-item {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.tp-success-item:last-of-type {
    border-bottom: none;
    margin-bottom: 28px;
}

.tp-success-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #6b7688;
    margin-bottom: 10px;
}

.tp-success-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #0e1b2b;
    word-break: break-word;
}

.tp-success-phone {
    color: #0078d4 !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.tp-success-phone:hover {
    color: #005a9e !important;
}

.tp-success-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.tp-success-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tp-call-btn {
    background: linear-gradient(90deg, #0078d4, #005a9e);
    color: #ffffff !important;
}

.tp-call-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 120, 212, 0.3);
}

.tp-whatsapp-btn {
    background: linear-gradient(90deg, #25D366, #128C7E);
    color: #ffffff !important;
}

.tp-whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}

.tp-success-btn i {
    font-size: 18px;
}

@media (max-width: 600px) {
    .tp-success-actions {
        flex-direction: column;
    }
    
    .tp-success-btn {
        width: 100%;
    }
}
