/* Ansara Popup Manager – Frontend CSS */

/* Overlay */
.apm-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.apm-overlay.apm-visible {
    opacity: 1;
    visibility: visible;
}

/* Popup box */
.apm-popup-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.3);
    /* Animate.css requiere estas clases base */
}

.apm-popup-box::-webkit-scrollbar { width: 4px; }
.apm-popup-box::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* Close button */
.apm-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    padding: 0;
}
.apm-popup-close:hover {
    background: rgba(0,0,0,0.85);
    transform: scale(1.1);
}

/* Inner layout */
.apm-popup-inner {
    display: flex;
    flex-direction: column;
}

/* Video */
.apm-popup-video {
    width: 100%;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    background: #000;
    line-height: 0;
}

.apm-popup-video video {
    width: 100%;
    display: block;
    max-height: 55vh;
    object-fit: contain;
}

/* Content */
.apm-popup-content {
    padding: 24px 28px 28px;
}

.apm-popup-title {
    font-size: 1.5em;
    font-weight: 800;
    color: #1d1d1f;
    margin: 0 0 12px;
    line-height: 1.25;
}

.apm-popup-desc {
    font-size: 15px;
    color: #555;
    line-height: 1.65;
    margin-bottom: 20px;
}

.apm-popup-desc p    { margin: 0 0 12px; }
.apm-popup-desc p:last-child { margin-bottom: 0; }
.apm-popup-desc a    { color: #764ba2; }
.apm-popup-desc ul,
.apm-popup-desc ol   { padding-left: 20px; margin: 0 0 12px; }

/* Button */
.apm-popup-btn-wrap {
    text-align: center;
    margin-top: 4px;
}

.apm-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: filter 0.2s, transform 0.1s;
    cursor: pointer;
}

.apm-popup-btn:hover  { filter: brightness(1.1); }
.apm-popup-btn:active { transform: scale(0.97); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 540px) {
    .apm-overlay { padding: 0; align-items: flex-end; }
    .apm-popup-box { border-radius: 16px 16px 0 0; max-height: 95vh; }
    .apm-popup-video { border-radius: 16px 16px 0 0; }
    .apm-popup-content { padding: 20px 20px 24px; }
    .apm-popup-title { font-size: 1.2em; }
    .apm-popup-desc  { font-size: 14px; }
}

/* ── Admin preview overlay ──────────────────────── */
.apm-admin-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.apm-admin-preview-box {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.apm-admin-preview-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.apm-admin-preview-iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}
