/**
 * semaglutide mastery course styles
 *
 * extends the base learn page styles with course-specific theming,
 * paywall ui, loading states, and interactive visualization containers.
 * aligned to the shared mountain-meadow interactive palette.
 */

/* ============================================================
   course header badge
   ============================================================ */

.smg-course-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    background: linear-gradient(
        135deg,
        rgba(var(--meadow-500-rgb, 16, 185, 129), 0.18),
        rgba(var(--meadow-400-rgb, 52, 211, 158), 0.1)
    );
    color: var(--meadow-300, #6ee7bf);
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.24);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 2px 8px rgba(var(--meadow-500-rgb, 16, 185, 129), 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.smg-course-badge i {
    width: 14px;
    height: 14px;
}

/* ============================================================
   loading skeleton for paid content
   ============================================================ */

.smg-loading {
    position: relative;
    min-height: 120px;
}

.smg-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(90deg,
            var(--color-bg-card, rgba(255, 255, 255, 0.03)) 25%,
            rgba(255, 255, 255, 0.06) 50%,
            var(--color-bg-card, rgba(255, 255, 255, 0.03)) 75%);
    background-size: 200% 100%;
    animation: smg-shimmer 1.5s ease-in-out infinite;
}

@keyframes smg-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* light mode loading skeleton */
[data-theme="light"] .smg-loading::after {
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.04) 25%,
            rgba(0, 0, 0, 0.08) 50%,
            rgba(0, 0, 0, 0.04) 75%);
    background-size: 200% 100%;
}

/* ============================================================
   paywall cta
   ============================================================ */

.smg-paywall {
    text-align: center;
    padding: 48px 24px;
    border-radius: 16px;
    background: var(--color-bg-card, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    margin: 32px 0;
}

.smg-paywall-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.12);
    margin-bottom: 16px;
}

.smg-paywall-icon i {
    width: 28px;
    height: 28px;
    color: var(--meadow-400, #34d39e);
}

.smg-paywall-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text, #fff);
}

.smg-paywall--cert {
    border-color: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.3);
    background: rgba(var(--meadow-400-rgb, 52, 211, 158), 0.06);
}

.smg-paywall-title--success {
    color: var(--color-primary, #34d39e);
}

.smg-paywall-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-muted, rgba(255, 255, 255, 0.55));
    max-width: 520px;
    margin: 0 auto 24px;
}

.smg-paywall-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    max-width: 440px;
    margin: 0 auto 24px;
    font-size: 0.82rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.5));
    cursor: pointer;
}

.smg-paywall-consent input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--color-primary, #34d39e);
}

.smg-paywall-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    margin: 0 auto 16px;
}

.smg-buy-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.smg-buy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.smg-paywall-guarantee {
    font-size: 0.78rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.4));
}

.smg-cert-form {
    display: flex;
    gap: 10px;
    max-width: 420px;
    margin: 0 auto;
}

.smg-cert-input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.22);
    background: rgba(0, 0, 0, 0.15);
    color: var(--color-text, #fff);
    font-size: 0.9rem;
}

/* ============================================================
   interactive visualization containers
   ============================================================ */

.smg-interactive-wrap {
    margin: 24px 0;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.18);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 0 16px rgba(255, 255, 255, 0.02);
}

.smg-interactive-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    color: var(--color-primary, #34d39e);
    border-bottom: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.16);
}

.smg-interactive-header i {
    width: 16px;
    height: 16px;
}

.smg-interactive-body {
    padding: 20px;
    min-height: 300px;
}

/* ============================================================
   data highlight cards
   ============================================================ */

.smg-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.smg-stat-card {
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.07) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.16);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 0 12px rgba(255, 255, 255, 0.02);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.smg-stat-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 0 16px rgba(255, 255, 255, 0.03);
}

.smg-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary, #34d39e);
    margin-bottom: 4px;
}

.smg-stat-label {
    font-size: 0.78rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.5));
}

/* ============================================================
   light mode overrides
   ============================================================ */

