/* NexGen Frontend Styles */
.bp-widget-gallery { width: 100%; }

/* Hover Effects */
.bp-gallery-item.bp-hover-zoom:hover .bp-img-container img {
    transform: scale(1.1);
}

.bp-gallery-item.bp-hover-grayscale .bp-img-container img {
    filter: grayscale(100%);
}
.bp-gallery-item.bp-hover-grayscale:hover .bp-img-container img {
    filter: grayscale(0%);
}

.bp-gallery-item.bp-hover-opacity:hover .bp-img-container img {
    opacity: 0.7;
}

/* Meta Grid Styling */
.bp-gallery-meta {
    transition: all 0.3s ease;
}
.bp-gallery-item:hover .bp-gallery-meta {
    background: #f8fafc !important;
}

/* Lightbox Styles */
#bp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    z-index: 999999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
}

#bp-lightbox img {
    max-width: 85%;
    max-height: 75%;
    object-fit: contain;
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
    border-radius: 4px;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#bp-lightbox.active img {
    transform: scale(1);
}

.bp-lightbox-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    text-align: center;
    pointer-events: none;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

#bp-lightbox.active .bp-lightbox-meta {
    transform: translateY(0);
    opacity: 1;
}

.bp-lb-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.bp-lb-caption {
    margin: 0;
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    max-width: 600px;
    margin: 0 auto;
}

#bp-lightbox .close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

#bp-lightbox .close-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

