/* 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 TOP HEADER, FINANACE TITLE & HOME BUTTON COMPLETELY */
#masthead, #site-header, .site-header, .site-main-header-wrap, .site-top-header-wrap,
.site-branding, #mobile-header, .site-title, .main-navigation, .header-navigation,
.entry-hero, .page-hero-section, .entry-header, .page-title, .page-header, .kadence-breadcrumbs, .site-breadcrumb {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Global full-width dark canvas */
html, body, #wrapper, #inner-wrap, #main, #content, #primary,
.site, .site-container, .content-container, .content-wrap, .entry,
.entry-content, .entry-content-wrap, article, .content-bg,
body.content-style-boxed .site, body.content-style-boxed .entry,
.site-main, .site-footer, .site-footer-wrap, .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;
}

.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;
}
