/*
 * Ads Visitor Retention Pro - Frontend Styles
 * Replaces Bootstrap modal CSS for the exit-intent modal
 */

/* ===== Modal Overlay & Wrapper ===== */
.avr-modal-wrapper {
    --avr-modal-transition: 0.3s;
}

.avr-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 55;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    visibility: hidden;
    pointer-events: none;
}

.avr-modal.show {
    visibility: visible;
    pointer-events: auto;
}

.avr-modal.fade .avr-modal-dialog {
    transition: transform var(--avr-modal-transition) ease-out, opacity 0.15s linear;
    transform: translateY(-50px);
    opacity: 0;
}

.avr-modal.fade.show .avr-modal-dialog {
    transform: none;
    opacity: 1;
}

/* ===== Backdrop ===== */
.avr-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 54;
    display: none;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
}

.avr-modal-backdrop.show {
    display: block;
}

/* ===== Dialog ===== */
.avr-modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

.avr-modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

.avr-modal-dialog.avr-modal-lg {
    max-width: 500px;
}

/* ===== Content ===== */
.avr-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 0;
    border-radius: 16px;
    outline: 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-width: 420px;
    margin: 0 auto;
}

.avr-modal-lg .avr-modal-content {
    max-width: 100%;
}

/* ===== Header ===== */
.avr-modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1rem 0 1rem;
    border-bottom: 0;
}

/* ===== Body ===== */
.avr-modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 0.5rem 1.5rem 0 1.5rem;
}

.avr-modal-body.avr-text-center {
    text-align: center;
}

/* ===== Footer ===== */
.avr-modal-footer {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 0;
    gap: 0.5rem;
}

/* ===== Close Button ===== */
.avr-btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.375rem;
    opacity: 0.5;
    cursor: pointer;
}

.avr-btn-close:hover {
    opacity: 0.75;
}

/* ===== Buttons ===== */
.avr-btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.5rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    text-decoration: none;
}

.avr-btn-light {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.avr-btn-light:hover {
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

.avr-btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.avr-btn-danger:hover {
    color: #fff;
    background-color: #bb2d3b;
    border-color: #b02a37;
}

/* ===== Images ===== */
.avr-img-fluid {
    max-width: 100%;
    height: auto;
}

.avr-custom-img {
    max-width: 100%;
    height: auto;
}

/* ===== Border & Radius Utilities ===== */
.avr-border-0 {
    border: 0 !important;
}

.avr-border {
    border: 1px solid #dee2e6 !important;
}

.avr-rounded {
    border-radius: 0.25rem !important;
}

.avr-rounded-3 {
    border-radius: 0.5rem !important;
}

/* ===== Shadow Utilities ===== */
.avr-shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.avr-shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* ===== Flex Utilities ===== */
.avr-d-flex {
    display: flex !important;
}

.avr-justify-content-end {
    justify-content: flex-end !important;
}

.avr-justify-content-center {
    justify-content: center !important;
}

.avr-align-items-center {
    align-items: center !important;
}

.avr-gap-2 {
    gap: 0.5rem !important;
}

.avr-flex-wrap {
    flex-wrap: wrap !important;
}

.avr-flex-shrink-0 {
    flex-shrink: 0 !important;
}

/* ===== Spacing Utilities ===== */
.avr-m-0 { margin: 0 !important; }
.avr-mb-0 { margin-bottom: 0 !important; }
.avr-mb-1 { margin-bottom: 0.25rem !important; }
.avr-mb-2 { margin-bottom: 0.5rem !important; }
.avr-mb-3 { margin-bottom: 1rem !important; }
.avr-mb-4 { margin-bottom: 1.5rem !important; }
.avr-mt-3 { margin-top: 1rem !important; }

.avr-p-0 { padding: 0 !important; }
.avr-p-3 { padding: 1rem !important; }
.avr-p-4 { padding: 1.5rem !important; }
.avr-pt-0 { padding-top: 0 !important; }
.avr-pt-2 { padding-top: 0.5rem !important; }
.avr-pt-3 { padding-top: 1rem !important; }
.avr-pb-0 { padding-bottom: 0 !important; }
.avr-pb-4 { padding-bottom: 1.5rem !important; }
.avr-pe-3 { padding-right: 1rem !important; }
.avr-ps-3 { padding-left: 1rem !important; }
.avr-px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.avr-py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }

/* ===== Typography Utilities ===== */
.avr-text-center {
    text-align: center !important;
}

.avr-fw-bold {
    font-weight: 700 !important;
}

.avr-fw-semibold {
    font-weight: 600 !important;
}

.avr-text-muted {
    color: #6c757d !important;
}

.avr-text-danger {
    color: #dc3545 !important;
}

.avr-text-secondary {
    color: #6c757d !important;
}

.avr-small {
    font-size: 0.875em !important;
}

.avr-lh-lg {
    line-height: 1.65 !important;
}

/* ===== Body scroll lock ===== */
body.avr-modal-open {
    overflow: hidden;
}

/* ===== Responsive ===== */
@media (min-width: 576px) {
    .avr-modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }

    .avr-modal-dialog.avr-modal-lg {
        max-width: 800px;
    }
}

@media (max-width: 480px) {
    .avr-modal-dialog {
        align-items: flex-end;
    }

    .avr-modal-content {
        border-radius: 20px 20px 0 0;
    }
}