[data-theme="light"] .smg-course-badge {
    box-shadow:
        0 2px 8px rgba(16, 185, 129, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .smg-interactive-wrap {
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.03) 0%,
            rgba(0, 0, 0, 0.01) 50%,
            rgba(0, 0, 0, 0.02) 100%);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .smg-interactive-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .smg-stat-card {
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.03) 0%,
            rgba(0, 0, 0, 0.01) 50%,
            rgba(0, 0, 0, 0.02) 100%);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .smg-stat-card:hover {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ============================================================
   evidence tier badges
   ============================================================ */

.smg-evidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.03em;
}

.smg-evidence-badge--phase3 {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.14);
    color: var(--meadow-300, #6ee7bf);
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.24);
}

.smg-evidence-badge--phase2 {
    background: rgba(var(--meadow-300-rgb, 110, 231, 191), 0.14);
    color: var(--meadow-200, #a7f3da);
    border: 1px solid rgba(var(--meadow-300-rgb, 110, 231, 191), 0.24);
}

.smg-evidence-badge--preclinical {
    background: rgba(var(--meadow-400-rgb, 52, 211, 158), 0.12);
    color: var(--meadow-300, #6ee7bf);
    border: 1px solid rgba(var(--meadow-400-rgb, 52, 211, 158), 0.22);
}

.smg-evidence-badge--approved {
    background: rgba(var(--meadow-200-rgb, 167, 243, 218), 0.16);
    color: var(--meadow-100, #d1faec);
    border: 1px solid rgba(var(--meadow-200-rgb, 167, 243, 218), 0.24);
}

/* ============================================================
   panel tabs (used in interactive components)
   ============================================================ */

.smg-panel-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.smg-panel-tab {
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.22);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.smg-panel-tab:hover {
    background: rgba(var(--meadow-400-rgb, 52, 211, 158), 0.08);
}

.smg-panel-tab.is-active {
    background: rgba(var(--meadow-400-rgb, 52, 211, 158), 0.15);
    color: var(--color-primary, #34d39e);
    border-color: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.3);
    font-weight: 600;
}

/* ============================================================
   content cards (panels, compare, outcomes)
   ============================================================ */

.smg-panel-card,
.smg-compare-card,
.smg-outcome-row {
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.14);
    border-radius: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s ease;
}

.smg-panel-card:hover,
.smg-compare-card:hover {
    border-color: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.28);
}

.smg-compare-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.smg-compare-status {
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.8));
    font-size: 0.85rem;
}

/* ============================================================
   range slider and balance bar
   ============================================================ */

.smg-range {
    width: 100%;
    margin: 8px 0 14px;
    accent-color: #f59e0b;
}

.smg-range-label {
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.8));
    font-size: 0.85rem;
}

.smg-balance-bar {
    display: flex;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
}

.smg-balance-copy {
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.8));
    font-size: 0.85rem;
    line-height: 1.6;
}

#smg-efficacy {
    display: block;
    background: linear-gradient(90deg, #065f42, #10b981);
    transition: width 0.3s ease;
}

#smg-side-effects {
    display: block;
    background: linear-gradient(90deg, #fde68a, #fef3c7);
    transition: width 0.3s ease;
}

/* ============================================================
   outcome bars
   ============================================================ */

.smg-outcome-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.smg-outcome-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.smg-outcome-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--meadow-600, #059666), var(--meadow-400, #34d39e));
    border-radius: 999px;
    transition: width 0.5s ease;
}

/* ============================================================
   responsive
   ============================================================ */

@media (max-width: 640px) {
    .smg-paywall {
        padding: 32px 16px;
    }

    .smg-paywall-title {
        font-size: 1.1rem;
    }

    .smg-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .smg-interactive-body {
        padding: 12px;
        min-height: 240px;
    }

    .smg-compare-grid {
        grid-template-columns: 1fr;
    }

    .smg-cert-form {
        flex-direction: column;
    }
}

/* ============================================================
   prefers-reduced-motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .smg-loading::after {
        animation: none;
    }

    .smg-stat-card {
        transition: none;
    }

    #smg-efficacy,
    #smg-side-effects {
        transition: none;
    }

    .smg-outcome-bar span {
        transition: none;
    }
}
