/* Stream Portal Hub Master Styling */
:root {
    --sph-bg: #080c14;
    --sph-surface: #0f172a;
    --sph-surface-light: #1e293b;
    --sph-border: #1e293b;
    --sph-primary: #38bdf8;
    --sph-primary-glow: rgba(56, 189, 248, 0.35);
    --sph-accent: #10b981;
    --sph-accent-glow: rgba(16, 185, 129, 0.35);
    --sph-danger: #ef4444;
    --sph-warning: #f59e0b;
    --sph-text-main: #f3f4f6;
    --sph-text-muted: #94a3b8;
    --sph-radius: 12px;
}

/* 1. MASTER RESET: HIDE PAGE HERO & BREADCRUMBS (HEADER, SITE NAME & MENUS REMAIN FULLY VISIBLE) */
body.sph-portal-active .entry-hero,
body.sph-portal-active .page-hero-section,
body.sph-portal-active .entry-header,
body.sph-portal-active .page-title,
body.sph-portal-active .page-header,
body.sph-portal-active .kadence-breadcrumbs,
body.sph-portal-active .site-breadcrumb {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Ensure Site Title, Logo & Header Navigation Menus are fully visible and readable on Portal */
body.sph-portal-active #masthead,
body.sph-portal-active #site-header,
body.sph-portal-active .site-header,
body.sph-portal-active .site-main-header-wrap,
body.sph-portal-active .site-top-header-wrap,
body.sph-portal-active .site-branding,
body.sph-portal-active #mobile-header {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    background-color: #0b1120 !important;
    border-bottom: 1px solid #1e293b !important;
    position: relative;
    z-index: 1000;
}

body.sph-portal-active .site-title,
body.sph-portal-active .site-title a,
body.sph-portal-active .site-branding a {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #38bdf8 !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    text-decoration: none !important;
}

body.sph-portal-active .main-navigation,
body.sph-portal-active .header-navigation,
body.sph-portal-active .primary-menu-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.sph-portal-active .main-navigation a,
body.sph-portal-active .header-navigation a,
body.sph-portal-active .primary-menu-container a {
    color: #e2e8f0 !important;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

body.sph-portal-active .main-navigation a:hover,
body.sph-portal-active .header-navigation a:hover,
body.sph-portal-active .primary-menu-container a:hover {
    color: #38bdf8 !important;
}

/* Global full-width dark canvas - SCOPED TO ACTIVE PORTAL ONLY */
body.sph-portal-active,
body.sph-portal-active #wrapper,
body.sph-portal-active #inner-wrap,
body.sph-portal-active #main,
body.sph-portal-active #content,
body.sph-portal-active #primary,
body.sph-portal-active .site,
body.sph-portal-active .site-container,
body.sph-portal-active .content-container,
body.sph-portal-active .content-wrap,
body.sph-portal-active .entry,
body.sph-portal-active .entry-content,
body.sph-portal-active .entry-content-wrap,
body.sph-portal-active article,
body.sph-portal-active .content-bg,
body.sph-portal-active.content-style-boxed .site,
body.sph-portal-active.content-style-boxed .entry,
body.sph-portal-active .site-main,
body.sph-portal-active .site-footer,
body.sph-portal-active .site-footer-wrap,
body.sph-portal-active .site-bottom-footer-wrap {
    background-color: #080c14 !important;
    background: #080c14 !important;
    color: #f3f4f6 !important;
    box-shadow: none !important;
    border: none !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.sph-portal-active .content-width-fullwidth .site-container,
body.sph-portal-active .site-container,
body.sph-portal-active .entry-content {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 auto !important;
}

.content-width-fullwidth .site-container, .site-container, .entry-content {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 auto !important;
}

/* 2. Portal Wrapper */
.sph-portal-wrapper {
    max-width: 1380px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--sph-text-main);
    box-sizing: border-box;
}

.sph-portal-wrapper * {
    box-sizing: border-box;
}

/* 3. HTML Ad Containers */
.sph-ad-container {
    margin: 12px 0;
    text-align: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px dashed #334155;
    border-radius: 8px;
    padding: 10px;
    overflow: hidden;
    min-height: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sph-ad-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 5px;
}

.sph-ad-content {
    width: 100%;
}

.sph-ad-placeholder {
    padding: 12px;
    color: #94a3b8;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sph-ad-placeholder small {
    color: #64748b;
    font-size: 11px;
}

/* 4. HOME PAGE: 4 CARDS PER ROW */
.sph-section-header {
    margin-bottom: 20px;
}

.sph-section-header h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: #ffffff;
}

