/* =============================================================
   FintechNewsPH — 10 New Features CSS
   1. Enhanced Video News Section
   2. Table of Contents (TOC)
   3. Bookmark / Save Articles
   4. Print Article
   5. Font Size Adjuster
   6. Copy Link to Clipboard
   7. Reading Mode
   8. Floating Social Share Bar
   9. Forex Rates Widget
  10. Reading Time Remaining
   ============================================================= */

/* =========================
   FEATURE 1: VIDEO NEWS SECTION
   ========================= */
.video-news-section { padding: 28px 0; }
.video-news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}
.video-news-card {
    background: #fff;
    border-radius: var(--radius, 10px);
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(15,15,15,0.06);
    transition: transform .25s ease, box-shadow .25s ease;
}
.video-news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(15,15,15,0.1);
}
.video-news-featured {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}
.video-news-featured .video-news-thumb img {
    height: 380px;
}
.video-news-thumb {
    position: relative;
    overflow: hidden;
}
.video-news-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.video-news-card:hover .video-news-thumb img {
    transform: scale(1.04);
}
.video-play-btn,
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0,84,161,0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
    z-index: 2;
}
.video-play-btn:hover {
    background: rgba(0,84,161,1);
    transform: translate(-50%, -50%) scale(1.1);
}
.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
}
.video-file-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}
.video-news-info { padding: 14px; }
.video-news-category a {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue-light, #0066C3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.video-news-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 6px 0 8px;
}
.video-news-title a { color: var(--night-black, #0f0f0f); }
.video-news-title a:hover { color: var(--blue-dark, #0054A1); }
.video-news-meta {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: #888;
}
.video-news-meta i { margin-right: 4px; }

/* Video Lightbox */
.video-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
}
.video-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    z-index: 1;
}
.video-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 2;
}
.video-lightbox-content iframe {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: none;
}

/* =========================
   FEATURE 2: TABLE OF CONTENTS
   ========================= */
.toc-widget {
    background: #f8f9fb;
    border: 1px solid var(--border-color, #e7e7e7);
    border-left: 4px solid var(--blue-dark, #0054A1);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    position: relative;
}
.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.toc-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-dark, #0054A1);
    margin: 0;
}
.toc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background .2s ease;
}
.toc-toggle:hover { background: rgba(0,0,0,0.05); }
.toc-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    max-height: 400px;
    overflow-y: auto;
    transition: max-height .3s ease, opacity .3s ease;
}
.toc-list.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
}
.toc-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.toc-list li:last-child { border-bottom: none; }
.toc-list li.toc-sub { padding-left: 20px; }
.toc-list li.toc-sub a { font-size: 0.9rem; }
.toc-list a {
    color: var(--night-grey, #252C2B);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s ease;
    display: block;
}
.toc-list a:hover,
.toc-list a.toc-active { color: var(--blue-dark, #0054A1); font-weight: 600; }

/* Dark mode */
body.dark-mode .toc-widget { background: #1e1e1e; border-color: #333; }
body.dark-mode .toc-list a { color: #ccc; }
body.dark-mode .toc-list a:hover,
body.dark-mode .toc-list a.toc-active { color: var(--blue-light, #0066C3); }

/* =========================
   FEATURES 3-7: ARTICLE TOOLBAR
   ========================= */
.article-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fb;
    border: 1px solid var(--border-color, #e7e7e7);
    border-radius: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    position: sticky;
    top: 70px;
    z-index: 100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--border-color, #e7e7e7);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--night-grey, #252C2B);
    cursor: pointer;
    transition: all .2s ease;
    font-family: var(--secondary-heading, sans-serif);
    white-space: nowrap;
}
.toolbar-btn:hover {
    border-color: var(--blue-light, #0066C3);
    color: var(--blue-dark, #0054A1);
    background: rgba(0,102,195,0.04);
}
.toolbar-btn .material-symbols-outlined { font-size: 18px; }
.toolbar-label { font-size: 13px; }
.toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--border-color, #e7e7e7);
    border-radius: 8px;
    padding: 2px;
    background: #fff;
}
.toolbar-group .toolbar-btn {
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
}
.font-size-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue-dark, #0054A1);
    min-width: 36px;
    text-align: center;
}
.toolbar-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}
.toolbar-info .material-symbols-outlined { font-size: 18px; color: var(--blue-light, #0066C3); }

/* Bookmark active state */
.toolbar-btn.bookmarked {
    background: var(--blue-dark, #0054A1);
    color: #fff;
    border-color: var(--blue-dark, #0054A1);
}
.toolbar-btn.bookmarked .material-symbols-outlined { color: #fff; }

/* Copy link success feedback */
.toolbar-btn.copied {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.toolbar-btn.copied .material-symbols-outlined { color: #fff; }

/* Dark mode toolbar */
body.dark-mode .article-toolbar { background: #1e1e1e; border-color: #333; }
body.dark-mode .toolbar-btn { background: #2a2a2a; border-color: #444; color: #ccc; }
body.dark-mode .toolbar-btn:hover { border-color: var(--blue-light); color: var(--blue-light); background: rgba(0,102,195,0.1); }
body.dark-mode .toolbar-group { background: #2a2a2a; border-color: #444; }
body.dark-mode .font-size-label { color: var(--blue-light); }

/* =========================
   FEATURE 7: READING MODE
   ========================= */
body.reading-mode {
    background: #fefcf5 !important;
}
body.reading-mode header,
body.reading-mode .breadcrumb-nav,
body.reading-mode .ads_holder,
body.reading-mode .search_section,
body.reading-mode .marquee,
body.reading-mode .sidebar,
body.reading-mode .footer_section,
body.reading-mode #cookie-consent,
body.reading-mode .related_posts,
body.reading-mode .share_socials,
body.reading-mode .floating-share-bar,
body.reading-mode #back-to-top,
body.reading-mode .post_tags,
body.reading-mode .author_box { display: none !important; }

body.reading-mode .single_post_wrapper { max-width: 720px; margin: 40px auto; padding: 0 20px; }
body.reading-mode .content_grid { display: block; }
body.reading-mode .main_content { max-width: 100%; }
body.reading-mode .post_content {
    font-size: 20px;
    line-height: 1.8;
    color: #333;
    font-family: 'Merriweather', Georgia, serif;
}
body.reading-mode .post_content p { font-size: inherit; line-height: inherit; }
body.reading-mode .article-toolbar {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 720px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border-radius: 50px;
    background: rgba(255,255,255,0.95);
}

/* Dark reading mode */
body.dark-mode.reading-mode { background: #1a1a1a !important; }
body.dark-mode.reading-mode .post_content { color: #d0d0d0; }
body.dark-mode.reading-mode .article-toolbar { background: rgba(30,30,30,0.95); }

/* =========================
   FEATURE 4: PRINT STYLES
   ========================= */
@media print {
    header, footer, .sidebar, .ads_holder, .breadcrumb-nav,
    .marquee, .search_section, .article-toolbar, .floating-share-bar,
    .share_socials, .related_posts, .author_box, .post_tags,
    #back-to-top, #cookie-consent, #reading-progress-bar,
    .toc-widget, nav, .comment-respond { display: none !important; }

    body, .single_post_wrapper, .content_grid, .main_content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    .post_content { font-size: 14pt; line-height: 1.6; color: #000; }
    .post_title { font-size: 20pt; }
    .post_featured_image img { max-width: 100%; }
    a::after { content: " (" attr(href) ")"; font-size: 10pt; color: #666; }
    a[href^="#"]::after, a[href^="javascript"]::after { content: ""; }
}

/* =========================
   FEATURE 8: FLOATING SHARE BAR
   ========================= */
.floating-share-bar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 8000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity .3s ease, transform .3s ease;
}
.floating-share-bar a,
.floating-share-bar .share-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    transition: transform .2s ease, box-shadow .2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.floating-share-bar a:hover,
.floating-share-bar .share-toggle:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}
.share-fb { background: #1877F2; }
.share-x { background: #000; }
.share-linkedin { background: #0A66C2; }
.share-threads { background: #000; }
.share-email { background: #EA4335; }
.share-toggle {
    background: var(--blue-dark, #0054A1);
    display: none;
}

/* Hidden state on mobile / small screens */
.floating-share-bar.collapsed a { display: none; }
.floating-share-bar.collapsed .share-toggle { display: flex; }

/* Dark mode */
body.dark-mode .floating-share-bar a { box-shadow: 0 2px 8px rgba(0,0,0,0.4); }

/* =========================
   FEATURE 9: FOREX RATES WIDGET
   ========================= */
.forex-rates-section { padding: 22px 0; }
.forex-rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.forex-card {
    background: #fff;
    border-radius: var(--radius, 10px);
    padding: 16px;
    box-shadow: 0 3px 10px rgba(15,15,15,0.06);
    border: 1px solid var(--border-color, #e7e7e7);
    transition: transform .2s ease, box-shadow .2s ease;
}
.forex-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(15,15,15,0.1);
}
.forex-pair {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue-dark, #0054A1);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.forex-pair .flag-emoji { font-size: 18px; }
.forex-rate {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--night-black, #0f0f0f);
    margin-bottom: 4px;
}
.forex-change {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.forex-change.up { color: #16a34a; }
.forex-change.down { color: #dc2626; }
.forex-change .material-symbols-outlined { font-size: 16px; }
.forex-timestamp {
    font-size: 12px;
    color: #888;
}
.forex-skeleton-inner {
    height: 80px;
    border-radius: 8px;
}

/* Dark mode */
body.dark-mode .forex-card { background: #1e1e1e; border-color: #333; }
body.dark-mode .forex-rate { color: #e0e0e0; }
body.dark-mode .forex-pair { color: var(--blue-light); }

/* =========================
   FEATURE 3: READING LIST PAGE
   ========================= */
.reading-list-section { padding: 30px 0; min-height: 60vh; }
.reading-list-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.reading-list-header h1 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--blue-dark, #0054A1);
}
.reading-list-header p { color: #888; font-size: 14px; margin: 0; }
.reading-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.reading-list-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}
.reading-list-empty h2 { margin: 16px 0 8px; color: #888; }
.reading-list-empty p { color: #aaa; }
.rl-card {
    background: #fff;
    border-radius: var(--radius, 10px);
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(15,15,15,0.06);
    transition: transform .25s ease;
}
.rl-card:hover { transform: translateY(-4px); }
.rl-card-thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.rl-card-info { padding: 14px; }
.rl-card-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-dark, #0054A1);
    margin-bottom: 8px;
}
.rl-card-actions { display: flex; gap: 8px; margin-top: 10px; }
.rl-remove {
    background: none;
    border: 1px solid #dc2626;
    color: #dc2626;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s ease;
}
.rl-remove:hover { background: #dc2626; color: #fff; }

/* Dark mode */
body.dark-mode .reading-list-header h1 { color: var(--blue-light); }
body.dark-mode .rl-card { background: #1e1e1e; }
body.dark-mode .rl-card-info h3 { color: var(--blue-light); }

/* =========================
   RESPONSIVE ADJUSTMENTS
   ========================= */
@media (max-width: 900px) {
    .video-news-grid {
        grid-template-columns: 1fr;
    }
    .video-news-featured {
        grid-column: auto;
        grid-row: auto;
    }
    .video-news-featured .video-news-thumb img {
        height: 240px;
    }
    .floating-share-bar {
        left: auto;
        right: 10px;
        bottom: 80px;
        top: auto;
        transform: none;
    }
    .floating-share-bar a { width: 36px; height: 36px; font-size: 14px; }
    .article-toolbar { flex-wrap: wrap; gap: 6px; }
    .toolbar-label { display: none; }
    .toolbar-info { width: 100%; margin-left: 0; justify-content: center; border-top: 1px solid var(--border-color, #e7e7e7); padding-top: 8px; margin-top: 4px; }
}

@media (max-width: 600px) {
    .forex-rates-grid { grid-template-columns: repeat(2, 1fr); }
    .video-news-thumb img { height: 180px; }
    .video-news-featured .video-news-thumb img { height: 200px; }
    .floating-share-bar a,
    .floating-share-bar .share-toggle { width: 34px; height: 34px; font-size: 13px; }
    .toc-list { max-height: 250px; }
    .article-toolbar { position: relative; top: 0; }
}
