/* Intro Takeover by Foxco - v1.2.0 */

/* Zero widget-container padding so editor preview matches live. */
.elementor-widget-itbf_intro_takeover > .elementor-widget-container {
    padding: 0;
}

/* Lock body scroll while takeover is playing. */
html.itbf-scroll-locked,
html.itbf-scroll-locked body {
    overflow: hidden !important;
    height: 100% !important;
}

/* Tiny placeholder left where the widget sits in the page. */
.itbf-placeholder {
    display: none;
}

/* Empty state shown when no content is configured. */
.itbf-empty {
    padding: 40px;
    text-align: center;
    background: #f5f5f5;
    color: #666;
    border: 1px dashed #ccc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Editor note / preview wrapper. */
.itbf-editor-note {
    padding: 12px 16px;
    background: #fff7e6;
    border: 1px dashed #e0a030;
    color: #7a5a00;
    font-size: 13px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.itbf-editor-preview {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
}
.itbf-editor-preview .itbf-takeover {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
}
.itbf-editor-preview .itbf-corner,
.itbf-editor-preview .itbf-popover {
    display: none !important;
}

/* ==========================================================
   TAKEOVER SHELL
   ========================================================== */
.itbf-takeover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: #000;
    overflow: hidden;
    will-change: transform, opacity;
}
.itbf-takeover.itbf-is-minimized {
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

/* Media container fills takeover. */
.itbf-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.itbf-media video,
.itbf-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Iframe wrap for YouTube/Vimeo - JS oversizes the iframe to cover. */
.itbf-iframe-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}
.itbf-iframe-wrap iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 0;
    display: block;
    max-width: none;
}

/* Template wrap - takes over the full viewport; scroll if template
   content exceeds viewport height. */
.itbf-template-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}
.itbf-template-wrap > .elementor-section,
.itbf-template-wrap > .elementor-section > .elementor-container,
.itbf-template-wrap > .e-con,
.itbf-template-wrap .elementor-element {
    max-width: none;
}
.itbf-template-wrap > .elementor-section {
    width: 100%;
    min-height: 100%;
}

/* ==========================================================
   TEXT OVERLAY
   Per-widget color/size/font values are injected by the PHP
   renderer as a scoped <style> block. Rules below are structural.
   ========================================================== */

/* Dark overlay tint for legibility - sits above media, below text. */
.itbf-overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    pointer-events: none;
    z-index: 5;
}

/* Text container fills the takeover and aligns via flex. */
.itbf-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    z-index: 6;
    pointer-events: none;
    box-sizing: border-box;
}

.itbf-overlay-inner {
    max-width: 900px;
    width: 100%;
    pointer-events: auto;
}

.itbf-overlay-heading {
    margin: 0 0 16px;
    color: #fff;
}

.itbf-overlay-sub {
    margin: 0;
    color: #f0f0f0;
}

/* WYSIWYG emits <p> tags inside the subheading. Reset margins
   so nested paragraphs behave. */
.itbf-overlay-sub > p {
    margin-top: 0;
    margin-bottom: 0.5em;
}
.itbf-overlay-sub > p:last-child {
    margin-bottom: 0;
}

.itbf-overlay-btn {
    display: inline-block;
    margin-top: 24px;
    background: #df6737;
    color: #fff;
    border: 0;
    text-decoration: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    line-height: 1;
}
.itbf-overlay-btn:hover,
.itbf-overlay-btn:focus {
    transform: translateY(-1px);
    opacity: 0.92;
    outline: none;
    text-decoration: none;
    color: inherit;
}

/* Entrance animations - fire when takeover enters playing state. */
.itbf-is-playing .itbf-overlay--fade .itbf-overlay-inner {
    animation: itbf-overlay-fade 700ms ease 120ms both;
}
.itbf-is-playing .itbf-overlay--fade-up .itbf-overlay-inner {
    animation: itbf-overlay-fade-up 700ms cubic-bezier(.2,.7,.2,1) 120ms both;
}
@keyframes itbf-overlay-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes itbf-overlay-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .itbf-is-playing .itbf-overlay--fade .itbf-overlay-inner,
    .itbf-is-playing .itbf-overlay--fade-up .itbf-overlay-inner {
        animation: none !important;
    }
}

