/**
 * BioCode Homepage Enhancement Layer
 * Scoped to body.home — zero leakage to other pages.
 *
 * Brand palette (no new colours introduced):
 *   --bc-blue:   #175cff  (primary)
 *   --bc-dark:   #0a45d4  (hover)
 *   --bc-navy:   #0a083b  (text/headings)
 *   --bc-muted:  #57586e  (secondary text)
 *   --bc-border: #e2e8f0
 *   --bc-bg:     #f8fafc
 *
 * @package TutorStarter_Child
 */

/* ─── Custom properties ──────────────────────────────────────────────────── */
body.home {
    --bc-blue:       #175cff;
    --bc-dark:       #0a45d4;
    --bc-navy:       #0a083b;
    --bc-muted:      #57586e;
    --bc-border:     #e2e8f0;
    --bc-bg:         #f8fafc;
    --bc-shadow-sm:  0 2px 8px rgba(23, 92, 255, .08);
    --bc-shadow:     0 4px 24px rgba(23, 92, 255, .12);
    --bc-shadow-lg:  0 8px 40px rgba(23, 92, 255, .16);
    --bc-radius:     12px;
    --bc-radius-lg:  18px;
    --bc-ease:       cubic-bezier(0.4, 0, 0.2, 1);
    --bc-transition: 0.28s var(--bc-ease);
}


/* ─── Global homepage improvements ──────────────────────────────────────── */
body.home {
    scroll-behavior: smooth;
}

/* Tighten section vertical rhythm */
body.home .elementor-section {
    position: relative;
}

/* Section heading accent underline */
body.home .elementor-widget-heading h2.elementor-heading-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--bc-blue);
    border-radius: 2px;
    margin: 10px auto 0;
}

/* Remove underline from headings that clearly have their own visual treatment */
body.home .elementor-section:first-child h2.elementor-heading-title::after {
    display: none;
}


/* ─── Hero section ───────────────────────────────────────────────────────── */
body.home .elementor-element-6c50deb h1 {
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* Primary CTA button – pulse glow on idle */
body.home .elementor-element-afd28cb .elementor-button {
    background: var(--bc-blue);
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 0 rgba(23, 92, 255, 0.4);
    animation: bc-pulse 2.4s var(--bc-ease) infinite;
    transition: transform var(--bc-transition), box-shadow var(--bc-transition), background var(--bc-transition);
}

body.home .elementor-element-afd28cb .elementor-button:hover,
body.home .elementor-element-afd28cb .elementor-button:focus {
    background: var(--bc-dark);
    transform: translateY(-2px);
    box-shadow: var(--bc-shadow-lg);
    animation: none;
}

@keyframes bc-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(23, 92, 255, 0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(23, 92, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(23, 92, 255, 0); }
}

/* All other Elementor buttons — consistent brand style */
body.home .elementor-button-wrapper .elementor-button {
    border-radius: 8px;
    font-weight: 600;
    transition: transform var(--bc-transition), box-shadow var(--bc-transition), background var(--bc-transition), color var(--bc-transition);
}

body.home .elementor-button-wrapper .elementor-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--bc-shadow);
}


/* ─── Stats bar (injected via JS after hero) ─────────────────────────────── */
.biocode-stats-bar {
    background: linear-gradient(135deg, var(--bc-navy) 0%, #1a1a4e 100%);
    color: #fff;
    padding: 20px 24px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.biocode-stats-bar-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
    max-width: 960px;
    margin: 0 auto;
}

.biocode-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.biocode-stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.02em;
}

.biocode-stat-number .bc-plus {
    color: var(--bc-blue);
    font-size: 1.2em;
}

.biocode-stat-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.biocode-stat-separator {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 640px) {
    .biocode-stats-bar-inner {
        gap: 20px 32px;
    }
    .biocode-stat-separator {
        display: none;
    }
    .biocode-stat-number {
        font-size: 1.4rem;
    }
}


/* ─── TutorLMS / Element Pack course cards ───────────────────────────────── */

/* Course card container */
body.home .bdt-tutor-course-loop-item {
    border-radius: var(--bc-radius) !important;
    box-shadow: var(--bc-shadow-sm);
    transition: transform var(--bc-transition), box-shadow var(--bc-transition);
    overflow: hidden;
    background: #fff;
}

body.home .bdt-tutor-course-loop-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--bc-shadow-lg);
}