.sph-section-header p {
    margin: 0;
    color: var(--sph-text-muted);
    font-size: 14px;
}

.sph-cards-grid, .sph-cards-grid-4col {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 28px !important;
}

@media (max-width: 1180px) {
    .sph-cards-grid, .sph-cards-grid-4col {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 860px) {
    .sph-cards-grid, .sph-cards-grid-4col {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 540px) {
    .sph-cards-grid, .sph-cards-grid-4col {
        grid-template-columns: 1fr !important;
    }
}

.sph-card {
    background-color: var(--sph-surface);
    border: 1px solid var(--sph-border);
    border-radius: var(--sph-radius);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
}

.sph-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    border-color: #38bdf8;
}

.sph-card-thumb-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    background-color: #0b0f19;
    overflow: hidden;
}

.sph-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.sph-card:hover .sph-card-img {
    transform: scale(1.06);
}

.sph-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 2;
}

.sph-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 20, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 3;
}

.sph-card:hover .sph-thumb-overlay {
    opacity: 1;
}

.sph-overlay-play-btn {
    width: 48px;
    height: 48px;
    background: #38bdf8;
    color: #080c14;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 0 16px #38bdf8;
    transform: scale(0.9);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.sph-overlay-play-btn:hover {
    transform: scale(1.1);
}

.sph-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sph-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #ffffff;
    line-height: 1.35;
}

.sph-card-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--sph-text-muted);
    margin-bottom: 8px;
}

.sph-card-excerpt {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.45;
    margin-bottom: 14px;
    flex: 1;
}

.sph-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.sph-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    min-height: 42px;
}

.sph-btn-download {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.sph-btn-download:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    transform: translateY(-1px);
}

.sph-btn-watch {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.sph-btn-watch:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    transform: translateY(-1px);
}

/* 5. DOWNLOAD PAGE: 4-SIDED AD LAYOUT (TOP, LEFT, THUMBNAIL CENTER, RIGHT, BOTTOM) */
.sph-4sided-ad-wrapper {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sph-4sided-top-ad, .sph-4sided-bottom-ad {
    width: 100%;
}

.sph-4sided-middle-row {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 18px;
    align-items: center;
}

@media (max-width: 980px) {
    .sph-4sided-middle-row {
        grid-template-columns: 1fr;
    }
}

.sph-center-thumb-box {
    background: #0f172a;
    border: 2px solid #38bdf8;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.sph-center-img-wrap {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
    background: #080c14;
}

.sph-center-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sph-download-title {
    font-size: 20px;
    margin: 0 0 8px 0;
    color: #ffffff;
}

.sph-download-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
    color: var(--sph-text-muted);
}

.sph-text-link {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
}

.sph-text-link:hover {
    text-decoration: underline;
}

/* 6. ON-CLICK TIMED POPUP MODAL WITH 4 ADS */
.sph-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 13, 0.92);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: sphFadeIn 0.25s ease;
}

@keyframes sphFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.sph-click-modal-box {
    background: #0f172a;
    border: 2px solid #38bdf8;
    border-radius: 16px;
    max-width: 860px;
    width: 100%;
    padding: 24px 20px;
    position: relative;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.95), 0 0 35px rgba(56, 189, 248, 0.3);
    max-height: 94vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.sph-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: #1e293b;
    color: #f3f4f6;
    border: 1px solid #475569;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100;
}

.sph-modal-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    transform: scale(1.1);
}

.sph-popup-middle-grid {
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    gap: 14px;
    align-items: center;
    margin: 12px 0;
}

@media (max-width: 800px) {
    .sph-popup-middle-grid {
        grid-template-columns: 1fr;
    }
}

.sph-popup-core-timer {
    text-align: center;
    padding: 16px 12px;
    background: #080c14;
    border: 1px solid #1e293b;
    border-radius: 10px;
}

.sph-modal-badge {
    display: inline-block;
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    color: #04070d;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.sph-popup-heading {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: #ffffff;
}

.sph-popup-sub {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 10px 0;
}

.sph-timer-circle-popup {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 10px auto;
}

.sph-popup-sec-num {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 800;
    color: #38bdf8;
}

