/* PopCard Frontend Styles */

/* Container */
#popcard-container {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BASE CARD
   ═══════════════════════════════════════════════════════════════════════════ */
.popcard-popup {
    position: fixed;
    z-index: 999999;
    pointer-events: auto;
    overflow: hidden;
    opacity: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}
.popcard-popup.popcard-visible { opacity: 1; }
.popcard-popup.popcard-closing { opacity: 0; pointer-events: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   REEL STYLE — tall narrow, media fills, hover overlay
   ═══════════════════════════════════════════════════════════════════════════ */
.popcard-popup.style-reel {
    width: 200px;
    height: 355px;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 2px 12px rgba(0, 0, 0, 0.15);
}

.popcard-popup.style-reel .popcard-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.popcard-popup.style-reel .popcard-media img,
.popcard-popup.style-reel .popcard-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hover overlay */
.popcard-popup.style-reel .popcard-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 50%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}
.popcard-popup.style-reel:hover .popcard-overlay {
    opacity: 1;
}

.popcard-popup.style-reel .popcard-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.popcard-popup.style-reel .popcard-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    background: #fff;
    color: #111 !important;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}
.popcard-popup.style-reel .popcard-cta:hover {
    background: #e8e8e8;
    transform: translateY(-1px);
}

/* Reel close */
.popcard-popup.style-reel .popcard-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0;
}
.popcard-popup.style-reel .popcard-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}
.popcard-popup.style-reel .popcard-close svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
    stroke-width: 2.5;
    fill: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CLASSIC STYLE — wider card, text below media
   ═══════════════════════════════════════════════════════════════════════════ */
.popcard-popup.style-classic {
    width: 320px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.popcard-popup.style-classic .popcard-media {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
}
.popcard-popup.style-classic .popcard-media img,
.popcard-popup.style-classic .popcard-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.popcard-popup.style-classic .popcard-overlay {
    padding: 14px 16px 16px;
    background: #fff;
}

.popcard-popup.style-classic .popcard-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popcard-popup.style-classic .popcard-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: #2563eb;
    color: #fff !important;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}
.popcard-popup.style-classic .popcard-cta:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.popcard-popup.style-classic .popcard-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0;
}
.popcard-popup.style-classic .popcard-close:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: scale(1.1);
}
.popcard-popup.style-classic .popcard-close svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 2.5;
    fill: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CTA Arrow Icon (shared)
   ═══════════════════════════════════════════════════════════════════════════ */
.popcard-cta svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   POSITIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.popcard-popup.pos-bottom-right {
    bottom: 24px;
    right: 24px;
    transform: translateY(30px) scale(0.95);
}
.popcard-popup.pos-bottom-right.popcard-visible {
    transform: translateY(0) scale(1);
}
.popcard-popup.pos-bottom-right.popcard-closing {
    transform: translateY(30px) scale(0.9);
}

.popcard-popup.pos-bottom-left {
    bottom: 24px;
    left: 24px;
    transform: translateY(30px) scale(0.95);
}
.popcard-popup.pos-bottom-left.popcard-visible {
    transform: translateY(0) scale(1);
}
.popcard-popup.pos-bottom-left.popcard-closing {
    transform: translateY(30px) scale(0.9);
}

.popcard-popup.pos-center-right {
    top: 50%;
    right: 24px;
    transform: translateX(30px) translateY(-50%) scale(0.95);
}
.popcard-popup.pos-center-right.popcard-visible {
    transform: translateX(0) translateY(-50%) scale(1);
}
.popcard-popup.pos-center-right.popcard-closing {
    transform: translateX(30px) translateY(-50%) scale(0.9);
}

.popcard-popup.pos-center-left {
    top: 50%;
    left: 24px;
    transform: translateX(-30px) translateY(-50%) scale(0.95);
}
.popcard-popup.pos-center-left.popcard-visible {
    transform: translateX(0) translateY(-50%) scale(1);
}
.popcard-popup.pos-center-left.popcard-closing {
    transform: translateX(-30px) translateY(-50%) scale(0.9);
}


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .popcard-popup.style-reel {
        width: 160px;
        height: 285px;
        border-radius: 14px;
    }
    .popcard-popup.style-reel .popcard-overlay { padding: 12px; }
    .popcard-popup.style-reel .popcard-title { font-size: 12px; }
    .popcard-popup.style-reel .popcard-cta { font-size: 11px; padding: 7px 12px; }

    .popcard-popup.style-classic { width: calc(100vw - 24px); }

    .popcard-popup.pos-bottom-right,
    .popcard-popup.pos-bottom-left { bottom: 12px; }
    .popcard-popup.style-classic.pos-bottom-right,
    .popcard-popup.style-classic.pos-bottom-left { left: 12px; right: 12px; }
}

/* Touch devices: always show reel overlay (no hover available) */
@media (hover: none) {
    .popcard-popup.style-reel .popcard-overlay {
        opacity: 1;
    }
}
