/* ==========================================================================
   V-Members - Member Area Frontend Styles
   Dark theme - Full-width - Swiper - Responsive
   ========================================================================== */

/* ==========================================================================
   Theme Isolation - Neutralize common theme CSS interference
   Scoped to #vm-app so it never leaks outside the plugin.
   ========================================================================== */

#vm-app img,
#vm-app .vm-card-img,
#vm-app .vm-cc-img,
#vm-app .vm-ca-banner-img,
#vm-app .vm-ca-continue-img {
    max-width: none !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
}

#vm-app figure,
#vm-app picture {
    margin: 0 !important;
    padding: 0 !important;
    display: contents !important;
}

#vm-app a {
    text-decoration: none !important;
    box-shadow: none !important;
}

#vm-app *,
#vm-app *::before,
#vm-app *::after {
    box-sizing: border-box !important;
}

:root {
    --vm-bg-page: #0f0f0f;
    --vm-bg-surface: #1a1a1a;
    --vm-border-color: #2a2a2a;
    --vm-border-radius: 12px;
    --vm-text-primary: #f0f0f0;
    --vm-text-secondary: #a0a0a0;
    --vm-text-muted: #666666;
    --vm-accent: #3B82F6;
    --vm-accent-hover: #2563EB;
    --vm-accent-light: rgba(59, 130, 246, 0.15);
    --vm-accent-shadow: rgba(59, 130, 246, 0.35);
    --vm-accent-shadow-strong: rgba(59, 130, 246, 0.45);
    --vm-card-hover-border: var(--vm-accent);
    --vm-completion-checkpoint: #00b894;
    --vm-completion-text: #00b894;
    --vm-warning: #fdcb6e;
    --vm-danger: #e17055;
    --vm-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --vm-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --vm-section-title-color: var(--vm-text-primary);
    --vm-lock-bg: rgba(0, 0, 0, 0.6);
    --vm-lock-color: rgba(255, 255, 255, 0.85);
    --vm-container-width: 1400px;
    --vm-spacing-section: 56px;
    --vm-transition: 0.25s ease;
}

/* ==========================================================================
   Full-Width Overrides - Break out of Astra/theme containers
   ========================================================================== */

body.vm-fullwidth-page #primary,
body.vm-fullwidth-page .site-content,
body.vm-fullwidth-page .ast-container,
body.vm-fullwidth-page .site-main,
body.vm-fullwidth-page #content,
body.vm-fullwidth-page .entry-content,
body.vm-fullwidth-page .page-builder-template,
body.vm-fullwidth-page .ast-plain-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
}

body.vm-fullwidth-page .site-content > .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
}

body.vm-fullwidth-page #primary {
    float: none !important;
}

/* Paint the theme shell with the page background so no white band shows
   when the viewport is taller than the content (e.g. zoomed out). */
body.vm-fullwidth-page,
body.vm-fullwidth-page #page,
body.vm-fullwidth-page .site,
body.vm-fullwidth-page .site-content,
body.vm-fullwidth-page .ast-separate-container {
    background: var(--vm-bg-page) !important;
}

/* ==========================================================================
   Page Wrapper
   ========================================================================== */

.vm-page-wrap {
    background: var(--vm-bg-page);
    min-height: 70vh;
    color: var(--vm-text-primary);
    width: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.vm-member-area {
    padding-bottom: var(--vm-spacing-section);
}

.vm-container {
    width: 100%;
    max-width: var(--vm-container-width);
    margin: 0 auto;
    padding: 0 clamp(16px, 3.2vw, 40px);
    box-sizing: border-box;
}

/* ==========================================================================
   Banner
   ========================================================================== */

.vm-banner {
    position: relative;
    width: 100%;
    min-height: 380px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--vm-spacing-section);
}

.vm-banner-media {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.vm-banner-media img,
.vm-banner-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vm-banner-slideshow {
    width: 100%;
    height: 100%;
}

.vm-banner-slideshow .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vm-banner-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.65) 100%);
    pointer-events: none;
}

.vm-banner-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 60px 32px;
    max-width: 800px;
}

.vm-banner-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    overflow-wrap: anywhere;
}

.vm-banner-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 28px;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    overflow-wrap: anywhere;
}

.vm-banner-cta {
    display: inline-block;
    padding: 14px 36px;
    background: var(--vm-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all var(--vm-transition);
    box-shadow: 0 4px 16px var(--vm-accent-shadow);
}

.vm-banner-cta:hover {
    background: var(--vm-accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--vm-accent-shadow-strong);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.vm-section {
    margin-bottom: var(--vm-spacing-section);
}

.vm-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--vm-border-color);
}

.vm-section-title {
    font-size: clamp(1.1rem, 0.98rem + 0.55vw, 1.5rem);
    font-weight: 600;
    color: var(--vm-section-title-color);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.25;
    flex: 1 1 260px;
    min-width: 0;
}

.vm-section-nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.vm-nav-btn {
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--vm-nav-bg, transparent) !important;
    border: 1px solid var(--vm-nav-border, var(--vm-border-color)) !important;
    border-radius: 10px !important;
    color: var(--vm-nav-color, var(--vm-text-primary)) !important;
    font-size: 1.35rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: all var(--vm-transition) !important;
    padding: 0 !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    flex-shrink: 0 !important;
}