.sph-svg-timer {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.sph-circle-bg {
    fill: none;
    stroke: #334155;
    stroke-width: 8;
}

.sph-circle-progress {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.sph-popup-progress-track {
    height: 6px;
    background: #1e293b;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px auto;
    max-width: 240px;
}

.sph-popup-progress-bar {
    width: 0%;
    height: 100%;
    background: #10b981;
    transition: width 1s linear;
}

.sph-popup-ad-item {
    background: rgba(15, 23, 42, 0.8);
    border: 1px dashed #334155;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

/* 7. Watch Page Styles */
.sph-watch-container {
    background-color: var(--sph-surface);
    border: 1px solid var(--sph-border);
    border-radius: var(--sph-radius);
    padding: 20px;
}

.sph-watch-header {
    margin-bottom: 16px;
}

.sph-live-tag {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
}

.sph-watch-title {
    font-size: 22px;
    margin: 0;
    color: #ffffff;
}

.sph-player-box {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.sph-responsive-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.sph-responsive-video iframe,
.sph-responsive-video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
}

/* 8. Pagination */
.sph-pagination {
    margin: 24px 0;
    text-align: center;
}

.sph-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    background: var(--sph-surface);
    border: 1px solid var(--sph-border);
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}

.sph-pagination .page-numbers.current {
    background: #38bdf8;
    color: #080c14;
    border-color: #38bdf8;
}

/* 9. IN-GRID CARD ADS (Styled seamlessly like video cards) */
.sph-ad-card {
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    position: relative;
    background: linear-gradient(180deg, #0f172a 0%, #171c2b 100%) !important;
}

.sph-ad-card:hover {
    border-color: #f59e0b !important;
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.25) !important;
}

.sph-ad-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #000 !important;
    font-weight: 900 !important;
    letter-spacing: 0.8px;
}

.sph-ad-play-btn {
    background: #f59e0b !important;
    color: #000 !important;
    box-shadow: 0 0 16px #f59e0b !important;
}

.sph-ad-tag-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.sph-sponsored-pill {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.sph-btn-ad {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #04070d !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
}

.sph-btn-ad:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #000 !important;
    transform: translateY(-1px);
}

.sph-ad-card-custom {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.sph-ad-card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* ========================================================
   UNBLOCKABLE HIGH-CTR PLAY BUTTON OVERLAY (FULL HD)
   ======================================================== */
.sph-video-play-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 12, 20, 0.65);
    backdrop-filter: blur(3px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.25s ease;
}

.sph-video-play-overlay:hover {
    background: rgba(8, 12, 20, 0.45);
}

.sph-play-overlay-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: #ffffff !important;
    padding: 16px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.7), 0 8px 25px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 2;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: sphPulseButton 1.8s infinite;
}

.sph-video-play-overlay:hover .sph-play-overlay-badge {
    transform: scale(1.06);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.9), 0 10px 30px rgba(0, 0, 0, 0.8);
}

.sph-play-overlay-pulse {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.4);
    animation: sphRadar 2s infinite ease-out;
    z-index: 1;
}

@keyframes sphPulseButton {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@keyframes sphRadar {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ========================================================
   MODERNIZED ADMIN GUI TABS
   ======================================================== */
.nav-tab-wrapper.sph-modern-tabs {
    border-bottom: 2px solid #334155 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.nav-tab-wrapper.sph-modern-tabs .nav-tab {
    border-radius: 6px 6px 0 0 !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-tab-wrapper.sph-modern-tabs .nav-tab-active {
    background: #0f172a !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 #38bdf8 #0f172a !important;
}

/* ========================================================
   UNCLICKABLE ADS SHIELD (Impression Loading Enabled, Clicks Protected)
   ======================================================== */
.sph-ad-unclickable {
    position: relative !important;
}

.sph-ad-unclickable iframe,
.sph-ad-unclickable .sph-ad-content a:not(.sph-btn):not(.sph-action-trigger),
.sph-ad-unclickable .sph-native-ad-slot-body a,
.sph-ad-unclickable.sph-ad-card a:not(.sph-btn):not(.sph-action-trigger) {
    pointer-events: none !important;
    cursor: default !important;
}

.sph-ad-shield {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    background: transparent !important;
    cursor: default !important;
    pointer-events: auto !important;
}

/* Card Links & Interaction Safety */
.sph-card-thumb-link {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.sph-card-title-link {
    color: #f1f5f9 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.sph-card-title-link:hover {
    color: #38bdf8 !important;
}

.sph-card-actions,
.sph-card-actions .sph-btn,
.sph-overlay-play-btn,
.sph-card-thumb-link,
.sph-card-title-link,
.sph-center-details .sph-btn,
.sph-fake-idm-btn {
    position: relative !important;
    z-index: 20 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}