/* Close button. */
.itbf-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.itbf-close:hover,
.itbf-close:focus {
    background: rgba(0,0,0,0.8);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.08);
    outline: none;
}

/* ==========================================================
   CORNER BUTTON (minimized state)
   Defaults below are fallbacks - the widget emits inline
   <style> rules scoped by [data-itbf-for] that override these.
   ========================================================== */
.itbf-corner {
    position: fixed;
    z-index: 999998;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #1a1a2e;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    font-family: inherit;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.itbf-corner.itbf-corner--visible { display: inline-flex; }
.itbf-corner:hover,
.itbf-corner:focus {
    transform: translateY(-2px);
    outline: none;
}

/* Shadow variants. */
.itbf-corner--shadow-none   { box-shadow: none; }
.itbf-corner--shadow-small  { box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.itbf-corner--shadow-medium { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.itbf-corner--shadow-large  { box-shadow: 0 10px 40px rgba(0,0,0,0.45); }
.itbf-corner--shadow-small:hover,
.itbf-corner--shadow-small:focus  { box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
.itbf-corner--shadow-medium:hover,
.itbf-corner--shadow-medium:focus { box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.itbf-corner--shadow-large:hover,
.itbf-corner--shadow-large:focus  { box-shadow: 0 14px 50px rgba(0,0,0,0.55); }

/* Position variants - corners pin to edge; middle-left/right center vertically. */
.itbf-corner--bottom-right { bottom: 20px; right: 20px; }
.itbf-corner--bottom-left  { bottom: 20px; left: 20px; }
.itbf-corner--top-right    { top: 20px; right: 20px; }
.itbf-corner--top-left     { top: 20px; left: 20px; }
.itbf-corner--middle-right { top: 50%; right: 20px; transform: translateY(-50%); }
.itbf-corner--middle-left  { top: 50%; left: 20px;  transform: translateY(-50%); }
/* Preserve the centering transform on hover while still lifting slightly. */
.itbf-corner--middle-right:hover,
.itbf-corner--middle-right:focus { transform: translateY(calc(-50% - 2px)); }
.itbf-corner--middle-left:hover,
.itbf-corner--middle-left:focus  { transform: translateY(calc(-50% - 2px)); }

.itbf-corner-media {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #df6737;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 36px;
}
.itbf-corner-media svg {
    width: 16px;
    height: 16px;
    margin-left: 2px; /* optical centering of play triangle */
}
.itbf-corner-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.itbf-corner-label {
    padding-right: 4px;
    letter-spacing: 0.01em;
}

/* Icon-only variant: drop padding and make the icon fill the button. */
.itbf-corner--icon-only {
    padding: 6px !important;
    gap: 0 !important;
}

/* ==========================================================
   POPOVER MENU
   ========================================================== */
.itbf-popover {
    position: fixed;
    z-index: 999999;
    min-width: 180px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    padding: 6px;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    font-family: inherit;
}
.itbf-popover.itbf-popover--open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.itbf-popover-action {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-size: 14px;
    color: #1a1a2e;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}
.itbf-popover-action:hover,
.itbf-popover-action:focus {
    background: #f0f0f4;
    outline: none;
}
.itbf-popover-action[data-action="dismiss"] {
    color: #a03030;
}

/* ==========================================================
   MOBILE TWEAKS
   ========================================================== */
@media (max-width: 640px) {
    .itbf-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    .itbf-corner--bottom-right { bottom: 14px; right: 14px; }
    .itbf-corner--bottom-left  { bottom: 14px; left: 14px; }
    .itbf-corner--top-right    { top: 14px; right: 14px; }
    .itbf-corner--top-left     { top: 14px; left: 14px; }
    .itbf-corner--middle-right { right: 14px; }
    .itbf-corner--middle-left  { left: 14px; }
}
