/* ---------------------------------------------------------
   Phase 3: Exit-Intent Popup Animations & Styling
--------------------------------------------------------- */
@keyframes poolrxOverlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes poolrxPopupBounce {
    0% { transform: scale(0.85); opacity: 0; }
    60% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

#poolrx-exit-popup-overlay.poolrx-active {
    display: flex !important;
    animation: poolrxOverlayFade 0.3s ease forwards;
}

#poolrx-exit-popup-box.poolrx-anim-active {
    animation: poolrxPopupBounce 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.poolrx-btn-continue {
    background: #0433bf !important;
    color: #ffffff !important;
    border: none !important;
    padding: 12px 25px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    width: 100% !important;
    transition: all 0.2s ease !important;
}

.poolrx-btn-continue:hover {
    background: #032791 !important;
    box-shadow: 0 4px 12px rgba(4, 51, 191, 0.2) !important;
}

/* ---------------------------------------------------------
   Phase 2: Top Bar Alert Styling
--------------------------------------------------------- */
.poolrx-top-bar-wrapper {
    display: block;
    background-color: #0433bf;
    color: #ffffff !important;
    text-align: center;
    padding: 10px 20px;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none !important;
    z-index: 999999;
    width: 100%;
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   Phase 4: Floating Important Notice (Animated UX)
--------------------------------------------------------- */
@keyframes poolrxSonarPulse {
    0% { box-shadow: 0 0 0 0 rgba(4, 51, 191, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(4, 51, 191, 0); }
    100% { box-shadow: 0 0 0 0 rgba(4, 51, 191, 0); }
}

@keyframes poolrxShineEffect {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

#poolrx-home-trigger-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999998;
    background: #0433bf;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.3s ease;
    overflow: hidden; 
    animation: poolrxSonarPulse 3s infinite; 
}

#poolrx-home-trigger-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: poolrxShineEffect 4s infinite;
}

@media (max-width: 768px) {
    #poolrx-home-trigger-btn { bottom: 85px; left: 15px; font-size: 14px; padding: 10px 20px; }
}

/* ---------------------------------------------------------
   Phase 5: Seller Verification Search Bar (Compact)
--------------------------------------------------------- */
.poolrx-seller-search-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eeeeee;
}

.poolrx-seller-input-group {
    display: flex;
    align-items: stretch;
    position: relative;
    margin-top: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 3px;
}

.poolrx-seller-input-group:focus-within { border-color: #0433bf; }

#poolrx-seller-input {
    flex-grow: 1;
    padding: 8px 15px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
}

#poolrx-seller-check-btn {
    background: #0433bf;
    color: #ffffff;
    border: none;
    padding: 0 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

/* ---------------------------------------------------------
   Phase 6: Authorized Links (Ultra-Compact & Clean)
--------------------------------------------------------- */
.poolrx-auth-links-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eeeeee;
}

.poolrx-auth-links-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.poolrx-auth-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 6px 12px;
    transition: background 0.2s ease;
}

.poolrx-auth-card:hover {
    background: #f8faff;
    border-color: #cbd5e1;
}

.poolrx-auth-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.poolrx-auth-card-btn {
    background: #0433bf;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 2px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
}

/* Popup Scroll Settings */
#poolrx-home-popup-box {
    overflow-y: auto;
}
#poolrx-home-popup-box::-webkit-scrollbar { width: 4px; }
#poolrx-home-popup-box::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

/* ---------------------------------------------------------
   Phase 3: Coupon Box Styling
--------------------------------------------------------- */
.poolrx-coupon-container {
    margin: 0 0 25px 0;
    padding: 15px;
    background: #f8faff;
    border: 2px dashed #0433bf;
    border-radius: 8px;
    text-align: center;
}

.poolrx-coupon-label {
    font-size: 14px !important;
    color: #334155 !important;
    margin: 0 0 10px 0 !important;
    font-weight: 600 !important;
    font-family: inherit;
}

.poolrx-coupon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.poolrx-coupon-box:hover, .poolrx-coupon-box:active {
    border-color: #0433bf;
    background: #f0f4ff;
}

.poolrx-coupon-code {
    font-size: 18px;
    font-weight: bold;
    color: #0433bf;
    letter-spacing: 1px;
    margin-right: 15px;
    font-family: monospace;
}

.poolrx-copy-text {
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    background: #0433bf;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    transition: background 0.2s ease;
}

.poolrx-coupon-box:hover .poolrx-copy-text {
    background: #032791;
}

.poolrx-copy-success {
    font-size: 13px !important;
    color: #16a34a !important;
    margin: 10px 0 0 0 !important;
    font-weight: 600 !important;
    animation: poolrxOverlayFade 0.3s ease;
}

/* ---------------------------------------------------------
   Phase 7: Floating Video Widget (Full-Screen & Multi-Video)
--------------------------------------------------------- */
@keyframes poolrxWidgetSlideUp {
    from { transform: translateY(150px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes poolrxWidgetSlideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(150px); opacity: 0; }
}

#poolrx-mini-video-widget {
    position: fixed;
    bottom: 20px;
    width: 180px; 
    height: 320px; 
    border-radius: 12px;
    overflow: hidden;
    z-index: 999997;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.3s ease;
    background: #000000;
    aspect-ratio: 9 / 16;
    
    opacity: 0;
    transform: translateY(150px);
    pointer-events: none;
}

