/* Hover Box Widget Styles - Fully Elementor Controlled */

.hover-box-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    background: #000;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.hover-box-container:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Background Image */
.hover-box-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
    z-index: 1;
}

/* Blur Overlay - Base */
.hover-box-blur-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 30%,
        rgba(0, 0, 0, 0.4) 60%,
        rgba(0, 0, 0, 0.1) 85%,
        rgba(0, 0, 0, 0) 100%
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2;
    pointer-events: none;
}

/* Blur Fade Effect - Base mask for when enabled */
.hover-box-container[data-blur-fade="yes"] .hover-box-blur-overlay {
    /* Default mask - will be overridden by Elementor selector */
    -webkit-mask: linear-gradient(
        to top,
        black 0%,
        black 40%,
        rgba(0, 0, 0, 0.5) 60%,
        transparent 85%
    );
    mask: linear-gradient(
        to top,
        black 0%,
        black 40%,
        rgba(0, 0, 0, 0.5) 60%,
        transparent 85%
    );
}

/* No fade effect when disabled */
.hover-box-container[data-blur-fade=""] .hover-box-blur-overlay,
.hover-box-container[data-blur-fade="no"] .hover-box-blur-overlay {
    -webkit-mask: none;
    mask: none;
}

/* Corner Text */
.hover-box-corner-text {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #ff0000;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Content Container */
.hover-box-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 150px;
}

/* Title */
.hover-box-title {
    color: #ffffff;
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    transition: transform 0.3s ease-in-out,
                margin 0.3s ease-in-out;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Hidden Content Container - Controlled by Elementor */
.hover-box-hidden-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    /* Default transitions - will be overridden by Elementor selectors */
    transition: max-height 0.8s ease-in-out, opacity 0.8s ease-in-out;
    transition-delay: 0s, 0.15s;
}

/* Bottom Row - Controlled by Elementor */
.hover-box-bottom-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    transform: translateY(30px);
    opacity: 0;
    /* Default transitions - will be overridden by Elementor selectors */
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
    transition-delay: 0.3s;
}

/* Subtext */
.hover-box-subtext {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 20px 0;
    padding: 10px 15px;
    border-radius: 4px;
    flex: 1;
    min-width: 200px;
}

/* Button */
.hover-box-button {
    display: inline-block;
    background-color: #007cba;
    color: #ffffff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    white-space: nowrap;
}

.hover-box-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 124, 186, 0.4);
}

/* Button Icon Styles */
.hover-box-button .button-icon-before,
.hover-box-button .button-icon-after {
    transition: transform 0.3s ease;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
}

.hover-box-button .button-icon-after {
    margin-left: 6px;
}

.hover-box-button .button-icon-before {
    margin-right: 6px;
}

.hover-box-button .custom-upload-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.hover-box-button:hover .button-icon-after {
    transform: translateX(3px);
}

.hover-box-button:hover .button-icon-before {
    transform: translateX(-3px);
}

.hover-box-button:hover .custom-upload-icon {
    transform: scale(1.1);
}

/* Hover Effects */
.hover-box-container:hover .hover-box-bg-image {
    transform: scale(1.1);
}

.hover-box-container:hover .hover-box-title {
    transform: translateY(0px);
}

.hover-box-container:hover .hover-box-hidden-content {
    max-height: 500px;
    opacity: 1;
    transition-delay: 0s, 0s;
}

.hover-box-container:hover .hover-box-bottom-row {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hover-box-content {
        padding: 20px;
    }
    
    .hover-box-title {
        font-size: 24px;
    }
    
    .hover-box-subtext {
        font-size: 14px;
        min-width: auto;
    }
    
    .hover-box-button {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .hover-box-corner-text {
        top: 15px;
        right: 15px;
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .hover-box-bottom-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .hover-box-content {
        padding: 15px;
    }
    
    .hover-box-title {
        font-size: 20px;
    }
    
    .hover-box-subtext {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .hover-box-button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .hover-box-corner-text {
        top: 10px;
        right: 10px;
    }
}

/* Touch devices - show content on tap with animation */
@media (hover: none) {
    .hover-box-container:active .hover-box-bg-image {
        transform: scale(1.1);
    }
    
    .hover-box-container:active .hover-box-title {
        transform: translateY(0px);
    }
    
    .hover-box-container:active .hover-box-hidden-content {
        max-height: 500px;
        opacity: 1;
        transition-delay: 0s, 0s;
    }
    
    .hover-box-container:active .hover-box-bottom-row {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Ensure smooth transitions */
.hover-box-container * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix for Safari backdrop-filter */
@supports not (backdrop-filter: blur(8px)) {
    .hover-box-blur-overlay {
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.95) 0%,
            rgba(0, 0, 0, 0.8) 30%,
            rgba(0, 0, 0, 0.5) 60%,
            rgba(0, 0, 0, 0.2) 85%,
            rgba(0, 0, 0, 0) 100%
        );
    }
}

/* Focus States for Accessibility */
.hover-box-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: 3px;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    .hover-box-container,
    .hover-box-container *,
    .hover-box-bg-image,
    .hover-box-title,
    .hover-box-hidden-content,
    .hover-box-button,
    .hover-box-blur-overlay,
    .hover-box-corner-text,
    .hover-box-bottom-row {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