.vm-nav-btn:hover {
    background: var(--vm-nav-hover-bg, var(--vm-accent)) !important;
    border-color: var(--vm-nav-hover-border, var(--vm-accent)) !important;
    color: var(--vm-nav-hover-color, #fff) !important;
}

.vm-nav-btn.swiper-button-disabled {
    opacity: 0.3;
    cursor: default;
}

.vm-nav-btn.swiper-button-disabled:hover {
    background: var(--vm-nav-bg, transparent) !important;
    border-color: var(--vm-nav-border, var(--vm-border-color)) !important;
    color: var(--vm-nav-color, var(--vm-text-primary)) !important;
}

/* ==========================================================================
   Carousel / Swiper
   ========================================================================== */

.vm-carousel {
    position: relative;
    padding: 0 2px 8px;
    overflow: visible;
}

#vm-app .vm-carousel .swiper-wrapper {
    padding: 4px 0;
    align-items: stretch !important;
}

/* Swiper built-in arrows hidden - using custom .vm-nav-btn in header */
.vm-carousel .swiper-button-prev,
.vm-carousel .swiper-button-next {
    display: none !important;
}

/* ==========================================================================
   Course Card
   ========================================================================== */

#vm-app .vm-course-card {
    flex-shrink: 0 !important;
}

#vm-app .vm-card-link {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: inherit;
    background: var(--vm-bg-surface) !important;
    border: 1px solid var(--vm-border-color) !important;
    border-radius: var(--vm-border-radius) !important;
    overflow: hidden !important;
    transition: all var(--vm-transition);
    height: 100% !important;
}

.vm-card-link:hover {
    border-color: var(--vm-card-hover-border);
    box-shadow: var(--vm-shadow);
    transform: translateY(-3px);
}

.vm-card-link:hover .vm-card-img {
    transform: scale(1.04);
}

/* Thumbnail - fixed 16:9 container
   Uses padding-bottom fallback alongside height:0 for maximum theme resilience.
   #vm-app prefix boosts specificity to beat theme selectors like .entry-content img */
#vm-app .vm-card-thumb {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 56.25% !important; /* 9/16 = 0.5625 - bulletproof 16:9 */
    overflow: hidden !important;
    background: #111 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    margin: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
    border: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

#vm-app .vm-card-thumb .vm-card-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    max-width: none !important;
    max-height: none !important;
    float: none !important;
    aspect-ratio: auto !important;
    transition: filter var(--vm-transition), opacity var(--vm-transition), transform 0.4s ease;
}

#vm-app .vm-card-img-placeholder {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Locked state */
#vm-app .vm-card--locked .vm-card-img {
    filter: grayscale(100%) !important;
    opacity: 0.5 !important;
}

#vm-app .vm-card--locked .vm-card-link:hover .vm-card-img {
    transform: none !important;
}

.vm-card-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--vm-lock-bg);
    border-radius: 50%;
    /* Proportional: 20% of the card thumbnail width */
    width: 20%;
    max-width: 48px;
    min-width: 28px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vm-lock-color);
    z-index: 2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.vm-card-lock svg {
    width: 50%;
    height: 50%;
}

/* Progress bar on thumbnail */
.vm-card-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 2;
}

.vm-card-progress-bar {
    height: 100%;
    background: var(--vm-completion-checkpoint);
    border-radius: inherit;
    transition: width 0.5s ease;
}

/* Card body */
#vm-app .vm-card-body {
    padding: 16px 18px;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    gap: 12px;
}

.vm-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--vm-text-primary);
    margin: 0 0 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vm-card-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.vm-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 0;
    padding-top: 0;
}

.vm-card-footer .vm-card-completion + .vm-card-meta {
    padding-top: 8px;
    border-top: 1px solid var(--vm-border-color);
}

.vm-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--vm-text-secondary);
}

.vm-card-meta-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.vm-card-completion {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--vm-completion-text);
    font-weight: 600;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* Empty state */
.vm-empty-state {
    text-align: center;
    padding: 100px 24px;
    color: var(--vm-text-muted);
    font-size: 1.15rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .vm-container {
        padding: 0 32px;
    }
}

@media (max-width: 1024px) {
    .vm-banner {
        min-height: 280px;
    }
    .vm-banner-title {
        font-size: 2.2rem;
    }
    .vm-section-header {
        margin-bottom: 18px;
        padding-bottom: 12px;
    }
    .vm-container {
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    .vm-banner {
        min-height: 220px;
    }
    .vm-banner-title {
        font-size: 1.6rem;
    }
    .vm-banner-subtitle {
        font-size: 1rem;
    }
    .vm-section-title {
        font-size: 1.25rem;
    }
    .vm-section-nav {
        display: flex;
        gap: 6px;
    }
    .vm-nav-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
        font-size: 1.15rem !important;
    }
    .vm-container {
        padding: 0 16px;
    }
}

@media (max-width: 915px) and (orientation: landscape) {
    .vm-banner {
        min-height: 180px;
    }
    .vm-banner-content {
        padding-top: 28px;
        padding-bottom: 28px;
    }
    .vm-section-header {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .vm-banner-content {
        padding: 24px 16px;
    }
    .vm-section-header {
        align-items: flex-start;
    }
    .vm-section-title {
        flex-basis: 100%;
    }
    .vm-section-nav {
        width: 100%;
        justify-content: flex-end;
    }
    .vm-nav-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
        font-size: 1.05rem !important;
    }
    .vm-card-body {
        padding: 12px 14px;
    }
    .vm-card-title {
        font-size: 0.9rem;
    }
    .vm-spacing-section {
        --vm-spacing-section: 36px;
    }
}

@media (min-width: 1600px) {
    .vm-container {
        max-width: 1560px;
        padding: 0 48px;
    }
    .vm-carousel {
        padding: 0 6px 10px;
    }
}