#poolrx-mini-video-widget.poolrx-widget-loaded {
    animation: poolrxWidgetSlideUp 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    pointer-events: auto;
}

#poolrx-mini-video-widget.poolrx-slide-out-anim {
    animation: poolrxWidgetSlideDown 0.4s ease forwards !important;
    pointer-events: none;
}

#poolrx-mini-video-widget.poolrx-pos-left { left: 20px; }
#poolrx-mini-video-widget.poolrx-pos-right { right: 20px; }

@media (max-width: 768px) {
    #poolrx-mini-video-widget {
        bottom: 85px;
        width: 110px;
        height: 195px; 
    }
    #poolrx-mini-video-widget.poolrx-pos-left { left: 15px; }
    #poolrx-mini-video-widget.poolrx-pos-right { right: 15px; }
}

#poolrx-mini-video-widget:hover {
    transform: scale(1.02);
}

.poolrx-mini-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; 
    display: block; 
}

.poolrx-video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(246, 211, 17, 0.95); 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff; 
    font-size: 18px;
    padding-left: 3px; 
    box-sizing: border-box;
}

.poolrx-video-close-mini {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff !important;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
    box-sizing: border-box;
    transition: all 0.3s ease !important;
}

.poolrx-video-close-mini:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: rotate(90deg) scale(1.1);
}

/* =========================================================
   NEW OVERLAY & FULL-SCREEN LAYOUT
========================================================= */
#poolrx-video-modal-overlay {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.90);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

.poolrx-video-modal-close {
    position: absolute;
    top: 25px;
    left: 25px; 
    background: transparent;
    border: none;
    color: #ffffff !important;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    z-index: 1000000;
    padding: 0;
    line-height: 1;
    transition: transform 0.3s ease !important;
}

.poolrx-video-modal-close:hover {
    transform: scale(1.2);
}

.poolrx-video-mute-btn {
    position: absolute;
    top: 25px;
    right: 25px; 
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000000;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    letter-spacing: 0.5px;
}
.poolrx-video-mute-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Video-ul Principal Fortat 9:16 Centrat */
.poolrx-video-main-wrapper {
    position: relative;
    height: 85vh; 
    max-height: 850px;
    aspect-ratio: 9 / 16;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Gradient elegant la baza pentru a scoate butonul in evidenta peste clip */
.poolrx-video-main-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 15;
}

@media (max-width: 768px) {
    .poolrx-video-modal-close { top: 15px; left: 15px; font-size: 28px; }
    .poolrx-video-mute-btn { top: 15px; right: 15px; font-size: 11px; padding: 6px 12px; }
    
    .poolrx-video-main-wrapper {
        width: 90%;
        height: auto;
        max-height: 80vh;
    }
    .poolrx-video-main-wrapper.has-multiple {
        margin-bottom: 110px; 
    }
}

.poolrx-video-full-player {
    width: 100%;
    height: 100%; 
    object-fit: cover;
    background: #000000;
    border: none;
    display: block;
}

/* ---------------------------------------------------------
   NEW: MODERN FLOATING CALL TO ACTION BUTTON
--------------------------------------------------------- */
.poolrx-video-modal-action {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 50px);
    max-width: 320px;
    background: linear-gradient(135deg, #f6d311 0%, #e0b800 100%);
    color: #0433bf !important; 
    text-align: center;
    padding: 16px 20px;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(246, 211, 17, 0.3);
    z-index: 20;
    overflow: hidden;
    border: none;
    transition: box-shadow 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.poolrx-video-modal-action:hover {
    transform: translateX(-50%) translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #ffe033 0%, #f6d311 100%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(246, 211, 17, 0.6);
}

/* ---------------------------------------------------------
   Sidebar Playlist (Doar poze pentru performanta)
--------------------------------------------------------- */
.poolrx-video-sidebar {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000000;
    padding-right: 10px;
}

.poolrx-video-sidebar::-webkit-scrollbar { width: 4px; }
.poolrx-video-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

.poolrx-video-thumb {
    width: 70px;
    height: 124px; 
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: all 0.2s ease;
    background: #222222;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.poolrx-video-thumb.active, .poolrx-video-thumb:hover {
    opacity: 1;
    border-color: #f6d311;
}

.poolrx-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sidebar pe tableta/mobil se muta jos (orizontal) */
@media (max-width: 1024px) {
    .poolrx-video-sidebar {
        left: 15px;
        .poolrx-video-thumb { width: 60px; height: 106px; }
    }
}

@media (max-width: 768px) {
    .poolrx-video-sidebar {
        position: absolute;
        bottom: 20px;
        left: 0;
        top: auto;
        transform: none;
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px 15px;
        gap: 10px;
        justify-content: flex-start;
        box-sizing: border-box;
    }
    .poolrx-video-sidebar::-webkit-scrollbar { height: 4px; }
    .poolrx-video-thumb { width: 55px; height: 97px; }
}