/* NexGen Button Effects */
.bp-btn-primary:hover, .bp-btn-secondary:hover { opacity: 0.9; transform: translateY(-1px); }
.bp-btn-outline:hover { background: #6366f1 !important; color: #fff !important; }
.bp-btn-ghost:hover { background: rgba(99, 102, 241, 0.1) !important; }

/* Carousel Styles */
.bp-carousel-container { position: relative; width: 100%; }
.bp-carousel-track { display: flex; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

/* Read More Hover */
.bp-read-more:hover { opacity: 0.7; }

/* NexGen Testimonial Carousel Scrollbar Hide */
.bp-testimonial-carousel::-webkit-scrollbar { display: none; }

/* Responsive Hiding */
@media (min-width: 1025px) { .bp-hide-desktop { display: none !important; } }
@media (min-width: 768px) and (max-width: 1024px) { .bp-hide-tablet { display: none !important; } }
@media (max-width: 767px) { .bp-hide-mobile { display: none !important; } }

/* Entrance Animations */
.bp-animate { animation-duration: 0.8s; animation-fill-mode: both; }
.fadeInUp { animation-name: fadeInUp; }
.fadeInDown { animation-name: fadeInDown; }
.fadeInLeft { animation-name: fadeInLeft; }
.fadeInRight { animation-name: fadeInRight; }
.zoomIn { animation-name: zoomIn; }
.bounceIn { animation-name: bounceIn; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes bounceIn {
    from, 20%, 40%, 60%, 80%, to { animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); }
    0% { opacity: 0; transform: scale3d(.3, .3, .3); }
    20% { transform: scale3d(1.1, 1.1, 1.1); }
    40% { transform: scale3d(.9, .9, .9); }
    60% { opacity: 1; transform: scale3d(1.03, 1.03, 1.03); }
    80% { transform: scale3d(.97, .97, .97); }
    to { opacity: 1; transform: scale3d(1, 1, 1); }
}

@keyframes bp-slide-up { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
.bp-slider-track::-webkit-scrollbar { display: none; }

/* Advanced Interactions & Motion Effects */
[data-bp-interaction="1"] {
    transition-property: transform, opacity, filter;
    transition-duration: var(--bp-duration, 600ms);
    transition-timing-function: var(--bp-easing, cubic-bezier(0.25, 0.46, 0.45, 0.94));
    will-change: transform, opacity;
}

/* Base states for effects - only if trigger is NOT hover/click or if we want them to start from a state */
[data-bp-effect="fade"]:not(.bp-interaction-active):not([data-bp-trigger="hover"]):not([data-bp-trigger="click"]) { 
    opacity: 0; 
}
[data-bp-effect="zoom"]:not(.bp-interaction-active):not([data-bp-trigger="hover"]):not([data-bp-trigger="click"]) { 
    opacity: 0; transform: scale(0.85); 
}

/* Slide directionals */
[data-bp-effect="slide"]:not(.bp-interaction-active):not([data-bp-trigger="hover"]):not([data-bp-trigger="click"]) { opacity: 0; }
[data-bp-effect="slide"][data-bp-direction="up"]:not(.bp-interaction-active):not([data-bp-trigger="hover"]):not([data-bp-trigger="click"]) { transform: translateY(40px); }
[data-bp-effect="slide"][data-bp-direction="down"]:not(.bp-interaction-active):not([data-bp-trigger="hover"]):not([data-bp-trigger="click"]) { transform: translateY(-40px); }
[data-bp-effect="slide"][data-bp-direction="left"]:not(.bp-interaction-active):not([data-bp-trigger="hover"]):not([data-bp-trigger="click"]) { transform: translateX(40px); }
[data-bp-effect="slide"][data-bp-direction="right"]:not(.bp-interaction-active):not([data-bp-trigger="hover"]):not([data-bp-trigger="click"]) { transform: translateX(-40px); }

/* Active states (Triggered by JS) */
.bp-interaction-active {
    opacity: 1 !important;
    transform: translate(0,0) scale(1) !important;
}

/* Specific Hover Behaviors (Trigger is hover) */
[data-bp-trigger="hover"][data-bp-effect="zoom"].bp-interaction-active {
    transform: scale(1.08) !important;
}
[data-bp-trigger="hover"][data-bp-effect="fade"].bp-interaction-active {
    opacity: 0.8 !important;
}
[data-bp-trigger="hover"][data-bp-effect="slide"][data-bp-direction="up"].bp-interaction-active { transform: translateY(-10px) !important; }
[data-bp-trigger="hover"][data-bp-effect="slide"][data-bp-direction="down"].bp-interaction-active { transform: translateY(10px) !important; }

/* Responsive Integrity & Performance */
@media (max-width: 767px) {
    [data-bp-interaction="1"] {
        transition-duration: 400ms; /* Faster on mobile */
    }
    [data-bp-effect="slide"]:not(.bp-interaction-active) {
        transform: translateY(20px) !important; /* Smaller offset on mobile to prevent overflow */
    }
}

[data-bp-scrolling_effects="1"], [data-bp-mouse_effects="1"] {
    transition: transform 0.1s linear, opacity 0.2s ease, filter 0.2s ease;
}

.bp-animated {
    visibility: visible !important;
}

/* Force buttons to display as inline-blocks with auto width */
.bp-btn, .bp-button {
    display: inline-block !important;
    width: auto !important;
    max-width: max-content !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    border: none;
    line-height: 1.2 !important;
}

/* Button size classes */
.bp-size-xs { padding: 6px 14px !important; font-size: 12px !important; }
.bp-size-sm { padding: 8px 18px !important; font-size: 14px !important; }
.bp-size-md { padding: 12px 28px !important; font-size: 16px !important; }
.bp-size-lg { padding: 16px 36px !important; font-size: 18px !important; }
.bp-size-xl { padding: 20px 45px !important; font-size: 20px !important; }

/* Fallback default size if not explicitly classed */
.bp-btn:not([class*="bp-size-"]), .bp-button:not([class*="bp-size-"]) {
    padding: 12px 28px !important;
    font-size: 16px !important;
}

.bp-btn:hover, .bp-button:hover {
    opacity: 0.9 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* Inline alignment for adjacent button/icon widgets inside columns */
.bp-widget-button, .bp-widget-icon {
    display: inline-block !important;
    vertical-align: middle;
}
.bp-widget-icon {
    margin-right: 15px;
}
.bp-widget-icon:last-child {
    margin-right: 0;
}

/* Bulletproof CSS Hover/Click Dropdown Menu Toggle */
.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown:focus-within .dropdown-menu,
.nav-item.dropdown .dropdown-toggle[aria-expanded="true"] ~ .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: absolute !important;
}

/* ---------------------------------------------------------------------------
 * Fix for imported HTML templates (Tailwind / Bootstrap / Aura-style) that
 * rely on a design-system of CSS variables which are NOT imported with the
 * HTML. Without these defined, browsers fall back to black/initial -> broken
 * borders/typography on every element. We define a broad, safe design-system
 * scoped to .nexgen-content only, so any imported template renders as
 * intended. Colors are neutral; recolor per-template later if desired.
 * ------------------------------------------------------------------------- */
.nexgen-content {
    /* Generic (Aura / misc) */
    --border-color: #e2e8f0;
    --radius-sm: 8px;  --radius: 12px; --radius-md: 12px; --radius-lg: 16px;
    --radius-xl: 20px; --radius-pill: 999px; --radius-xxl: 24px;
    --bg-main: #ffffff; --bg-white: #ffffff; --bg-light: #f8fafc;
    --bg-alternate: #f1f5f9;
    --text-primary: #1e293b; --text-dark: #0f172a; --text-medium: #475569;
    --text-light: #f8fafc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.10);
    --shadow-xl: 0 20px 40px rgba(0,0,0,.12);
    /* Brand palette (override per template later) */
    --primary: #4f46e5; --primary-700: #4338ca; --primary-900: #312e81;
    --secondary: #0ea5e9; --secondary-green: #10b981; --accent-amber: #f59e0b;
    --gradient-primary: linear-gradient(135deg, #4f46e5, #0ea5e9);
    /* Typography */
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Poppins', system-ui, -apple-system, sans-serif;
    /* Motion */
    --transition-fast: all .15s ease;
    --transition-normal: all .3s ease;
    /* Glassmorphism (some templates) */
    --glass-bg: rgba(255,255,255,.6);
    --glass-border: rgba(255,255,255,.4);
}
/* Recolor the harsh explicit black borders the importer keeps as inline
 * styles on widget wrappers (e.g. Aura template border-color:#000000) to the
 * subtle design-system color. Intended card borders (via width utilities)
 * are preserved, just recolored. Does NOT affect form <input> borders. */
.nexgen-content .bp-widget-wrapper {
    border-color: var(--border-color) !important;
}
