:root {
    --bg-color: #f2f2f2;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --text-primary: rgb(15, 15, 15);
    --text-secondary: #555555;
    --blue-france: #0055d4;
    --cta-bg-color: oklch(90.5% 0.182 98.111);
    --cta-text-color: #000000;
    --transition-speed: 0.3s;
    --card-radius: 12px; /* Less rounded as requested */
    /* Global paragraph font size (default is +1pt over previous 1rem baseline) */
    --paragraph-font-size: 1.0625rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lexend', 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden; /* Prevents horizontal scroll from full-width row backgrounds */
}

body.modal-open {
    overflow: hidden !important;
}

/* Optional global background motion. The color-mix transition gives solid
   backgrounds a visible pulse while background-position gives image
   backgrounds a gentle entrance/parallax effect without moving page content. */
body.page-bg-animation-enabled.page-bg-animate-load,
body.page-bg-animation-enabled.page-bg-animate-section {
    animation: page-background-transition 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: background-color, background-position;
}

body.page-bg-animation-enabled.page-bg-animate-section {
    animation-duration: 0.75s;
}

@keyframes page-background-transition {
    0% {
        background-color: color-mix(in srgb, var(--page-bg-color, #f2f2f2) 45%, white);
        background-position: center top;
    }
    55% {
        background-color: color-mix(in srgb, var(--page-bg-color, #f2f2f2) 78%, white);
        background-position: center 42%;
    }
    100% {
        background-color: var(--page-bg-color, #f2f2f2);
        background-position: var(--page-bg-position, center center);
    }
}

/* Decorative background shapes. They are fixed, pointer-free and sit behind
   the hero/content layers, so they never change document layout. */
.page-bg-shapes {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.page-bg-shape {
    position: absolute;
    width: calc(var(--shape-size, 160px) * var(--shape-scale, 1));
    height: calc(var(--shape-size, 160px) * var(--shape-scale, 1));
    background: var(--shape-color, #0055d4);
    opacity: var(--shape-opacity, 0.22);
    animation: page-bg-shape-drift calc(12s + (var(--shape-index, 0) * 1s)) ease-in-out infinite;
    will-change: transform;
}

@keyframes page-bg-shape-drift {
    0%, 100% { transform: translate3d(-18px, 8px, 0) rotate(-2deg) scale(0.96); }
    50% { transform: translate3d(22px, -22px, 0) rotate(5deg) scale(1.04); }
}

.page-bg-shape.shape-circle { border-radius: 50%; }
.page-bg-shape.shape-rounded-square { border-radius: 24%; }
.page-bg-shape.shape-pill { width: calc(var(--shape-size, 160px) * 1.55); height: calc(var(--shape-size, 160px) * 0.62); border-radius: 999px; }
.page-bg-shape.shape-ring { background: transparent; border: max(4px, calc(var(--shape-size, 160px) * 0.07)) solid var(--shape-color, #0055d4); border-radius: 50%; box-sizing: border-box; }
.page-bg-shape.shape-triangle { clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.page-bg-shape.shape-diamond { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.page-bg-shape.shape-hexagon { clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0% 50%); }
.page-bg-shape.shape-octagon { clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%); }
.page-bg-shape.shape-star { clip-path: polygon(50% 0%, 61% 36%, 98% 36%, 68% 58%, 79% 95%, 50% 72%, 21% 95%, 32% 58%, 2% 36%, 39% 36%); }
.page-bg-shape.shape-burst { clip-path: polygon(50% 0%, 58% 27%, 79% 7%, 73% 35%, 100% 29%, 77% 50%, 100% 71%, 72% 65%, 79% 93%, 58% 73%, 50% 100%, 42% 73%, 21% 93%, 28% 65%, 0% 71%, 23% 50%, 0% 29%, 28% 35%, 21% 7%, 42% 27%); }
.page-bg-shape.shape-blob { border-radius: 37% 63% 58% 42% / 42% 38% 62% 58%; }
.page-bg-shape.shape-wave { border-radius: 48% 52% 38% 62% / 63% 40% 60% 37%; clip-path: polygon(0 28%, 15% 18%, 31% 31%, 48% 12%, 67% 30%, 82% 17%, 100% 28%, 100% 100%, 0 100%); }
.page-bg-shape.shape-leaf { border-radius: 100% 0 100% 0; clip-path: polygon(50% 0%, 88% 18%, 100% 54%, 79% 88%, 42% 100%, 15% 71%, 0% 34%); }
.page-bg-shape.shape-moon { background: radial-gradient(circle at 64% 35%, transparent 0 42%, var(--shape-color, #0055d4) 44% 100%); border-radius: 50%; }
.page-bg-shape.shape-cross { background: transparent; }
.page-bg-shape.shape-cross::before,
.page-bg-shape.shape-cross::after { content: ""; position: absolute; inset: 35% 0; background: var(--shape-color, #0055d4); border-radius: 999px; }
.page-bg-shape.shape-cross::after { inset: 0 35%; }
.page-bg-shape.shape-spark { clip-path: polygon(50% 0%, 60% 36%, 100% 50%, 60% 64%, 50% 100%, 40% 64%, 0% 50%, 40% 36%); }
.page-bg-shape.shape-heart { clip-path: polygon(50% 96%, 7% 49%, 7% 25%, 22% 8%, 39% 8%, 50% 22%, 61% 8%, 78% 8%, 93% 25%, 93% 49%); }
.page-bg-shape.shape-drop { clip-path: polygon(50% 0%, 82% 38%, 85% 62%, 70% 86%, 50% 100%, 30% 86%, 15% 62%, 18% 38%); border-radius: 50%; }
.page-bg-shape.shape-arc { background: transparent; border: max(5px, calc(var(--shape-size, 160px) * 0.08)) solid var(--shape-color, #0055d4); border-bottom-color: transparent; border-left-color: transparent; border-radius: 50%; box-sizing: border-box; }
.page-bg-shape.shape-irregular { clip-path: polygon(8% 24%, 27% 3%, 48% 16%, 72% 0%, 96% 27%, 82% 49%, 100% 73%, 65% 94%, 42% 80%, 14% 100%, 0% 62%); }

.page-bg-shape.shape-bubble-group,
.page-bg-shape.shape-bubble-cluster,
.page-bg-shape.shape-dots,
.page-bg-shape.shape-confetti { background: transparent; }

.page-bg-bubble,
.page-bg-dot,
.page-bg-confetti-piece {
    position: absolute;
    display: block;
    background: var(--shape-color, #0055d4);
}

.page-bg-bubble { width: 32%; height: 32%; border-radius: 50%; }
.page-bg-bubble.bubble-1 { left: 8%; top: 38%; }
.page-bg-bubble.bubble-2 { left: 43%; top: 8%; width: 42%; height: 42%; }
.page-bg-bubble.bubble-3 { left: 57%; top: 56%; width: 27%; height: 27%; }
.page-bg-bubble.bubble-4 { left: 0; top: 9%; width: 24%; height: 24%; }
.page-bg-bubble.bubble-5 { left: 27%; top: 62%; width: 25%; height: 25%; }
.page-bg-bubble.bubble-6 { left: 75%; top: 35%; width: 20%; height: 20%; }
.page-bg-bubble { animation: page-bg-bubble-pulse 5s ease-in-out infinite; }
@keyframes page-bg-bubble-pulse { 0%, 100% { transform: scale(0.88); } 50% { transform: scale(1.12); } }

.page-bg-dot { width: 18%; height: 18%; border-radius: 50%; }
.page-bg-dot.dot-1 { left: 12%; top: 22%; }
.page-bg-dot.dot-2 { left: 58%; top: 18%; width: 25%; height: 25%; }
.page-bg-dot.dot-3 { left: 38%; top: 62%; width: 13%; height: 13%; }

.page-bg-confetti-piece { width: 12%; height: 38%; border-radius: 999px; }
.page-bg-confetti-piece.piece-1 { left: 15%; top: 36%; transform: rotate(25deg); }
.page-bg-confetti-piece.piece-2 { left: 45%; top: 14%; transform: rotate(-42deg); }
.page-bg-confetti-piece.piece-3 { left: 73%; top: 48%; transform: rotate(68deg); }
.page-bg-confetti-piece.piece-4 { left: 37%; top: 67%; transform: rotate(115deg); }

.main-container {
    width: 100%;
    max-width: 1120px; 
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 50px;
    /* Top padding: evita que la primera sección quede pegada al borde superior.
       Con la top bar visible, su propio margin-bottom (40px) ya aporta ese aire.
       Cuando la top bar está oculta, --page-first-gap sube a 44px para dejar
       cabida al navpill de la primera sección (absolute, top: -18px / -22px). */
    padding: var(--page-first-gap, 0) 20px 0;
    margin-bottom: 40px; /* Reducido de 80px para evitar espacios muertos */
    position: relative;
    margin-top: 0;
    z-index: 2; /* Ensure sections sit above the page hero background */
}

/* Per-page hero background behind sections */
.page-hero {
    position: absolute; /* default: static in page flow so it scrolls away when not sticky */
    top: 0;
    left: 0;
    width: 100vw;
    height: 380px; /* increased hero height */
    border-radius: 0;
    z-index: 1; /* stays behind the top bar (z-index 2500) */
    overflow: hidden;
    --page-hero-overlay: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.15));
}

.hero-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.hero-layer.active {
    opacity: 1;
    z-index: 1;
}

/* Elegant rotation animations for hero background layers */
.hero-anim-fade { animation: hero-fade 1.5s ease-out forwards; }
.hero-anim-zoom-in { animation: hero-zoom-in 2s ease-out forwards; }
.hero-anim-zoom-out { animation: hero-zoom-out 2s ease-out forwards; }
.hero-anim-slide-up { animation: hero-slide-up 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.hero-anim-slide-down { animation: hero-slide-down 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@keyframes hero-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hero-zoom-in { from { transform: scale(1.05); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes hero-zoom-out { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes hero-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes hero-slide-down { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Hero animation variants */
.page-hero.hero-anim-kenburns {
    animation: kenburns 40s ease-in-out infinite alternate;
    transform-origin: center center;
}

.page-hero.hero-anim-soft-zoom {
    animation: zoomin-slow 30s ease-in-out infinite alternate;
    transform-origin: center center;
}

.page-hero.hero-anim-soft-float {
    animation: subtle-breathe 14s ease-in-out infinite;
    transform-origin: center center;
}

/* Additional hero animation variants */
.page-hero.hero-anim-soft-pan {
    animation: hero-soft-pan 40s linear infinite alternate;
    transform-origin: center center;
}

.page-hero.hero-anim-parallax {
    animation: hero-parallax 50s ease-in-out infinite alternate;
    transform-origin: center center;
}

@keyframes hero-soft-pan {
    0%   { transform: translateX(0%); }
    50%  { transform: translateX(-4%); }
    100% { transform: translateX(4%); }
}

@keyframes hero-parallax {
    0%   { transform: scale(1.02) translateY(0); }
    50%  { transform: scale(1.06) translateY(-12px); }
    100% { transform: scale(1.02) translateY(6px); }
}

/* Sticky variant: hero scrolls with content but remains pinned at top of viewport */
.page-hero.hero-sticky {
    position: sticky;
    top: 0;
}

/* Explicit fixed class for clarity when toggling (not used by default, but available) */
.page-hero.hero-fixed {
    position: fixed;
    top: 0;
}

/* Soft overlay to keep text readable over busy hero images */
.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--page-hero-overlay);
    pointer-events: none;
    z-index: 2; /* Ensure overlay always sits above hero layers */
}

/* When hero is active, let sections overlap it instead of starting underneath */
body.has-page-hero .main-container {
    margin-top: 0;
    padding-top: 0;
}

/* Mobile: reduce hero height for smaller screens while keeping full-width at top */
@media (max-width: 768px) {
    .page-hero {
        height: 240px;
        border-radius: 0;
    }
    body.has-page-hero .main-container {
        margin-top: 0;
        padding-top: 0;
    }
}

.content-card {
    width: 100%;
    max-width: 765px; /* Base width */
    flex-shrink: 0;
    background-color: transparent; /* Changed to transparent to support row background layer behind */
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 46px; /* 10% increase */
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    text-align: left;
    opacity: 0;
    transform: translateY(50px) scale(0.98);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), max-width 0.4s ease;
    will-change: opacity, transform;
    position: relative;
    isolation: isolate; /* Ensures z-index stacking works correctly for children */
}

/* Dedicated card background layer to stay on top of Row Background */
.content-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--card-bg);
    border-radius: inherit;
    z-index: -1;
    pointer-events: none;
}

.content-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* When a section is set to "Small" width, ensure it keeps balanced inner padding on the right
   to match the left side padding so layout feels symmetrical when two small sections share a row. */
.content-card[data-section-width="small"] {
    /* Match the base .content-card padding (keeps left/right balanced) */
    padding-right: 46px;
    padding-left: 46px;
}

/* On narrow viewports, small sections use full width so reset additional padding to preserve mobile layout */
@media (max-width: 768px) {
    .content-card[data-section-width="small"] {
        padding-left: 30px;
        padding-right: 30px;
    }
}

header {
    margin-bottom: 24px;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

h1, h2 {
    display: block;
    width: 100%;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Three explicit sizes for editable headlines. The default matches the
   existing 2rem headline scale. */
h1.headline-size-default,
h2.headline-size-default { font-size: 2rem; }

h1.headline-size-large,
h2.headline-size-large { font-size: 2.5rem; }

h1.headline-size-xlarge,
h2.headline-size-xlarge { font-size: 3rem; }

/* Global Headline Alignments - Removed !important to allow individual overrides */
body.headline-align-center h1, 
body.headline-align-center h2,
body.headline-align-center .content-card h1, 
body.headline-align-center .content-card h2 { 
    text-align: center; 
}

body.headline-align-right h1, 
body.headline-align-right h2,
body.headline-align-right .content-card h1, 
body.headline-align-right .content-card h2 { 
    text-align: right; 
}

body.headline-align-left h1, 
body.headline-align-left h2,
body.headline-align-left .content-card h1, 
body.headline-align-left .content-card h2 { 
    text-align: left; 
}

/* Individual Headline Controls */
.headline-align-controls {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3px 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

h1:hover > .headline-align-controls,
h2:hover > .headline-align-controls {
    opacity: 1;
    visibility: visible;
}

.align-ctrl-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.align-ctrl-btn:hover {
    background-color: #f0f0f0;
    color: var(--blue-france);
}

.align-ctrl-btn.active {
    background-color: var(--blue-france);
    color: white;
}

/* Navpills are always horizontally centered and 2px larger than the legacy size. */
.badge {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 15px; /* auto side margins center the pill regardless of the card's text-align */
    padding: 6px 16px;
    background-color: rgba(0, 85, 212, 0.1);
    color: var(--blue-france);
    font-size: calc(0.8rem + 2px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
}

.blue-text {
    color: var(--blue-france);
}

/* Headline accent ranges use <font> nodes so no span wrappers are persisted. */
.headline-accent {
    color: var(--blue-france) !important;
}

p {
    font-size: var(--paragraph-font-size, 1.0625rem);
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.content-card > *:last-child,
.standalone-element > *:last-child {
    margin-bottom: 0;
}

/* Feature List with Font Awesome */
.feature-list {
    list-style: none;
    margin-bottom: 30px;
}

.feature-list.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 30px;
}

@media (max-width: 600px) {
    .feature-list.grid-layout {
        grid-template-columns: 1fr;
    }
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.feature-list li i {
    color: var(--blue-france); /* Fallback color */
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Top Bar Styles */
.top-bar {
    position: relative;
    width: 100%;
    height: 80px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    transition: background-color 0.3s ease, position 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.top-bar.is-transparent {
    border-bottom-color: transparent;
}

.top-bar.sticky {
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 0;
}

body.has-sticky-top-bar {
    padding-top: 110px; /* Offset for sticky bar + bottom padding gap */
}

/* Si la top bar está oculta (global o por página) no debe quedar el offset del sticky */
body.has-sticky-top-bar.topbar-hidden {
    padding-top: 0;
}

/* Cuando la top bar está oculta la página NO debe agregar espaciado extra por
   margen: el aire superior lo aporta el padding-top de .main-container
   (mayor en este caso para dar cabida al navpill de la primera sección). */
body.topbar-hidden .main-container {
    --page-first-gap: 44px;
    margin-top: 0;
}

/* En móvil el navpill se oculta (style.css, @media 768px), así que basta menos aire */
@media (max-width: 768px) {
    body.topbar-hidden .main-container {
        --page-first-gap: 24px;
    }
}

.top-bar-content {
    width: 100%;
    max-width: 1200px; /* Wider to allow elements to be closer to screen edges */
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar-pre-text {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end; /* align text/timer to the right */
    gap: 6px; /* small controlled gap between text and timer */
    text-align: right;
    max-height: 80px;
}

/* Fix for top bar timer overflow */
.top-bar-pre-text .countdown-timer-container {
    margin: 0 !important;
}

/* Hide the Top Bar pre-button text on smaller viewports to avoid crowding */
@media (max-width: 960px) {
    .top-bar-pre-text {
        display: none !important;
    }
}

.brand-name {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
    display: inline-block;
}

.logo-container {
    display: flex;
    align-items: center;
    max-height: 70px; /* Fits the recommended 300x70 logo asset without cropping */
    min-width: 0; /* Lets the logo shrink (and stay responsive) on narrow screens */
}

.logo-container img {
    max-height: 70px; /* Recommended logo asset: 300x70 */
    width: auto;
    height: auto;
    max-width: 100%; /* Responsive: the logo never overflows the top bar */
    object-fit: contain;
    display: block;
}

/* Image logo: keep it a touch closer to the left edge of the top bar */
.logo-container .brand-logo {
    margin-left: -14px;
}

/* Narrow viewports: scale the logo down so it never crowds the top bar actions */
@media (max-width: 600px) {
    .logo-container {
        max-height: 54px;
    }

    .logo-container img {
        max-height: 48px;
    }

    .logo-container .brand-logo {
        margin-left: -10px;
    }
}

@media (max-width: 420px) {
    .logo-container img {
        max-height: 40px;
    }

    .logo-container .brand-logo {
        margin-left: -8px;
    }
}

.logo-preview-box {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: #fafafa;
}

.logo-preview-box img {
    max-height: 60px;
    max-width: 100%;
    object-fit: contain;
}

/* Top bar logo preview: shows the recommended 300x70 asset at its real size
   (the generic ".logo-preview-box img" rule below would stretch/crop it). */
#logoPreviewImg {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
}

.remove-logo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    line-height: 1;
}

.nav-button {
    margin: 0 !important;
    padding: 12px 28px !important;
    font-size: 1.1rem !important;
    width: auto !important; /* Exclude nav button from 90% width */
}

/* Button styles - Centered */
.cta-button {
    display: block;
    width: 90%; /* 90% of container width */
    margin: 15px auto; /* Centered with vertical spacing */
    white-space: pre-wrap; /* Allows spaces and line breaks to be rendered correctly */
    background-color: var(--cta-bg-color);
    color: var(--cta-text-color);
    border: none;
    padding: 14px 34px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform var(--transition-speed), background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.cta-button:hover {
    filter: brightness(0.95);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cta-button:active {
    transform: scale(0.98);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Only gallery items should ever occupy grid cells. Legacy projects may
   contain stray <p> elements inside .gallery-grid (from an older text-wrap
   bug). Hiding/normalizing them preserves the 2-column layout so the left
   image is never displaced. */
.gallery-grid > *:not(.gallery-item) {
    display: none !important;
}

/* Centered Feature Image */
.centered-image-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.centered-feature-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.main-footer {
    /* The footer has its own visual contract. Do not inherit project-wide
       typography/theme rules; only the footer settings may change it. */
    width: 100% !important;
    position: relative !important;
    z-index: 2 !important;
    background-color: #fcfcfc !important;
    color: #555555 !important;
    font-family: 'Lexend', 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    --footer-text-size: 0.9375rem !important;
    font-size: var(--footer-text-size) !important;
    line-height: 1.5 !important;
    padding: 16px 20px !important;
    border-top: 1px solid #e0e0e0 !important;
    margin-top: auto !important;
    min-height: auto !important;
    height: auto !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.footer-content {
    width: 90% !important;
    max-width: none !important;
    margin: 0 auto !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
}

#mainFooter #footerContent {
    font: inherit !important;
    color: inherit !important;
}

#mainFooter #footerContent p,
#mainFooter #footerContent a {
    font-family: inherit !important;
    font-size: var(--footer-text-size) !important;
    line-height: inherit !important;
    text-align: inherit !important;
}

/* Global/theme selectors such as body.theme-basic p/li must not leak into the
   shared footer. Keep the common semantic elements on the footer's own scale. */
#mainFooter #footerContent h1,
#mainFooter #footerContent h2,
#mainFooter #footerContent h3,
#mainFooter #footerContent h4,
#mainFooter #footerContent h5,
#mainFooter #footerContent h6,
#mainFooter #footerContent li,
#mainFooter #footerContent span,
#mainFooter #footerContent strong,
#mainFooter #footerContent em {
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    text-align: inherit !important;
}

#mainFooter #footerContent p {
    margin: 0 !important;
}

#mainFooter #footerContent li {
    font-size: inherit !important;
    line-height: inherit !important;
    margin-bottom: 0 !important;
}

#mainFooter #footerContent .html-rendered-wrapper {
    width: 100% !important;
    max-width: 600px !important;
    margin: 8px auto !important;
}

.main-footer.drag-over {
    box-shadow: inset 0 0 0 2px var(--blue-france);
    background-color: rgba(0, 85, 212, 0.05) !important;
}

#mainFooter #footerContent a {
    user-select: text !important;
}

/* Optional per-page content rendered immediately before the footer */
.pre-footer-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 20px 22px;
    text-align: center;
    font-family: inherit;
    --pre-footer-text-size: calc(var(--paragraph-font-size, 1.0625rem) - 2px);
    font-size: var(--pre-footer-text-size);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Keep existing pre-footer HTML from restoring its previous paragraph size. */
.pre-footer-container p {
    font-size: var(--pre-footer-text-size) !important;
}

.pre-footer-container a {
    font-size: var(--pre-footer-text-size) !important;
}

.pre-footer-container.hidden {
    display: none;
}

.pre-footer-container > :first-child {
    margin-top: 0;
}

.pre-footer-container > :last-child {
    margin-bottom: 0;
}

/* Floating Action Button */
.fab-button {
    position: fixed;
    bottom: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--blue-france);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 85, 212, 0.4);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-button:hover {
    transform: scale(1.1) rotate(5deg);
}

.fab-button:active {
    transform: scale(0.9);
}

/* Project FAB & Menu */
.project-fab-container {
    position: fixed;
    bottom: 30px;
    right: 80px; /* Increased to move further left from the edge */
    width: 60px;
    height: 60px;
    z-index: 2001;
}

.project-menu {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 200px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: none; /* Disabled slide effect */
    transition: none; /* Disabled transitions */
}

.project-menu.active {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.project-menu-item {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.project-menu-item i {
    color: var(--blue-france);
    width: 18px;
    text-align: center;
}

.project-menu-item:hover {
    background-color: #f5f5f5;
    color: var(--blue-france);
}

/* Section Controls & Editability */
.content-card {
    position: relative;
}

.section-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%; /* Move relative to the card's right edge */
    margin-left: 20px; /* Consistent gap outside the content area */
    width: 112px; /* Reduced to match smaller buttons */
    z-index: 2500; /* Higher priority to stay above all section content */
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Move controls to top and center when sharing rows or in full-width mode to prevent going off-screen */
.sharing-row-left .section-sidebar,
.sharing-row-right .section-sidebar,
.full-width-section .section-sidebar {
    left: 0;
    right: 0;
    top: -45px; /* Lowered to overlap slightly with the section content */
    bottom: auto;
    width: 100%;
    margin-left: 0;
}

/* When sections are cramped or special-width, keep sidebar controls visually hidden by default;
   they will appear on hover and auto-hide after a delay for a cleaner interface */
.sharing-row-left .section-sidebar .section-sidebar-sticky,
.sharing-row-right .section-sidebar .section-sidebar-sticky,
.full-width-section .section-sidebar .section-sidebar-sticky {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Visible state applied by JS on hover; keeps layout stable while showing controls */
.section-sidebar.visible-hover .section-sidebar-sticky {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.section-sidebar-sticky {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Reduced gap to prevent overlap */
    pointer-events: auto;
    width: 100%;
}

.section-actions-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

/* Horizontal top-aligned layout for shared or full-width rows */
.sharing-row-left .section-sidebar-sticky,
.sharing-row-right .section-sidebar-sticky,
.full-width-section .section-sidebar-sticky {
    top: 0;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.sharing-row-left .section-actions-group,
.sharing-row-right .section-actions-group,
.full-width-section .section-actions-group,
.sharing-row-left .section-tools-group,
.sharing-row-right .section-tools-group,
.full-width-section .section-tools-group {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 6px;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

/* Ensure all buttons visible in shared or full-width rows */
.sharing-row-left .section-clone-btn,
.sharing-row-left .section-tools-group,
.sharing-row-left .section-delete-btn,
.sharing-row-left .section-settings-btn,
.sharing-row-right .section-clone-btn,
.sharing-row-right .section-tools-group,
.full-width-section .section-clone-btn,
.full-width-section .section-tools-group,
.full-width-section .section-delete-btn,
.full-width-section .section-settings-btn {
    display: flex !important;
}

/* Smaller icons for compact shared or full-width mode */
.sharing-row-left .section-action-btn,
.sharing-row-right .section-action-btn,
.full-width-section .section-action-btn,
.sharing-row-left .tool-btn,
.sharing-row-right .tool-btn,
.full-width-section .tool-btn {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}

.section-tools-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.section-action-btn {
    width: 32px; /* Reduced from 40px */
    height: 32px; /* Reduced from 40px */
    border-radius: 50%;
    background-color: white;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.85rem; /* Slightly smaller icons */
}

.section-settings-btn, .section-nav-toggle-btn {
    color: var(--blue-france);
}

.section-nav-toggle-btn.active {
    background-color: var(--blue-france);
    color: white;
    border-color: var(--blue-france);
}

.section-settings-btn:hover, .section-nav-toggle-btn:hover {
    background-color: var(--blue-france);
    color: white;
    border-color: var(--blue-france);
    transform: scale(1.1);
}

.section-delete-btn {
    color: #ff4d4d;
}

.section-delete-btn:hover {
    background-color: #ff4d4d;
    color: white;
    border-color: #ff4d4d;
    transform: scale(1.1);
}

.section-reseller-btn {
    color: var(--blue-france);
}

.section-reseller-btn.inactive {
    color: #999;
}

.section-reseller-btn:hover {
    transform: scale(1.1);
    background-color: #f0f0f0;
}

.tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--blue-france);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.tool-btn:hover {
    transform: scale(1.1);
    background-color: var(--blue-france);
    color: white;
    border-color: var(--blue-france);
}

/* Navpill Styles */
.section-lock-icon {
    position: absolute;
    left: -24px;
    top: 12px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.77rem;
    z-index: 12;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* keep lock smaller on mobile to avoid overlap */
@media (max-width: 768px) {
    .section-lock-icon { left: -18px; top: 10px; width: 16px; height: 16px; font-size: 0.7rem; }
}

.section-left-stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
    z-index: 5;
    pointer-events: none;
}

/* Side floating icons */
.section-side-icons {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    z-index: 4;
}

.section-side-icons-left {
    left: -108px; /* moved 20% further left from the content */
}

.section-side-icons-right {
    right: -108px; /* moved 20% further right from the content */
}

.content-card.visible .section-side-icons {
    opacity: 1;
}

.content-card.visible .section-side-icons-left {
    transform: translateY(-50%) translateX(14px); /* increased horizontal separation (~+20%) when visible */
}

.content-card.visible .section-side-icons-right {
    transform: translateY(-50%) translateX(-14px); /* increased horizontal separation (~+20%) when visible */
}

.side-icon-circle {
    width: 57.6px;
    height: 57.6px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transform: translateY(0);
    animation: side-icon-float 5s ease-in-out infinite;
    animation-delay: calc(var(--side-icon-index, 0) * 0.4s);
    transition: width 0.25s ease, height 0.25s ease, transform 0.25s ease;
}

/* Slightly larger icon glyphs for improved legibility */
.side-icon-circle i {
    font-size: 1.38rem;
}

.side-icon-circle i {
    font-size: 1.20rem;
}

.side-icon-number {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Disable side icons on shared rows */
.sharing-row-left .section-side-icons,
.sharing-row-right .section-side-icons {
    display: none !important;
}

/* Side icons configuration UI */
.side-icons-config {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.side-icons-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.side-icons-column-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.side-icon-row {
    display: flex;
    gap: 6px;
}

.side-icon-row .stock-source-select {
    font-size: 0.8rem;
    padding: 6px 8px;
}

@keyframes side-icon-float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

.section-row-background {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    z-index: -3;
    pointer-events: none;
    transition: opacity 0.8s ease, background-color 0.4s ease, top 0.3s ease, height 0.3s ease, background-position 1.5s ease;
    opacity: 0;
}

.section-row-background.active {
    opacity: 1;
    /* When active, we add "padding" look by making the background strip taller than the card */
    top: -40px;
    height: calc(100% + 80px);
}



.section-navpill {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--blue-france);
    color: white;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: calc(0.85rem + 2px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    pointer-events: auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center; /* keep the pill content centered inside the pill */
    white-space: nowrap;
    transition: all 0.2s ease;
}

.section-navpill.size-large {
    padding: 8px 24px;
    font-size: calc(1rem + 2px);
    top: -22px;
}

.navpill-editable-text {
    outline: none;
    cursor: text;
}

.navpill-delete {
    margin-left: 10px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    color: white;
}

.navpill-delete:hover {
    opacity: 1;
    background: rgba(255, 0, 0, 0.6);
    transform: scale(1.1);
}

.navpill-delete:hover {
    opacity: 1;
    color: #ff4d4d;
}



.section-navpill.inline-navpill {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    display: flex !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin: 10px auto !important; /* auto side margins keep the inline pill centered */
}

/* Color Presets Grid */
.presets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.preset-item {
    height: 40px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.preset-item:hover {
    transform: scale(1.02);
}

.preset-item.active {
    border-color: #333;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #0055d4;
}

.drop-indicator {
    height: 4px;
    background-color: var(--blue-france);
    border-radius: 2px;
    margin: 10px 0;
    pointer-events: none;
    /* Removed transition to prevent layout shift oscillations during drag and drop */
}

.tool-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--blue-france);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.tool-btn:hover {
    transform: scale(1.1);
    background-color: var(--blue-france);
    color: white;
    border-color: var(--blue-france);
}

.tool-btn:active {
    cursor: grabbing;
}

[contenteditable="true"]:hover {
    outline: 1px dashed var(--blue-france);
    outline-offset: 4px;
    border-radius: 4px;
    cursor: text;
}

[contenteditable="true"]:focus {
    outline: 2px solid var(--blue-france);
    outline-offset: 4px;
    background-color: rgba(0, 85, 212, 0.03);
}

/* AI Panel */
.ai-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    background: white;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transform: none; /* Disabled slide effect */
    transition: none; /* Disabled transitions */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.ai-panel::-webkit-scrollbar {
    width: 6px;
}

.ai-panel::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

.ai-panel.active {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.ai-panel-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-align: center;
    color: var(--text-primary);
}

.ai-action-button {
    width: 100%;
    font-size: 0.95rem !important;
    padding: 10px !important;
}

.hidden {
    display: none !important;
}

.json-textarea {
    width: 100%;
    height: 150px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    font-family: inherit;
    font-size: 12px;
    margin-bottom: 10px;
    resize: none;
}

.small-textarea {
    height: 80px;
    font-family: inherit;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 8px;
}

.hidden-options {
    padding-left: 20px;
    border-left: 2px solid var(--blue-france);
    margin-bottom: 15px;
}

.tip-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-bottom: 8px;
}

.panel-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.secondary-btn {
    background-color: #eee !important;
    color: #333 !important;
}

/* Toaster */
.toaster {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    z-index: 5000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.toaster.show {
    transform: translateX(-50%) translateY(0);
}

/* Modal and Image Editing Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: none; /* Disabled fade-in */
}

/* Make Manage Sections overlay transparent so you can see the page behind it clearly */
#reorderModal {
    background: transparent;
    backdrop-filter: none;
}

/* Ensure delete confirmation always appears above other modals (like Reorder) */
.modal-overlay.delete-modal {
    z-index: 4000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.delete-confirm-content {
    max-width: 350px;
    padding: 30px;
    text-align: center;
}

.delete-confirm-content h3 {
    margin-bottom: 15px;
}

.delete-confirm-content p {
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.delete-confirm-content .modal-footer {
    display: flex;
    gap: 10px;
}

.delete-btn {
    background-color: #ff4d4d !important;
    color: white !important;
}

.delete-btn:hover {
    background-color: #e60000 !important;
    box-shadow: 0 5px 15px rgba(255, 77, 77, 0.3) !important;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: none; /* Disabled scale effect */
    transition: none; /* Disabled transitions */
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: none;
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-tabs {
    display: flex;
    background: #f8f8f8;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--blue-france);
    background: white;
    border-bottom: 2px solid var(--blue-france);
}

.tab-content {
    padding: 20px;
    display: none;
    min-height: 150px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.tab-content::-webkit-scrollbar {
    width: 6px;
}

.tab-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

.tab-content.active {
    display: block;
}

#sectionSettingsModal .modal-content {
    max-height: 90vh;
}

#sectionSettingsModal .tab-content.active {
    overflow-y: auto;
    max-height: 75vh;
}

/* Page Settings modal header actions */
#pageSettingsModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-settings-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-settings-save-btn {
    width: auto !important;
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
    margin: 0 !important;
    background-color: var(--cta-bg-color) !important;
    color: var(--cta-text-color) !important;
    border: none !important;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-area:hover {
    border-color: var(--blue-france);
}

.upload-area i {
    font-size: 3rem;
    color: var(--blue-france);
    margin-bottom: 15px;
}

/* Stock Search */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.stock-source-select {
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.stock-source-select:focus {
    border-color: var(--blue-france);
}

.search-bar input {
    /* Limit width so the right-side search button remains visible */
    flex: 0 1 64%;
    min-width: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
}

.search-bar button {
    background: var(--blue-france);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

#projectImagesGrid {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

@media (max-width: 600px) {
    #projectImagesGrid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stock-item {
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
    background-color: #eee;
}

/* Small warning pill for AI-generated images shown in Add From Project tab */
.ai-warning-pill {
    background: #fff7ed;
    color: #b45309;
    border: 1px solid rgba(181,83,9,0.12);
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.7rem;
    box-shadow: 0 6px 14px rgba(181,83,9,0.06);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.stock-item:hover {
    transform: scale(1.05);
}

.stock-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-text {
    grid-column: span 3;
    text-align: center;
    color: var(--text-secondary);
    padding-top: 40px;
}

.stock-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #eee;
    border-top-color: var(--blue-france);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* HTML Loading Spinner */
.html-loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.html-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 85, 212, 0.1);
    border-top: 4px solid var(--blue-france);
    border-radius: 50%;
    animation: html-spin 1s linear infinite;
}

@keyframes html-spin {
    to { transform: rotate(360deg); }
}

/* Editable Images */
.editable-img {
    cursor: pointer;
    position: relative;
    overflow: hidden; /* ensure any transform/scale stays inside the box */
}

/* Ensure centered image containers also clip animated transforms */
.centered-image-container,
.gallery-item,
.logo-preview-box,
.thumb-preview-wrapper,
.external-section-image,
.group-side-image {
    overflow: hidden;
    position: relative;
}

/* Make images inside these containers preserve their presentation box while allowing internal animation */
.centered-image-container img,
.gallery-item img,
.logo-preview-box img,
.thumb-preview-wrapper img,
.external-section-image img,
.group-side-image img,
.centered-feature-img,
.editable-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center; /* animate from center to keep image visually contained */
    will-change: transform, opacity; /* optimize animation */
}

.editable-img:after {
    content: 'Click to edit';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 10;
}

/* Ensure delete buttons on images are visible and not clipped by overflow:hidden containers */
.editable-img > .element-delete-btn {
    left: 10px !important;
    top: 10px !important;
    z-index: 151; /* On top of edit overlay */
}

.editable-img:hover:after {
    opacity: 1;
}

/* Individual Image Animations */
img[data-animation="ken-burns"] { 
    animation: kenburns 20s ease-in-out infinite alternate; 
    transform-origin: center center;
    will-change: transform, opacity;
}
img[data-animation="zoom-in"] { 
    animation: zoomin-slow 15s ease-out infinite alternate; 
    transform-origin: center center;
    will-change: transform, opacity;
}
img[data-animation="float"] { 
    animation: subtle-breathe 6s ease-in-out infinite; 
    transform-origin: center center;
    will-change: transform, opacity;
}

@keyframes zoomin-slow {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* HTML Component Styles */
.html-rendered-wrapper {
    position: relative;
    margin-bottom: 30px;
    width: 100%;
    min-height: 40px;
}

/* Visual guide for HTML blocks in the editor, only visible when builder class is present on body */
body.is-builder .html-rendered-wrapper::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1px dashed rgba(0, 85, 212, 0.15);
    border-radius: 8px;
    pointer-events: none;
    z-index: -1;
    transition: border-color 0.2s;
}

body.is-builder .html-rendered-wrapper:hover::after {
    border-color: var(--blue-france);
    border-width: 1.5px;
}

body.is-builder .html-content-placeholder {
    padding: 20px;
    background: rgba(0, 85, 212, 0.03);
    border: 1px dashed var(--blue-france);
    border-radius: 8px;
    text-align: center;
    color: var(--blue-france);
    font-size: 0.9rem;
}

.html-content {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

/* Force responsiveness on injected user HTML */
.html-content > * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.html-content img,
.html-content video,
.html-content iframe,
.html-content table,
.html-content div,
.html-content section {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.html-content img,
.html-content video {
    height: auto !important;
}

/* Specific iframe responsive handling to prevent horizontal bleed */
.html-content iframe {
    border: none;
}

.html-controls {
    position: absolute;
    top: -12px;
    right: 0;
    display: flex;
    gap: 5px;
    z-index: 210;
    opacity: 0;
    transition: opacity 0.2s;
}

.html-rendered-wrapper:hover .html-controls {
    opacity: 1;
}

.edit-html-link, .replay-html-link {
    font-size: 11px;
    font-weight: 700;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: white;
}

.edit-html-link {
    background: var(--blue-france);
}

.replay-html-link {
    background: #10b981; /* Emerald green */
}

.replay-html-link:hover {
    background: #059669;
}

/* Video Mockup Styles */
.video-mockup {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.mockup-transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    pointer-events: none;
    z-index: 12;
    transition: background-color 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.mockup-transition-overlay.fade-white {
    background-color: white;
}

.mockup-transition-overlay.fade-black {
    background-color: black;
}

/* Emphasized border when using the video placeholder emulation */
.video-mockup.placeholder-active {
    border: 3px solid rgba(0,85,212,0.14);
    box-shadow: 0 12px 40px rgba(0,85,212,0.12), 0 6px 18px rgba(0,0,0,0.08);
    outline: 2px solid rgba(255,255,255,0.03);
    transition: box-shadow 0.25s ease, border 0.25s ease;
}

.video-mockup-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    /* transition: transform removed to prevent conflicts with JS animations (zoomin/kenburns) */
    transition: opacity 0.3s;
}

.video-mockup:hover .video-mockup-thumb {
    opacity: 1;
    transform: scale(1.02);
}

.play-button-mockup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-button-mockup i {
    color: var(--blue-france);
    font-size: 1.8rem;
    margin-left: 5px; /* Visual centering */
}

.play-pause-mockup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: none; /* Shown by JS when playback starts */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 30;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.video-mockup:hover .play-pause-mockup {
    opacity: 1;
    pointer-events: auto;
}

.play-pause-mockup:hover {
    background-color: #ffffff;
    transform: translate(-50%, -50%) scale(1.1);
}

.play-pause-mockup i {
    color: var(--blue-france);
    font-size: 1.8rem;
}

.replay-button-mockup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s ease;
}

.replay-button-mockup:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: white;
}

.replay-button-mockup i {
    color: var(--blue-france);
    font-size: 1.4rem;
}

/* Audio Bars Animation */
.audio-bars {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
    z-index: 5;
}

.bar {
    width: 4px;
    background: white;
    border-radius: 2px;
    min-height: 4px;
}

.bar-1 { animation: bar-low 0.4s ease-in-out infinite alternate; }
.bar-2 { animation: bar-high 0.6s ease-in-out infinite alternate-reverse; }
.bar-3 { animation: bar-mid 0.35s ease-in-out infinite alternate; }
.bar-4 { animation: bar-vhigh 0.7s ease-in-out infinite alternate-reverse; }
.bar-5 { animation: bar-low 0.5s ease-in-out infinite alternate; }

@keyframes bar-low { 0% { height: 10%; } 100% { height: 35%; } }
@keyframes bar-mid { 0% { height: 15%; } 100% { height: 50%; } }
@keyframes bar-high { 0% { height: 10%; } 100% { height: 65%; } }
@keyframes bar-vhigh { 0% { height: 20%; } 100% { height: 80%; } }

/* Placeholder Animations */
.anim-ken-burns { animation: kenburns 6s ease-in-out infinite alternate; }
.anim-zoom-in { animation: zoomin 0.8s ease-out forwards; }
.anim-zoom-out { animation: zoomout 0.8s ease-out forwards; }
.anim-fade-in { animation: fadein 0.8s ease-out forwards; }
.anim-slide-up { animation: slideup 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.anim-slide-down { animation: slidedown 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.anim-slide-left { animation: slideleft 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.anim-slide-right { animation: slideright 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.anim-blur-in { animation: blurin 1s ease-out forwards; }
.anim-rotate-in { animation: rotatein 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes kenburns { 0% { transform: scale(1) translate(0, 0); } 100% { transform: scale(1.2) translate(-5%, -5%); } }
@keyframes zoomin { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes zoomout { 0% { transform: scale(1.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fadein { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes slideup { 0% { transform: translateY(20px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes slidedown { 0% { transform: translateY(-20px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes slideleft { 0% { transform: translateX(20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes slideright { 0% { transform: translateX(-20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes blurin { 0% { filter: blur(10px); opacity: 0; } 100% { filter: blur(0); opacity: 1; } }
@keyframes rotatein { 0% { transform: rotate(-15deg) scale(0.8); opacity: 0; } 100% { transform: rotate(0) scale(1); opacity: 1; } }

/* Continuous subtle breathing/float used after a one-shot placeholder animation finishes */
.placeholder-continuous {
    animation: subtle-breathe 6s ease-in-out infinite;
    transform-origin: center center;
    will-change: transform;
}

/* Slight variation for very slow float when needed */
.placeholder-continuous-slow {
    animation: subtle-breathe 10s ease-in-out infinite;
}

/* Keyframes for continuous subtle motion */
@keyframes subtle-breathe {
    0%   { transform: scale(1) translateY(0); }
    50%  { transform: scale(1.01) translateY(-4px); }
    100% { transform: scale(1) translateY(0); }
}

@keyframes fade-in-delayed {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.thumbnail-editor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.thumb-item {
    width: 100%;
    background: #fcfcfc;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
    padding: 10px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.thumb-preview-wrapper {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.thumb-inputs input {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.thumb-item .remove-thumb {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255,0,0,0.8);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.video-mockup:hover .play-button-mockup {
    transform: translate(-50%, -50%) scale(1.15);
    background-color: #ffffff;
    box-shadow: 0 0 30px rgba(0, 85, 212, 0.3);
}

/* Iframe Management Controls */
.iframe-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.video-container:hover .iframe-controls,
.html-rendered-wrapper:hover .iframe-controls {
    opacity: 1;
}

.iframe-mgmt-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s, filter 0.2s;
}

.iframe-mgmt-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.iframe-mgmt-btn.edit { background: var(--blue-france); }
.iframe-mgmt-btn.delete { background: #ff4d4d; }

/* Inline Code Editor Div */
.inline-code-editor {
    position: absolute;
    inset: 0;
    background: #1a1a1a;
    z-index: 210;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: inherit;
    animation: fadein 0.3s ease;
}

.inline-code-editor label {
    color: #aaa;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.inline-code-editor textarea {
    flex: 1;
    background: #000;
    color: #5cd65c; /* Terminal green */
    border: 1px solid #333;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    padding: 12px;
    resize: none;
    margin-bottom: 12px;
    outline: none;
}

.inline-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.video-mockup.mockup-locked {
    cursor: default;
}

/* Element Level Deletion */
.deleteable-element {
    position: relative;
}

.element-delete-btn {
    position: absolute;
    top: -8px;
    left: -18px;
    width: 20px;
    height: 20px;
    background-color: #ff4d4d;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 150;
    border: 1px solid white;
}

.deleteable-element:hover > .element-delete-btn {
    opacity: 1;
}

.element-delete-btn:hover {
    transform: scale(1.2);
    background-color: #e60000;
}

/* Bottom Image Styles */
.bottom-image-container {
    width: 100%;
    max-width: 1120px;
    display: flex;
    margin: 0 auto 20px auto;
    padding: 0 20px;
}

.bottom-image-container.hidden {
    display: none;
}

.bottom-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.bottom-image-container.align-left { justify-content: flex-start; }
.bottom-image-container.align-center { justify-content: center; }
.bottom-image-container.align-right { justify-content: flex-end; }

/* Video Mockup Subtitles */
.subtitle-box {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: 4px;
    max-width: 85%;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.subtitle-box.active {
    opacity: 1;
}

.subtitle-word {
    display: inline-block;
    animation: subtitle-zoom 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    white-space: nowrap;
    /* Fix for character clipping (e.g., 's') during transform scaling animations */
    padding: 0 0.15em;
    margin-right: 0.15em; 
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.subtitle-block {
    display: inline-block;
    animation: block-fade-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    white-space: normal;
    text-align: center;
    padding: 0 0.15em;
    will-change: transform, opacity;
}

@keyframes subtitle-zoom {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes block-fade-in {
    0% { opacity: 0; transform: translateY(6px); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* FAQ Section Styles */
.faq-section {
    text-align: center;
    transition: margin 0.4s ease, padding 0.4s ease;
}

.faq-footer-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.faq-headline {
    margin-bottom: 40px;
    font-weight: 700;
    color: var(--blue-france);
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    text-align: left;
}

.faq-item-display h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--blue-france);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.faq-item-display h4 i {
    margin-top: 3px;
    font-size: 0.95em;
}

.faq-item-display p {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: #777777; /* Default slightly lighter color for answers */
}

/* Swipes Container Styles */
.swipes-container {
    width: 100%;
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.swipes-container.layout-1 {
    grid-template-columns: 1fr;
}

.swipes-container.layout-2 {
    grid-template-columns: 1fr 1fr;
}

.swipe-item {
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.swipe-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.swipe-item-headline {
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-france);
    margin: 0;
}

.swipe-item-textarea {
    width: 100%;
    height: 240px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #f9f9f9;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    resize: vertical;
    color: var(--text-primary);
}

.swipe-copy-btn {
    align-self: center;
    background: var(--blue-france);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.swipe-copy-btn:hover {
    background: #0044aa;
    transform: translateY(-1px);
}

.swipe-copy-btn:active {
    transform: scale(0.95);
}

/* Swipes Editor Modal Styles */
.swipes-editor-list {
    margin-top: 20px;
}

.swipe-editor-item {
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    position: relative;
    cursor: grab;
}

.swipe-editor-item:active {
    cursor: grabbing;
}

.remove-swipe-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ff4d4d;
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
    transition: transform 0.2s;
}

.remove-swipe-btn:hover {
    transform: scale(1.2);
}

.swipe-editor-item input, .swipe-editor-item textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 6px;
    font-family: inherit;
}

.swipe-editor-item textarea {
    height: 160px;
    font-family: monospace;
    font-size: 13px;
}

.swipes-edit-trigger {
    background: none;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.swipes-edit-trigger:hover {
    border-color: var(--blue-france);
    color: var(--blue-france);
    background: rgba(0, 85, 212, 0.02);
}

/* Countdown Timer Styles */
.countdown-timer-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    pointer-events: auto;
    position: relative;
}

/* Start date live countdown under the picker */
.start-countdown {
    color: #7f1d1d; /* dark red */
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 6px;
    text-align: left;
    width: 100%;
}

.timer-pre-text {
    font-size: 1.1rem; /* Increased 4px (from 0.85rem/13.6px to 1.1rem/17.6px) */
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
    color: inherit;
    width: 100%;
}

.countdown-timer-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: 'Lexend', sans-serif;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 65px;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.timer-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.timer-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
    opacity: 0.8;
}

.timer-separator {
    font-size: 1.5rem;
    font-weight: 700;
    padding-bottom: 15px;
}

/* Style Variants */
.timer-style-pill-blue .timer-unit {
    background-color: var(--blue-france);
    color: white;
}
.timer-style-pill-blue .timer-separator { color: var(--blue-france); }

.timer-style-pill-outline .timer-unit {
    background-color: white;
    color: var(--text-primary);
    border: 2px solid var(--blue-france);
}
.timer-style-pill-outline .timer-separator { color: var(--blue-france); }

.timer-style-pill-dark .timer-unit {
    background-color: #1a1a1a;
    color: white;
}
.timer-style-pill-dark .timer-separator { color: #1a1a1a; }

.timer-style-pill-red .timer-unit {
    background-color: #ef4444;
    color: white;
}
.timer-style-pill-red .timer-separator { color: #ef4444; }

.timer-style-pill-emerald .timer-unit {
    background-color: #10b981;
    color: white;
}
.timer-style-pill-emerald .timer-separator { color: #10b981; }

.timer-style-pill-soft .timer-unit {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}
.timer-style-pill-soft .timer-separator { color: #9ca3af; }

.timer-style-pill-coral .timer-unit {
    background-color: #ff7f50;
    color: white;
}
.timer-style-pill-coral .timer-separator { color: #ff7f50; }

.timer-style-pill-accent .timer-unit {
    background-color: var(--accent-orange);
    color: #000000;
}
.timer-style-pill-accent .timer-separator { color: var(--accent-orange); }

/* Settings Modal Specifics */
.timer-style-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.timer-style-picker .radio-label {
    display: block;
    margin-bottom: 0;
}

.timer-style-picker input[type="radio"] {
    display: none;
}

.style-preview {
    display: flex;
    gap: 5px;
    padding: 12px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.timer-style-picker input[type="radio"]:checked + .style-preview {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--blue-france);
    transform: scale(1.03);
}

.timer-style-pill-blue.style-preview { background: var(--blue-france); color: white; }
.timer-style-pill-outline.style-preview { background: white; color: var(--blue-france); border: 2px solid var(--blue-france); }
.timer-style-pill-dark.style-preview { background: #1a1a1a; color: white; }
.timer-style-pill-red.style-preview { background: #ef4444; color: white; }
.timer-style-pill-emerald.style-preview { background: #10b981; color: white; }
.timer-style-pill-soft.style-preview { background: #f3f4f6; color: #374151; border: 2px solid #d1d5db; }
.timer-style-pill-coral.style-preview { background: #ff7f50; color: white; }
.timer-style-pill-accent.style-preview { background: var(--accent-orange); color: #000000; }



.edit-faqs-btn {
    background: none;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.edit-faqs-btn:hover {
    background: #fff;
    border-color: var(--blue-france);
    color: var(--blue-france);
}

.faq-edit-row {
    width: 100%;
    max-width: 765px;
    display: flex;
    justify-content: center;
    margin: 20px 0 40px;
    padding-bottom: 20px;
}

.faq-edit-row.hidden {
    display: none !important;
}

/* External Side Image Styles */
.external-section-image {
    width: 220px;
    height: auto;
    max-height: 85%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease, width 0.3s ease, top 0.3s ease, bottom 0.3s ease;
    opacity: 0;
    position: absolute;
    cursor: pointer;
    z-index: -2; /* Behind the white card background (::before at -1) */
}

/* Side images must remain visible when two Small sections share a row.
   They intentionally sit above the card background and extend outward from
   the left/right card instead of being hidden behind its isolated stack. */
.content-card.sharing-row-left .external-section-image,
.content-card.sharing-row-right .external-section-image {
    z-index: 3;
}

/* Sizing Options */
.external-section-image.size-large { width: 320px; }
.external-section-image.size-xlarge { width: 420px; }

/* Vertical Alignment Logic */
.external-section-image.v-align-center { top: 50%; }
.external-section-image.v-align-top { top: 30px; }
.external-section-image.v-align-bottom { top: auto; bottom: 30px; }

/* Slide animation logic based on side + vertical position */
.external-section-image.side-left.v-align-center { left: 0; transform: translateY(-50%) translateX(0); }
.external-section-image.side-left.v-align-top, 
.external-section-image.side-left.v-align-bottom { left: 0; transform: translateX(0); }

.content-card.visible .external-section-image.side-left.v-align-center { opacity: 1; transform: translateY(-50%) translateX(-80%); }
.content-card.visible .external-section-image.side-left.v-align-top,
.content-card.visible .external-section-image.side-left.v-align-bottom { opacity: 1; transform: translateX(-80%); }

.external-section-image.side-right.v-align-center { right: 0; transform: translateY(-50%) translateX(0); }
.external-section-image.side-right.v-align-top,
.external-section-image.side-right.v-align-bottom { right: 0; transform: translateX(0); }

.content-card.visible .external-section-image.side-right.v-align-center { opacity: 1; transform: translateY(-50%) translateX(80%); }
.content-card.visible .external-section-image.side-right.v-align-top,
.content-card.visible .external-section-image.side-right.v-align-bottom { opacity: 1; transform: translateX(80%); }

.external-section-image.floating .carousel-track {
    animation: floating-side-image 4s ease-in-out infinite;
}

@keyframes floating-side-image {
    0% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0); }
}

.external-section-image .carousel-track {
    display: flex;
    flex-direction: column;
    width: 100%;
    transform: translateY(0);
}

.external-section-image .carousel-track > img {
    margin-bottom: 0; /* Removed bottom margin to avoid gap/pause between last and first slide for seamless loop */
    display: block;
}

.external-section-image.carousel-active .carousel-track {
    /* We use a sub-animation if it's not floating to avoid transform conflicts */
    animation: vertical-carousel var(--carousel-speed, 5s) linear infinite;
}

.external-section-image.carousel-active.floating .carousel-track {
    /* If floating and carousel are active, we combine them or prioritize one */
    animation: vertical-carousel var(--carousel-speed, 5s) linear infinite, floating-side-image 4s ease-in-out infinite;
}

.external-section-image:hover .carousel-track {
    animation-play-state: paused;
}

@keyframes vertical-carousel {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

@keyframes horizontal-carousel {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.external-section-image img {
    width: 100%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* External Side Text Styles */
.external-side-text {
    position: absolute;
    width: 190px;
    padding: 20px 16px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: -2;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
    opacity: 0;
    pointer-events: none;
}

.external-side-text.v-align-center { top: 50%; }
.external-side-text.v-align-top { top: 30px; }
.external-side-text.v-align-bottom { top: auto; bottom: 30px; }

.external-side-text.side-left, .external-side-text.side-right {
    align-items: center;
    text-align: center;
}

.external-side-text.side-left.v-align-center { left: 0; transform: translateY(-50%) translateX(0); }
.external-side-text.side-left.v-align-top, 
.external-side-text.side-left.v-align-bottom { left: 0; transform: translateX(0); }

.content-card.visible .external-side-text.side-left.v-align-center { opacity: 1; transform: translateY(-50%) translateX(-80%); }
.content-card.visible .external-side-text.side-left.v-align-top,
.content-card.visible .external-side-text.side-left.v-align-bottom { opacity: 1; transform: translateX(-80%); }

.external-side-text.side-right.v-align-center { right: 0; transform: translateY(-50%) translateX(0); }
.external-side-text.side-right.v-align-top,
.external-side-text.side-right.v-align-bottom { right: 0; transform: translateX(0); }

.content-card.visible .external-side-text.side-right.v-align-center { opacity: 1; transform: translateY(-50%) translateX(80%); }
.content-card.visible .external-side-text.side-right.v-align-top,
.content-card.visible .external-side-text.side-right.v-align-bottom { opacity: 1; transform: translateX(80%); }

.side-text-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

/* Fast 360 spin animation when parent section becomes visible */
.content-card.visible .side-text-icon {
    animation: side-text-spin 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.4s; /* Slight delay to sync with text slide-in */
}

@keyframes side-text-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.side-text-line-1 {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 4px;
}

.side-text-line-2 {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Side Text Presets */
.side-text-p-0 { background: #0055d4; color: #ffffff; }
.side-text-p-1 { background: #1a1a1a; color: #ffffff; }
.side-text-p-2 { background: #ffffff; color: #333333; border: 1px solid #eee; }
.side-text-p-2 .side-text-icon { color: #0055d4; }
.side-text-p-3 { background: #10b981; color: #ffffff; }
.side-text-p-4 { background: #f59e0b; color: #000000; }
.side-text-p-5 { background: #ef4444; color: #ffffff; }
.side-text-p-6 { background: linear-gradient(45deg, #ff512f, #dd2476); color: #ffffff; }
.side-text-p-7 { background: linear-gradient(45deg, #2193b0, #6dd5ed); color: #ffffff; }
.side-text-p-8 { background: linear-gradient(45deg, #11998e, #38ef7d); color: #ffffff; }
.side-text-p-9 { background: linear-gradient(45deg, #141e30, #243b55); color: #ffffff; }
.side-text-p-10 { background: linear-gradient(45deg, #8e2de2, #4a00e0); color: #ffffff; }
.side-text-p-11 { background: linear-gradient(45deg, #f2994a, #f2c94c); color: #000000; }

@media (max-width: 768px) {
    .external-side-text {
        display: none !important;
    }
}

.external-section-image.shape-rounded img {
    border-radius: 16px;
}

.external-section-image.shape-circle img {
    border-radius: 50%;
}

/* Lightbox Styles */
.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: zoomin 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    box-shadow: 0 10px 50px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 5px solid white;
}

/* Full Width Section Support */
.full-width-section {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* --- Basic Theme Styles --- */
body.theme-basic {
    background-color: #f5f5f5;
    font-family: 'Open Sans', sans-serif !important;
}

body.theme-basic[data-custom-bg-enabled="true"] {
    background-color: var(--page-bg-color, #f5f5f5);
}

body.theme-basic .main-container {
    background-color: #ffffff;
    width: 80% !important;
    max-width: 1120px;
    margin: 60px auto 40px auto;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border-radius: 8px;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
}

/* Override sections in Basic theme */
body.theme-basic .content-card,
body.theme-basic .standalone-element,
body.theme-basic .section-group {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 12px 0 !important; /* Reduced from 30px to tighten space between sections */
    text-align: center !important;
}

body.theme-basic .section-navpill,
body.theme-basic .badge {
    display: none !important;
}

/* Force white layer transparency to use main-container bg */
body.theme-basic .content-card::before {
    display: none !important;
}

/* Headlines and text in Basic theme */
body.theme-basic h1, 
body.theme-basic h2, 
body.theme-basic .group-headline,
body.theme-basic .faq-headline {
    color: #1e3a8a !important; /* Dark Blue */
    text-align: center !important;
    margin-bottom: 15px !important; /* Tightened headline spacing */
}

body.theme-basic p, 
body.theme-basic li,
body.theme-basic .badge {
    text-align: center !important;
    justify-content: center !important;
    margin-bottom: 12px !important; /* Reduced paragraph spacing */
}

body.theme-basic .feature-list li {
    justify-content: center;
}

/* Hide side elements in Basic theme */
body.theme-basic .external-section-image,
body.theme-basic .external-side-text,
body.theme-basic .section-side-icons,
body.theme-basic .section-left-stripe,
body.theme-basic .section-row-background,
body.theme-basic .group-side-image {
    display: none !important;
}

/* Adjust FAQ in Basic theme container */
body.theme-basic #faqSection {
    margin-top: 20px !important;
    border-top: 1px solid #eee !important;
    padding-top: 40px !important;
}

body.theme-basic .faq-grid {
    grid-template-columns: 1fr !important;
    max-width: 800px;
    margin: 0 auto;
}

/* Layout reset for shared rows in Basic */
body.theme-basic .sharing-row-left,
body.theme-basic .sharing-row-right {
    width: 100% !important;
    flex-direction: column !important;
}

/* Ensure controls are still visible */
body.theme-basic .section-sidebar {
    left: auto !important;
    right: -100px !important;
    top: 0 !important;
    width: 40px !important;
}

@media (max-width: 1200px) {
    body.theme-basic .section-sidebar {
        right: 0 !important;
        background: rgba(255,255,255,0.8);
        border-radius: 8px;
    }
}

@media (max-width: 768px) {
    body.theme-basic .main-container {
        width: 95% !important;
        padding: 20px;
    }
}

/* Remove gap between consecutive full-width sections */
.full-width-section + .full-width-section {
    margin-top: -50px !important;
}

/* Constrain content elements inside full width section */
.full-width-section > :not(.section-sidebar):not(.section-left-stripe):not(.section-row-background):not(.section-navpill):not(.drop-indicator):not(.element-delete-btn):not(.section-actions-group) {
    max-width: 1071px;
    margin-left: auto;
    margin-right: auto;
}

/* Remove bottom spacing if FAQ is visible, full-width, and at the bottom */
.main-container:has(> #faqSection.visible.full-width-section):not(:has(> #globalBottomImageContainer:not(.hidden))) {
    margin-bottom: 0;
}

.main-container:has(> #faqSection.visible.full-width-section):not(:has(> #globalBottomImageContainer:not(.hidden))) + .main-footer {
    border-top: none;
}

/* If FAQ is full-width and joined to footer, remove its bottom border and internal padding for a seamless transition */
.main-container:has(> #faqSection.visible.full-width-section):not(:has(> #globalBottomImageContainer:not(.hidden))) #faqSection.full-width-section {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

/* Standalone Elements (Between Sections) */
.standalone-element {
    width: 100%;
    max-width: 765px;
    margin-top: -25px;
    margin-bottom: -25px;
    text-align: center;
    position: relative;
    padding: 10px;
}

.standalone-element h2, 
.standalone-element p {
    margin-bottom: 10px;
}

.standalone-element .centered-image-container {
    margin-bottom: 10px;
}

/* FAQ Editor in Modal */
.faq-editor-item {
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
}

.faq-editor-item .remove-faq-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 1rem;
}

.faq-editor-item input, .faq-editor-item textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-top: 5px;
    font-family: inherit;
}

.faq-editor-item textarea {
    height: 60px;
    resize: vertical;
}

/* Icon Picker Styles */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

/* Icon color selector below icon grid */
.icon-color-section {
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    font-size: 0.8rem;
}

.icon-color-label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.icon-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.icon-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--border-color);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.icon-color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 1px var(--blue-france);
}

.icon-color-custom-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-color-custom-wrapper input[type="color"] {
    width: 32px;
    height: 24px;
    padding: 0;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.icon-color-custom-wrapper span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.icon-picker-item {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    color: var(--text-primary);
}

.icon-picker-item:hover {
    background-color: var(--blue-france);
    color: white;
    border-color: var(--blue-france);
    transform: scale(1.1);
}

/* Group wrapper & navpills for grouped sections */
.section-group {
    width: 100%;
    position: relative;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center; /* Let inner sections use their own width settings while the group is centered */
}

.group-navpill-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 45px; /* Increased separation between nav menu and content */
    justify-content: center; /* Center the group navpills */
    width: 100%;
}

.group-navpill {
    border: none;
    border-radius: 999px;
    padding: 6px 18px; /* Match section navpill padding */
    font-size: calc(0.85rem + 2px); /* Match section navpill size */
    font-weight: 700;
    font-family: inherit; /* Match the headline/body font */
    letter-spacing: 0.5px;
    background-color: #e5e7eb;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.group-navpill:hover {
    background-color: #d1d5db;
}

.group-navpill.active {
    background-color: var(--blue-france);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,85,212,0.25);
}

.group-main-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 30px;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.group-side-image {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 120px;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    background: none; /* No background behind the group image */
}

.section-group.visible .group-side-image {
    opacity: 1;
    transform: translateX(0);
}

.group-side-image img {
    width: 100%;
    height: auto;
    border-radius: 0;          /* Remove rounded corners to avoid visible frame */
    box-shadow: none;          /* No shadow around the group image */
    border: none;              /* No border around the group image */
}

.group-section-container {
    position: relative;
    flex: 1;
    max-width: 850px; /* Increased to allow section to fill more column space */
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Stretch sections to fill the container width */
}

/* When a group has a left image, pull the section controls further left so they are visible */
.section-group .group-main-content .group-section-container .section-sidebar {
    left: auto;
    right: -10px;
}

@media (max-width: 900px) {
    .group-main-content {
        flex-direction: column;
        align-items: center;
    }

    /* Disable the visual effect of the group left image on small screens */
    .group-side-image {
        display: none !important;
    }

    .section-group.visible .group-side-image {
        transform: none;
    }

    /* Ensure section controls stay fully visible on small screens */
    .section-group .group-main-content .group-section-container .section-sidebar {
        right: 0;
    }
}

/* Group headline above navpills (non-inline editable) */
.group-headline {
    display: block;
    width: 100%;
    font-size: 2rem;
    font-weight: 700;
    margin-top: 20px; 
    margin-bottom: 35px; /* Increased space between headline and navpills */
    line-height: 1.2;
    text-align: center !important; /* Ensure it's centered regardless of global alignment */
    color: var(--text-primary);
}

/* Grouped sections */
.grouped-section {
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.grouped-hidden {
    display: none !important;
}

/* Slide animations for grouped sections */
.grouped-section.slide-in-from-left {
    animation: grouped-slide-in-left 0.35s ease forwards;
}

.grouped-section.slide-in-from-right {
    animation: grouped-slide-in-right 0.35s ease forwards;
}

.grouped-section.slide-out-to-left {
    animation: grouped-slide-out-left 0.35s ease forwards;
}

.grouped-section.slide-out-to-right {
    animation: grouped-slide-out-right 0.35s ease forwards;
}

@keyframes grouped-slide-in-left {
    0% { transform: translateX(-40px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes grouped-slide-in-right {
    0% { transform: translateX(40px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes grouped-slide-out-left {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-40px); opacity: 0; }
}

@keyframes grouped-slide-out-right {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(40px); opacity: 0; }
}

/* Insert Section Inline Button */
.insert-section-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: -15px 0;
    padding: 10px 0;
    z-index: 100;
    position: relative;
}

.insert-section-btn {
    background: #e5e7eb;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.4;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insert-section-btn:hover {
    opacity: 1;
    background: #f3f4f6;
    color: var(--blue-france);
    border-color: var(--blue-france);
    transform: scale(1.05);
}

.insert-section-btn i {
    font-size: 0.8rem;
}

/* Reorder List Styles */
.reorder-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reorder-card {
    background: white;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Checkbox for selecting sections/groups in Manage Sections */
.reorder-select-checkbox {
    margin-right: 6px;
    flex-shrink: 0;
}

/* Page type badge inside Page Manager rows */
.page-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-left: 8px;
}

.page-type-badge.page-type-funnel {
    background-color: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.page-type-badge.page-type-download {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.reorder-card:active {
    cursor: grabbing;
}

.reorder-card.sortable-ghost {
    opacity: 0.4;
    background: #e0e7ff;
}

.reorder-card i.drag-handle {
    color: #ccc;
    font-size: 0.9rem;
    cursor: grab;
}

.reorder-card-actions {
    display: flex;
    gap: 5px;
}

/* Temporary highlight for sections when selected in Manage Sections */
.section-highlight {
    box-shadow: 0 0 0 2px #f97316, 0 0 0 4px #fed7aa;
    border-color: #fb923c !important;
    position: relative;
}

.section-highlight::after {
    content: 'Selected';
    position: absolute;
    top: -12px;
    right: 12px;
    background: #f97316;
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.reorder-duplicate-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.reorder-duplicate-btn:hover {
    background: #f0f0f0;
    color: var(--blue-france);
    border-color: var(--blue-france);
}

.reorder-delete-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ff4d4d;
    transition: all 0.2s;
}

.reorder-delete-btn:hover {
    background: #fff5f5;
    color: #e60000;
    border-color: #ff4d4d;
}

.reorder-card-text {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.ai-builder-list-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-builder-list-item-header {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-builder-gen-btn {
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.ai-builder-gen-btn:hover {
    filter: brightness(1.1);
}

.ai-builder-gen-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ai-builder-gen-btn.success {
    background: #10b981;
}

.ai-builder-gen-btn i.fa-spin {
    font-size: 0.7rem;
}

.reorder-tool-source {
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eee;
    color: #333;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    user-select: none;
}

.reorder-tool-source:hover {
    background: #e5e7eb;
}

.reorder-tool-source:active {
    cursor: grabbing;
}

.reorder-card.is-group {
    background-color: #f0fdf4; /* Light green */
    border-color: #bbf7d0;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
}

.reorder-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-bottom: 1px solid #bbf7d0;
}

.page-purpose-input {
    width: 180px;
    height: 28px;
    padding: 0 8px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-right: 8px;
    font-family: inherit;
    background: #fdfdfd;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.page-title-input {
    width: 210px;
    height: 28px;
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-right: 8px;
    font-family: inherit;
    background: #fdfdfd;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.page-title-input:focus {
    outline: none;
    border-color: var(--blue-france);
    box-shadow: 0 0 0 2px rgba(0, 85, 212, 0.1);
    background: #fff;
}

.page-purpose-input:focus {
    outline: none;
    border-color: var(--blue-france);
    box-shadow: 0 0 0 2px rgba(0, 85, 212, 0.1);
    background: #fff;
}

.pages-done-btn {
    width: auto !important;
    margin: 0 !important;
    padding: 10px 24px !important;
    font-size: 0.95rem !important;
    background-color: #10b981 !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
    animation: pages-done-pulse 2.5s ease-in-out infinite !important;
}

@keyframes pages-done-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); filter: brightness(1.05); }
}

.nested-sortable-list {
    min-height: 20px;
    padding: 10px 10px 10px 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255,255,255,0.4);
}

/* Button Customization Styles */
.cta-button {
    position: relative;
}

.btn-edit-trigger {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 26px;
    height: 26px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--blue-france);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
}

.cta-button:hover .btn-edit-trigger {
    opacity: 1;
}

.btn-edit-trigger:hover {
    transform: scale(1.1);
    background-color: var(--blue-france);
    color: white;
}

/* Button Loop Animations */
@keyframes btn-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes btn-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes btn-wobble {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-1deg); }
    75% { transform: rotate(1deg); }
}

@keyframes btn-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0,85,212,0.2); }
    50% { box-shadow: 0 0 20px rgba(0,85,212,0.5); }
}

@keyframes btn-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.btn-anim-pulse { animation: btn-pulse 2s ease-in-out infinite; }
.btn-anim-bounce { animation: btn-bounce 1.5s ease-in-out infinite; }
.btn-anim-wobble { animation: btn-wobble 1s ease-in-out infinite; }
.btn-anim-glow { animation: btn-glow 2s ease-in-out infinite; }
.btn-anim-float { animation: btn-float 3s ease-in-out infinite; }

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    .content-card,
    .section-group,
    .standalone-element {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Ensure grouped sections also span full width on small screens */
    .section-group .group-main-content,
    .section-group .group-section-container {
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Navpills: make bar wrap and center on small screens */
    .group-navpill-bar {
        justify-content: center;
        flex-wrap: wrap;
    }

    .group-navpill {
        width: auto;
        max-width: 100%;
        text-align: center;
        font-size: calc(0.85rem + 2px);
        padding: 6px 14px;
    }

    .section-navpill {
        display: none !important; /* Hidden on mobile per request */
    }

    /* Responsive Countdown Timers */
    .timer-unit {
        min-width: 54px;
        padding: 8px 4px;
    }
    .timer-value {
        font-size: 1.15rem;
    }
    .timer-label {
        font-size: 0.55rem;
    }
    .timer-pre-text {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    /* Responsive Standalone Elements (Headlines/Text outside cards) */
    .standalone-element {
        padding: 10px 0;
        margin-top: -10px;
        margin-bottom: 10px;
    }
    .standalone-element h2 {
        font-size: 1.65rem;
    }
    .standalone-element p {
        font-size: 0.95rem;
    }

    /* Responsive FAQs */
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Hide floating side icons on small screens */
    .section-side-icons {
        display: none !important;
    }

    /* Mobile handling for external side images */
    .external-section-image:not(.carousel-active) {
        display: none !important;
    }

    .external-section-image.carousel-active {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: 180px !important;
        transform: none !important;
        opacity: 1 !important;
        z-index: 1 !important;
        margin-top: 30px;
        display: block !important;
        overflow: hidden;
    }

    .external-section-image.carousel-active .carousel-track {
        flex-direction: row !important;
        height: 100% !important;
        width: max-content !important; /* Allow track to expand horizontally */
        animation: horizontal-carousel var(--carousel-speed, 5s) linear infinite !important;
        gap: 0 !important;
    }

    .external-section-image.carousel-active .carousel-track > img {
        height: 100% !important;
        width: auto !important;
        aspect-ratio: 1/1;
        margin-bottom: 0 !important;
        margin-right: 10px !important;
    }
}

@media (max-width: 480px) {
    .content-card {
        padding: 30px 20px;
    }
    
    h1, h2 {
        font-size: 1.6rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .cta-button {
        width: 100%;
    }
}

/* Ensure the global image/stock picker always appears above other modals like Section Settings and HTML Editor */
#imageModal {
    z-index: 4000;
}

#imageModal .modal-content {
    max-width: 90vw;
    width: 90vw;
}

/* Selection toolbar for editable text */
.selection-toolbar {
    position: fixed;
    display: inline-flex;
    gap: 6px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 6000;
    transform-origin: top left;
    transition: none; /* Disabled opening transition */
    pointer-events: auto;
}

/* Keep the inline editor controls visible whenever a text selection is active.
   The toolbar lives outside the footer so it cannot be clipped by the page
   layout or hidden behind editor overlays. */
.selection-toolbar:not(.hidden) {
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10000 !important;
}

.selection-toolbar.hidden {
    opacity: 0;
    visibility: hidden;
    transform: none;
    pointer-events: none;
}

.selection-toolbar button {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
}

.selection-toolbar button:hover {
    background: #f2f6ff;
    color: var(--blue-france);
}

/* Small adjustments for mobile so toolbar doesn't overflow */
@media (max-width: 480px) {
    .selection-toolbar { gap: 4px; padding: 6px; }
    .selection-toolbar button { width: 44px; height: 44px; font-size: 1.1rem; }
}
