/* Keylock overlay for blurred images */
.blurred-image-container {
    position: relative;
    /* Ensure the container always fills its parent width on all devices */
    display: block;
    width: 100%;
    max-width: 100%;
}

/* Make any image inside the blurred container scale to the container */
.blurred-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* Ensure full-width fit inside post containers */
.post-image-container .blurred-image-container {
    display: block;
    width: 100%;
    max-width: 100%;
}

/* Images inside blurred container should scale to container */
.blurred-image-container img.post-image,
.blurred-image-container img.gallery-image {
    width: 100%;
    height: auto;
    display: block;
}
.feed-content .blurred-image-container,
.post-image-container .blurred-image-container,
.post-gallery .blurred-image-container {
    width: 100%;
    max-width: 100%;
}

/* Stronger rule-set to ensure full-width scaling on some mobile browsers */
.post-image-container .blurred-image-container img,
.post-gallery .blurred-image-container img,
.feed-content .blurred-image-container img {
    width: 100% !important;
    height: auto !important;
    display: block;
}
.keylock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
}

.keylock-overlay:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.keylock-overlay i {
    color: var(--color-accent, #ffc107);
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Different sizes for different image types */
.model-profile-image + .keylock-overlay {
    width: 80px;
    height: 80px;
}

.model-profile-image + .keylock-overlay i {
    font-size: 32px;
}

.model-avatar + .keylock-overlay {
    width: 50px;
    height: 50px;
}

.model-avatar + .keylock-overlay i {
    font-size: 20px;
}

.gallery-image + .keylock-overlay {
    width: 40px;
    height: 40px;
}

.gallery-image + .keylock-overlay i {
    font-size: 18px;
}

.update-image + .keylock-overlay {
    width: 50px;
    height: 50px;
}

.update-image + .keylock-overlay i {
    font-size: 22px;
}

/* Login prompt text - only for login links, not unlock buttons */
.keylock-overlay:not(.unlock-button)::after {
    content: "Login to view";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Unlock text styling */
.keylock-overlay span {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Unlock button styling */
.unlock-button {
    cursor: pointer;
    transition: all 0.3s ease;
}

.unlock-button:hover {
    background: rgba(255, 193, 7, 0.2);
    transform: translate(-50%, -50%) scale(1.05);
}

.unlock-button span {
    color: #ffc107;
    font-weight: bold;
}

/* Coin display styling */
.coin-display {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 4px 8px;
    font-size: 14px !important;
    font-weight: bold;
}

.user-coins {
    color: #ffc107;
    margin-left: 2px;
}

.keylock-overlay:not(.unlock-button):hover::after {
    opacity: 1;
}

/* Ensure the container maintains proper positioning */
.gallery-item {
    position: relative;
}

/* Animation for the keylock */
@keyframes keylockPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.keylock-overlay {
    animation: keylockPulse 2s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .keylock-overlay {
        width: 50px;
        height: 50px;
    }
    
    .keylock-overlay i {
        font-size: 20px;
    }
    
    .model-profile-image + .keylock-overlay {
        width: 60px;
        height: 60px;
    }
    
    .model-profile-image + .keylock-overlay i {
        font-size: 24px;
    }
}