/* Thumbnail */
body.home .tutor-ratio.tutor-ratio-1x1 {
    border-radius: var(--bc-radius) var(--bc-radius) 0 0;
    overflow: hidden;
}

/* Level badge */
body.home .bdt-tutor-course-loop-level {
    background: var(--bc-blue) !important;
    color: #fff !important;
    border-radius: 20px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em;
    padding: 3px 10px !important;
    text-transform: uppercase;
}

/* Title */
body.home .bdt-tutor-course-loop-title a {
    font-weight: 600;
    color: var(--bc-navy) !important;
    transition: color var(--bc-transition);
    text-decoration: none;
}

body.home .bdt-tutor-course-loop-title a:hover {
    color: var(--bc-blue) !important;
}

/* Price */
body.home .bdt-tutor-course-loop-price .woocommerce-Price-amount {
    font-weight: 700;
    color: var(--bc-blue) !important;
    font-size: 1rem;
}

/* Star ratings */
body.home .tutor-ratings-stars .tutor-icon-star-bold,
body.home .tutor-ratings-stars .tutor-icon-star-half-bold {
    color: #f59e0b !important;
}

/* Add to cart / enrol button */
body.home .tutor-btn.tutor-btn-outline-primary {
    border-color: var(--bc-blue) !important;
    color: var(--bc-blue) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: background var(--bc-transition), color var(--bc-transition), transform var(--bc-transition) !important;
}

body.home .tutor-btn.tutor-btn-outline-primary:hover {
    background: var(--bc-blue) !important;
    color: #fff !important;
    transform: translateY(-1px);
}


/* ─── Testimonials (Elementor Testimonial Carousel) ──────────────────────── */
body.home .elementor-testimonial {
    background: #fff;
    border-radius: var(--bc-radius-lg);
    box-shadow: var(--bc-shadow-sm);
    padding: 32px 28px 24px;
    position: relative;
    transition: box-shadow var(--bc-transition);
}

body.home .elementor-testimonial:hover {
    box-shadow: var(--bc-shadow);
}

body.home .elementor-testimonial::before {
    content: '\201C';
    position: absolute;
    top: -12px;
    left: 24px;
    font-size: 5rem;
    line-height: 1;
    color: rgba(23, 92, 255, 0.12);
    font-family: Georgia, serif;
    font-weight: 700;
    pointer-events: none;
}

body.home .elementor-testimonial-content {
    font-size: 0.97rem;
    line-height: 1.7;
    color: var(--bc-muted);
}

body.home .elementor-testimonial-name {
    font-weight: 700;
    color: var(--bc-navy);
    margin-top: 16px;
}

body.home .elementor-testimonial-job {
    color: var(--bc-blue);
    font-size: 0.85rem;
    font-weight: 500;
}


/* ─── FAQ / Toggle widget ────────────────────────────────────────────────── */
body.home .elementor-toggle {
    border-radius: var(--bc-radius);
    overflow: hidden;
}

body.home .elementor-toggle-item {
    border: 1px solid var(--bc-border);
    border-radius: 8px !important;
    margin-bottom: 8px;
    overflow: hidden;
    transition: box-shadow var(--bc-transition);
    background: #fff;
}

body.home .elementor-toggle-item:hover {
    box-shadow: var(--bc-shadow-sm);
}

body.home .elementor-toggle-title {
    font-weight: 600 !important;
    font-size: 0.97rem !important;
    color: var(--bc-navy) !important;
    padding: 16px 20px !important;
    transition: color var(--bc-transition);
}

body.home .elementor-toggle-title:hover {
    color: var(--bc-blue) !important;
}

/* Active (open) state */
body.home .elementor-toggle-title.elementor-active {
    color: var(--bc-blue) !important;
    border-left: 3px solid var(--bc-blue);
}

body.home .elementor-toggle-content {
    color: var(--bc-muted);
    font-size: 0.93rem;
    line-height: 1.7;
    padding: 0 20px 16px !important;
}

/* Icon rotation */
body.home .elementor-toggle-icon {
    transition: transform var(--bc-transition);
}

body.home .elementor-toggle-title.elementor-active .elementor-toggle-icon {
    color: var(--bc-blue);
}


/* ─── Pricing / Membership plans ─────────────────────────────────────────── */

