/* ===== POPUP BASE STYLES ===== */
.popup-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #DFE3E8;
}

/* ===== DISPLAY TYPE STYLES ===== */
.popup-slidein { position: absolute; }

/* ===== SLIDE-IN POSITION STYLES ===== */
.popup-container.popup-slidein-top-left { position: absolute; top: 24px; left: 24px; }
.popup-container.popup-slidein-top-center { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); }
.popup-container.popup-slidein-top-right { position: absolute; top: 24px; right: 24px; }
.popup-container.popup-slidein-center-left { position: absolute; top: 50%; left: 24px; transform: translateY(-50%); }
.popup-container.popup-slidein-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.popup-container.popup-slidein-center-right { position: absolute; top: 50%; right: 24px; transform: translateY(-50%); }
.popup-container.popup-slidein-bottom-left { position: absolute; bottom: 24px; left: 24px; }
.popup-container.popup-slidein-bottom-center { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); }
.popup-container.popup-slidein-bottom-right { position: absolute; bottom: 24px; right: 24px; }


/* ===== SIDEBAR POSITION STYLES ===== */
.popup-container.popup-sidebar { position: absolute; height: 100%; border-radius: 0; }
.popup-container.popup-sidebar-left { position: absolute; top: 0; bottom: 0; left: 0; height: 100%; border-radius: 0; }
.popup-container.popup-sidebar-right { position: absolute; top: 0; bottom: 0; right: 0; height: 100%; border-radius: 0; }
/* ===== BAR POSITION STYLES ===== */
.popup-container.popup-bar { position: absolute; border-radius: 0; }
.popup-container.popup-bar-top { position: absolute; top: 0; left: 0; right: 0; border-radius: 0; }
.popup-container.popup-bar-center { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); border-radius: 0; }
.popup-container.popup-bar-bottom { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 0; }
.popup-container.popup-fullscreen { position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: 100%; border-radius: 0; box-shadow: none; }

/* ===== DEVICE-SPECIFIC SIZES ===== */
/* Mobile device preview - higher specificity */
.popup-container.device-mobile.popup-slidein { width: 100% ; max-width: 500px ; }
.popup-container.device-mobile.popup-sidebar { width: 100% ; max-width: 500px ; }
.popup-container.device-mobile.popup-bar { width: 100% ; }
.popup-container.device-mobile.popup-fullscreen { width: 100% ; height: 100% ; }

/* Laptop device preview */
.popup-container.device-laptop.popup-slidein { width: 100% ; max-width: 500px ; }
.popup-container.device-laptop.popup-sidebar { width: 100% ; max-width: 500px ; }
.popup-container.device-laptop.popup-bar { width: 100% ; }
.popup-container.device-laptop.popup-fullscreen { width: 100% ; height: 100% ; }

/* Desktop device preview */
.popup-container.device-desktop.popup-slidein { width: 100% ; max-width: 500px ; }
.popup-container.device-desktop.popup-sidebar { width: 100% ; max-width: 500px ; }
.popup-container.device-desktop.popup-bar { width: 100% ; }
.popup-container.device-desktop.popup-fullscreen { width: 100% ; height: 100% ; }

/* ===== CONTENT STYLES ===== */
.popup-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    position: relative;
}

.popup-close-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #E5E7EB;
    background: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.popup-layout {
    flex: 1;
    min-height: 0;
}

.popup-layout-top,
.popup-layout-bottom {
    display: block;
}

.popup-layout-left,
.popup-layout-right {
    display: flex;
    gap: 12px;
}

.popup-layout-right {
    flex-direction: row-reverse;
}

.popup-text-content {
    overflow: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

.popup-image-container {
    flex-shrink: 0;
}

.popup-image-top,
.popup-image-bottom {
    width: 100%;
    height: auto;
}

.popup-image-top {
    margin-bottom: 12px;
}

.popup-image-bottom {
    margin-top: 12px;
}

.popup-image-side {
    width: 250px;
    height: 190px;
    min-height: 190px;
    
}

.popup-image {
    border-radius: 6px;
    object-fit: var(--image-object-fit, cover);
    width: 100%;
    height: auto;
}

/* Image sizes for different positions */
.popup-image-top .popup-image,
.popup-image-bottom .popup-image {
    width: 100%;
    height: auto;
    max-height: 300px;

}

/* Make user inputs override defaults in each layout */
.popup-image-top .popup-image.popup-image-custom-size {
    width: var(--image-width, 100%) ;
    height: var(--image-height, auto);
}

.popup-image-bottom .popup-image.popup-image-custom-size {
    width: var(--image-width, 100%) ;
    height: var(--image-height, auto) ;
}

.popup-image-side .popup-image {
    width: 100%;
    height: 100%;
    object-fit: var(--image-object-fit, cover);
    border-radius: 0;
}

.popup-image-side .popup-image.popup-image-custom-size {
    width: var(--image-width, 100%) ;
    height: var(--image-height, 100%) ;
}

/* Custom image sizes - can be overridden */
.popup-image-custom-width {
    width: var(--image-width, 100%) ;
}

.popup-image-custom-height {
    height: var(--image-height, auto) ;
}

.popup-image-custom-size {
    width: var(--image-width, 100%) ;
    height: var(--image-height, auto) ;
}

/* Custom container sizes - can be overridden */
.popup-container-custom-width {
    width: var(--container-width, auto) ;
}

.popup-container-custom-height {
    height: var(--container-height, auto) ;
}

.popup-container-custom-size {
    width: var(--container-width, auto) ;
    height: var(--container-height, auto) ;
    max-width: var(--container-max-width, none) ;
}

/* Ensure custom container size wins over device-specific  widths */
.popup-container.device-mobile.popup-container-custom-size {
    width: var(--container-width, auto) ;
    height: var(--container-height, auto) ;
    max-width: var(--container-max-width, none) ;
}

.popup-container.device-laptop.popup-container-custom-size {
    width: var(--container-width, auto) ;
    height: var(--container-height, auto) ;
    max-width: var(--container-max-width, none) ;
}

.popup-container.device-desktop.popup-container-custom-size {
    width: var(--container-width, auto) ;
    height: var(--container-height, auto) ;
    max-width: var(--container-max-width, none) ;
}

.popup-image-placeholder {
    width: 100%;
    height: 180px;
    background: #F2F4F7;
    border: 1px dashed #D1D5DB;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
}

.popup-image-side .popup-image-placeholder {
    height: 100%;
}

.popup-button-container {
    margin-top: auto;
}

.popup-title { 
    font-size: 16px; 
    font-weight: 600; 
    color: #111827; 
    margin-bottom: 8px; 
}

.popup-description { 
    font-size: 14px; 
    color: #374151; 
    line-height: 1.4; 
}

.popup-button { 
    width: 100%; 
    padding: 10px 14px; 
    background: #111827; 
    color: #fff; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 14px; 
    font-weight: 600; 
}

.popup-button:hover { 
    background: #374151; 
    transform: translateY(-1px); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); 
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .popup-title { font-size: 14px; }
    .popup-description { font-size: 12px; }
}
