@charset "utf-8";

/* Suduk Premium Popup Layer Styles (2025 Trend: Glassmorphism + Minimal) */
.suduk_popup_layer {
    position: absolute;
    z-index: 2000;
    width: 380px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 
        0 20px 50px -10px rgba(0, 0, 0, 0.2),
        0 10px 20px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    display: none;
    
    /* UX Improvement: Prevent text selection during drag interaction */
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Prevent scrolling when interacting with the popup */
}

.suduk_popup_layer.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header with Drag Handle */
.popup_header_drag {
    height: 32px;
    background: transparent;
    cursor: grab; /* Default cursor */
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none; /* Critical for mobile drag */
}

/* Active Drag State Cursor */
.popup_header_drag.dragging {
    cursor: grabbing;
    background: rgba(0,0,0,0.02); /* Slight feedback */
}

/* iOS-style Drag Pill */
.popup_drag_handle {
    width: 36px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
}

.popup_header_drag:hover .popup_drag_handle {
    background: rgba(0, 0, 0, 0.3);
}

.popup_header_drag.dragging .popup_drag_handle {
    background: #000; /* Darker when active */
    transform: scaleX(1.1);
}

/* Content Area */
.popup_content {
    position: relative;
    width: 100%;
    margin-top: -10px;
    padding: 0;
    pointer-events: auto; /* Ensure links inside work */
}

.popup_content img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    pointer-events: none; /* Prevent image drag ghost */
}

/* Minimal Footer */
.popup_footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 16px;
    background: transparent;
}

/* "Don't show today" Checkbox */
.popup_today_check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
    user-select: none;
}

.popup_today_check:hover {
    color: #111;
}

/* Custom Checkbox Design */
.popup_today_check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    margin: 0;
    position: relative;
    transition: all 0.2s;
}

.popup_today_check input[type="checkbox"]:checked {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.popup_today_check input[type="checkbox"]:checked::after {
    content: '✔';
    font-size: 12px;
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Elegant Close Button */
.btn_popup_close {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn_popup_close:hover {
    background: #1a1a1a;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .suduk_popup_layer {
        width: 85%;
        max-width: 320px;
        /* Force center on mobile, ignore inline styles from PHP loop */
        /* Force center X, top Y on mobile */
        left: 50% !important; 
        top: 100px !important; /* Top placement */
        transform: translateX(-50%) !important; /* Only X center */
        margin: 0 !important;
    }
    
    .suduk_popup_layer.show {
        /* Keep centered X when shown */
        transform: translateX(-50%) !important;
    }

    /* Hide drag handle on mobile */
    .popup_header_drag {
        display: none !important;
    }
    
    /* Adjust content margin since header is gone */
    .popup_content {
        margin-top: 0;
    }
}
