:root {
    --primary: #3157D5;
    --primary-dark: #1e3a8a;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --dark: #0f172a;
    --border-color: #e2e8f0;
}

/* ─── Hero Section ─── */
.demo-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #3157D5 100%);
    color: #ffffff;
    padding: 60px 0 50px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
.demo-hero::after {
    content: "";
    position: absolute;
    top: -140px;
    right: -90px;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(129,140,248,0.35) 0%, transparent 70%);
    pointer-events: none;
}
.demo-hero .container { position: relative; z-index: 2; }
.demo-hero h1, .demo-hero .lead, .demo-hero p { color: #ffffff; }
.demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #e0e7ff;
    margin-bottom: 1.1rem;
    backdrop-filter: blur(8px);
}

/* ─── Sidebar ─── */
.demo-sidebar {
    position: sticky;
    top: 25px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    height: fit-content;
}
.demo-sidebar h5 {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #f1f5f9;
}
.demo-sidebar .nav-link {
    color: #475569;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 9px 14px;
    border-left: 3px solid transparent;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}
.demo-sidebar .nav-link:hover,
.demo-sidebar .nav-link.active {
    color: #3157D5;
    background: #eef2ff;
    border-left-color: #3157D5;
}

/* ─── Main Content Container ─── */
.demo-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 35px 40px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.05);
}

/* ─── Position Controls Bar ─── */
.position-controls {
    background: #f8fafc;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 35px;
    border: 1px solid #e2e8f0;
}
.position-controls h4 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.35rem;
}
.position-test-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0 10px;
}
.position-btn {
    padding: 8px 16px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}
.position-btn:hover {
    border-color: #3157D5;
    color: #3157D5;
    background: #f0f7ff;
}
.position-btn.active {
    background: #3157D5;
    color: #ffffff;
    border-color: #3157D5;
    box-shadow: 0 4px 12px rgba(49, 87, 213, 0.25);
}

/* ─── Feature Test Section ─── */
.feature-test-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 45px;
}
.feature-test-section:not(:last-child) {
    padding-bottom: 35px;
    border-bottom: 1px solid #f1f5f9;
}
.section-header-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
}

/* ─── EXACT FEATURE CARD MATCHING ATTACHMENT ─── */
.feature-card {
    background: #f4f8fc;
    border-radius: 20px;
    padding: 24px 22px;
    height: 100%;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}
.feature-icon {
    width: 48px;
    height: 48px;
    background: #1d4ed8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.feature-card h5, .feature-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.feature-card p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.48;
    margin-bottom: 18px;
    flex-grow: 1;
}
.feature-test-box {
    background: #cffafe;
    border: 1px solid #a5f3fc;
    border-radius: 14px;
    padding: 13px 15px;
    font-size: 0.88rem;
    color: #0e7490;
    line-height: 1.45;
    margin-top: auto;
}
.feature-test-box strong {
    color: #083344;
    font-weight: 800;
}
.feature-test-box i {
    color: #0e7490;
    margin-left: 2px;
    margin-right: 2px;
}

/* Test Content Area */
.test-content-area {
    background: #f8fafc;
    border-radius: 14px;
    padding: 24px;
    margin: 20px 0;
    border: 1.5px dashed #cbd5e1;
}
.sample-article { max-width: 100%; }

/* Motion Demo */
.motion-demo {
    width: 100%;
    height: 140px;
    background: linear-gradient(90deg, #3157D5, #38bdf8);
    border-radius: 12px;
    margin: 12px 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
}
.motion-demo-mini {
    width: 100%;
    height: 70px;
    background: linear-gradient(90deg, #3157D5 0%, #38bdf8 100%);
    border-radius: 12px;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
}
.animated-element, .demo-bouncing-target {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    -webkit-animation: bounceMotionEffect 1.2s infinite ease-in-out !important;
    animation: bounceMotionEffect 1.2s infinite ease-in-out !important;
    will-change: transform;
}
@keyframes bounceMotionEffect {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}
@-webkit-keyframes bounceMotionEffect {
    0%, 100% {
        -webkit-transform: translateY(0px);
    }
    50% {
        -webkit-transform: translateY(-12px);
    }
}

/* When Reduce Motion is enabled via toolbar */
.atb-reduce-motion .animated-element,
.atb-reduce-motion .demo-bouncing-target,
body.atb-reduce-motion .animated-element,
body.atb-reduce-motion .demo-bouncing-target,
html.atb-reduce-motion .animated-element,
html.atb-reduce-motion .demo-bouncing-target,
#main-content.atb-reduce-motion .animated-element,
#main-content.atb-reduce-motion .demo-bouncing-target {
    -webkit-animation: none !important;
    animation: none !important;
    transform: none !important;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 15px 0;
}
.demo-image {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

/* Carousel */
.test-carousel {
    margin: 20px 0;
    border-radius: 14px;
    overflow: hidden;
}
.carousel-item img {
    height: 280px;
    object-fit: cover;
    width: 100%;
}

@media (max-width: 991px) {
    .demo-sidebar { position: static; margin-bottom: 25px; }
    .demo-content { padding: 25px 20px; }
}