/* Highlight 3rd pricing column as "Most Popular" */
body.home .elementor-widget-price-table:nth-child(3),
body.home .elementor-price-table:nth-child(3) {
    transform: scale(1.03);
    transform-origin: bottom center;
    position: relative;
    z-index: 2;
}

body.home .elementor-widget-price-table:nth-child(3)::before {
    content: 'Most Popular';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bc-blue);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
    z-index: 3;
}

/* Pricing card base styling */
body.home .elementor-price-table {
    border-radius: var(--bc-radius) !important;
    overflow: hidden;
    box-shadow: var(--bc-shadow-sm);
    transition: transform var(--bc-transition), box-shadow var(--bc-transition);
}

body.home .elementor-price-table:hover {
    transform: translateY(-4px);
    box-shadow: var(--bc-shadow);
}

/* Price amount emphasis */
body.home .elementor-price-table .elementor-price-table__price {
    font-weight: 800 !important;
}

/* Pricing CTA button */
body.home .elementor-price-table .elementor-price-table__button {
    border-radius: 8px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    transition: transform var(--bc-transition), box-shadow var(--bc-transition) !important;
}

body.home .elementor-price-table .elementor-price-table__button:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--bc-shadow) !important;
}


/* ─── Image boxes / feature cards ───────────────────────────────────────── */
body.home .elementor-image-box-wrapper {
    border-radius: var(--bc-radius);
    transition: transform var(--bc-transition), box-shadow var(--bc-transition);
    padding: 8px;
}

body.home .elementor-image-box-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: var(--bc-shadow);
}

body.home .elementor-image-box-title {
    font-weight: 700 !important;
    color: var(--bc-navy) !important;
}

body.home .elementor-image-box-description {
    color: var(--bc-muted) !important;
    line-height: 1.65 !important;
}


/* ─── Trust badge row (below hero, injected via JS) ──────────────────────── */
.biocode-trust-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
}

.biocode-trust-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.biocode-trust-item::before {
    content: '✓';
    color: #5ee7b0;
    font-weight: 700;
    font-size: 0.9em;
}


/* ─── Sticky CTA ribbon ──────────────────────────────────────────────────── */
.biocode-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000; /* below search overlay (999999) */
    background: var(--bc-navy);
    border-top: 2px solid var(--bc-blue);
    transform: translateY(100%);
    transition: transform 0.38s var(--bc-ease);
    will-change: transform;
}

.biocode-sticky-cta.is-visible {
    transform: translateY(0);
}

.biocode-sticky-cta-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.biocode-sticky-cta-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.93rem;
    font-weight: 500;
}

.biocode-sticky-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bc-blue);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 0.87rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: background var(--bc-transition), transform var(--bc-transition);
}

.biocode-sticky-cta-btn:hover {
    background: var(--bc-dark);
    transform: translateY(-1px);
}

.biocode-sticky-cta-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
    transition: color var(--bc-transition);
    flex-shrink: 0;
}

.biocode-sticky-cta-close:hover {
    color: #fff;
}

@media (max-width: 600px) {
    .biocode-sticky-cta-inner {
        gap: 10px;
        padding: 12px 16px;
    }
    .biocode-sticky-cta-text {
        font-size: 0.82rem;
        text-align: center;
        flex: 1 1 100%;
    }
    .biocode-sticky-cta-btn {
        flex: 1;
        justify-content: center;
    }
    .biocode-sticky-cta-close {
        margin-left: 0;
    }
}


/* ─── Mobile / responsive overrides ─────────────────────────────────────── */
@media (max-width: 768px) {
    /* Prevent Elementor's mobile h1 from being too large */
    body.home h1.elementor-heading-title {
        line-height: 1.2 !important;
    }

    /* Pricing columns stack */
    body.home .elementor-widget-price-table:nth-child(3) {
        transform: none;
    }
    body.home .elementor-widget-price-table:nth-child(3)::before {
        display: none;
    }

    /* Image boxes – full width on small screens */
    body.home .elementor-image-box-wrapper:hover {
        transform: none;
    }

    /* Stats bar grid on phones */
    .biocode-stats-bar-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .biocode-stats-bar-inner {
        grid-template-columns: 1fr 1fr;
    }

    .biocode-stat-number {
        font-size: 1.25rem;
    }
}


/* ─── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    body.home * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .biocode-sticky-cta {
        transition: none;
    }
    @keyframes bc-pulse { to { box-shadow: none; } }
}
