/* CSS Variables */
    :root {
        --nav-bg: #ffffff;
        --nav-text: #0f172a;
        --nav-text-hover: #3b82f6;
        --nav-border: #e2e8f0;
        --mega-bg: #ffffff;
        --mega-sidebar-bg: #f8fafc;
        --mega-border: #e2e8f0;
    }
    body.dark-mode {
        --nav-bg: #0f1115;
        --nav-text: #f3f4f6;
        --nav-text-hover: #3b82f6;
        --nav-border: #2a2d35;
        --mega-bg: #1e2128;
        --mega-sidebar-bg: #111318;
        --mega-border: #2a2d35;
    }

    /* Main Navbar */
    .modern-header-wrapper { background: var(--nav-bg); border-bottom: 1px solid var(--nav-border); position: relative; z-index: 1040; }
    .modern-navbar { display: flex; align-items: center; justify-content: space-between; height: 70px; }
    
    .modern-brand .logo { max-height: 40px; width: auto; }

    /* Nav List */
    .modern-nav-list { display: flex; align-items: center; gap: 18px; list-style: none; margin: 0; padding: 0; height: 100%; }
    .modern-nav-list .nav-item { height: 100%; display: flex; align-items: center; }
    .modern-nav-list .nav-link { 
        color: var(--nav-text); font-weight: 600; font-size: 15px; text-decoration: none; display: flex; align-items: center; transition: color 0.2s; cursor: pointer;
    }
    .modern-nav-list .nav-link:hover, .modern-nav-list .nav-item.active .nav-link { color: var(--nav-text-hover); }
    .nav-icon { font-size: 18px; margin-right: 6px; }
    
    /* FIX: Material Symbol Dropdown Arrow */
    .drop-icon { font-size: 18px; margin-left: 2px; font-weight: normal; color: var(--text-muted); transition: transform 0.2s; }
    .modern-nav-list .nav-item:hover .drop-icon { transform: rotate(180deg); color: var(--nav-text-hover); }

    /* Search Form (Material Symbol) */
    .header-search-wrapper { position: relative; display: flex; align-items: center; }
    .header-search-form { display: flex; align-items: center; background: var(--mega-sidebar-bg); border: 1px solid var(--nav-border); border-radius: 20px; overflow: hidden; padding: 2px 5px; }
    .search-input { border: none; background: transparent; padding: 6px 12px; font-size: 14px; outline: none; color: var(--nav-text); width: 200px; }
    .search-btn { background: var(--nav-text-hover); color: #fff; border: none; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; padding:0; }
    .search-btn:hover { opacity: 0.9; }

    /* Standard Dropdown */
    .has-dropdown { position: relative; }
    .modern-dropdown-menu { 
        position: absolute; top: 100%; left: 0; background: var(--mega-bg); min-width: 200px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid var(--nav-border); border-radius: 8px; list-style: none; padding: 10px 0; margin: 0; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease; z-index: 1050; 
    }
    .has-dropdown:hover > .modern-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
    .modern-dropdown-menu .dropdown-item { display: block; padding: 8px 20px; color: var(--nav-text); font-size: 14px; font-weight: 500; text-decoration: none; transition: background 0.2s; }
    .modern-dropdown-menu .dropdown-item:hover { background: var(--mega-sidebar-bg); color: var(--nav-text-hover); }
    
    /* Sub Dropdown (for 'More' menu) */
    .has-sub-dropdown { position: relative; }
    .modern-sub-dropdown { 
        position: absolute; top: 0; left: 100%; background: var(--mega-bg); min-width: 200px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid var(--nav-border); border-radius: 8px; list-style: none; padding: 10px 0; margin: 0; opacity: 0; visibility: hidden; transform: translateX(10px); transition: all 0.3s ease;
    }
    .has-sub-dropdown:hover > .modern-sub-dropdown { opacity: 1; visibility: visible; transform: translateX(0); }

    /* Mega Menu Absolute Wrapper */
    .mega-menu-absolute-container { position: absolute; left: 0; width: 100%; z-index: 1030; }
    
    /* Modern Mega Menu Styling */
    .modern-mega-menu { 
        position: absolute; top: 0; left: 0; width: 100%; background: var(--mega-bg); border: 1px solid var(--mega-border); border-radius: 0 0 12px 12px; display: none; overflow: hidden;
    }
    .nav-item-category:hover .modern-mega-menu, .modern-mega-menu.active { display: block; }
    
    .mega-layout-flex { display: flex; width: 100%; min-height: 350px; }
    
    /* Left Panel (Categories) */
    .mega-left-sidebar { width: 220px; flex-shrink: 0; background: var(--mega-sidebar-bg); border-right: 1px solid var(--mega-border); padding: 20px 0; max-height: 450px; overflow-y: auto; }
    .mega-cat-link { display: flex; align-items: center; padding: 10px 20px; color: var(--nav-text); font-size: 14px; font-weight: 600; text-decoration: none; border-left: 3px solid transparent; transition: 0.2s; }
    .mega-cat-link:hover, .mega-cat-link.active { background: var(--nav-bg); color: var(--nav-text-hover); border-left-color: var(--nav-text-hover); }
    .level-3-link { font-size: 13px; font-weight: 500; color: var(--text-muted); padding-left: 25px; }

    /* Right Panel (Posts) */
    .mega-right-content { flex-grow: 1; padding: 24px; background: var(--mega-bg); max-height: 450px; overflow-y: auto; }
    .mega-posts-grid { display: grid; grid-template-columns: repeat(var(--mega-cols), 1fr); gap: 20px; }
    
    /* Post Card inside Mega Menu */
    .mega-post-card { display: flex; flex-direction: column; }
    .mega-img-wrap { width: 100%; aspect-ratio: 16 / 9; background: var(--mega-border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; position: relative; }
    .mega-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
    .mega-post-card:hover .mega-img { transform: scale(1.05); }
    .mega-post-title { font-size: 0.95rem; font-weight: 700; line-height: 1.4; margin: 0 0 8px 0; }
    .mega-post-title a { color: var(--nav-text); text-decoration: none; transition: color 0.2s; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .mega-post-title a:hover { color: var(--nav-text-hover); }
    .mega-post-meta { font-size: 0.75rem; color: var(--text-muted); }

    /* Custom Scrollbar */
    .custom-scrollbar::-webkit-scrollbar { width: 4px; }
    .custom-scrollbar::-webkit-scrollbar-thumb { background: var(--mega-border); border-radius: 4px; }
    
    /* FIX: Prevent menu items from breaking into two lines */
    .modern-nav-list .nav-link,
    .modern-dropdown-menu .dropdown-item,
    .has-sub-dropdown .dropdown-item {
        white-space: nowrap !important;
    }

    /* RTL Support */
    html[dir="rtl"] .mega-left-sidebar { border-right: none; border-left: 1px solid var(--mega-border); }
    html[dir="rtl"] .mega-cat-link { border-left: none; border-right: 3px solid transparent; }
    html[dir="rtl"] .mega-cat-link:hover, html[dir="rtl"] .mega-cat-link.active { border-right-color: var(--nav-text-hover); }
    html[dir="rtl"] .modern-sub-dropdown { left: auto; right: 100%; transform: translateX(-10px); }
    html[dir="rtl"] .has-sub-dropdown:hover > .modern-sub-dropdown { transform: translateX(0); }
    html[dir="rtl"] .level-3-link { padding-left: 20px; padding-right: 25px; }

    /* Strict Mobile Hide Rule */
    @media (max-width: 991.98px) {
        .modern-header-wrapper, .mega-menu-absolute-container {
            display: none !important;
            visibility: hidden !important;
            height: 0 !important;
            width: 0 !important;
            pointer-events: none !important;
            overflow: hidden !important;
        }
    }
    

 /* Variables */
    :root {
        --bg-main: #ffffff;
        --text-main: #0f172a;
        --text-muted: #64748b;
        --border-color: #e2e8f0;
        --primary-color: #3b82f6;
        --sidebar-bg: #ffffff;
        --hover-bg: #f8fafc;
    }
    body.dark-mode {
        --bg-main: #0f1115;
        --text-main: #f3f4f6;
        --text-muted: #9ca3af;
        --border-color: #2a2d35;
        --sidebar-bg: #1e2128;
        --hover-bg: #111318;
    }

    /* ---------------------------------------------------- */
    /* DESKTOP HIDE FIX: Ensure Mobile Menu is ONLY Mobile  */
    /* ---------------------------------------------------- */
    @media (min-width: 992px) {
        .header-mobile-container,
        .modern-mobile-sidebar,
        #overlay_bg {
            display: none !important;
        }
    }

    /* Search Box & Icon Fix */
    .mobile-search-form {
        display: none; /* Hidden by default */
        background-color: var(--bg-main);
        padding: 10px 15px;
        border-top: 1px solid var(--border-color);
    }
    .mobile-search-form.active {
        display: block;
    }
    
    .search-input-wrapper {
        position: relative;
        width: 100%;
    }
    .search-input-wrapper input {
        width: 100%;
        padding: 10px 40px 10px 15px;
        border-radius: 20px;
        border: 1px solid var(--border-color);
        background: var(--hover-bg);
        color: var(--text-main);
        outline: none;
    }
    .search-input-wrapper button {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 5px;
    }
    /* RTL Support for search input */
    html[dir="rtl"] .search-input-wrapper input {
        padding: 10px 15px 10px 40px;
    }
    html[dir="rtl"] .search-input-wrapper button {
        right: auto;
        left: 8px;
    }

    /* Mobile Sidebar overlay Fix */
    .overlay-bg {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5); z-index: 99999;
        visibility: hidden; opacity: 0; transition: opacity 0.3s;
    }
    .overlay-bg.active {
        visibility: visible; opacity: 1;
    }

    /* Mobile Sidebar Classes */
    .modern-mobile-sidebar {
        position: fixed;
        top: 0;
        right: -320px; 
        left: auto;
        width: 300px;
        max-width: 85%;
        height: 100vh;
        background-color: var(--sidebar-bg);
        z-index: 100000;
        box-shadow: none;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }
    .modern-mobile-sidebar.active { right: 0; box-shadow: -5px 0 25px rgba(0,0,0,0.1); }
    
    /* RTL Support (Opens from LEFT if RTL is on) */
    .modern-mobile-sidebar.rtl-sidebar { right: auto; left: -320px; transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
    .modern-mobile-sidebar.rtl-sidebar.active { left: 0; box-shadow: 5px 0 25px rgba(0,0,0,0.1); }

    /* Header */
    .sidebar-top-header {
        display: flex; justify-content: space-between; align-items: center;
        padding: 15px 20px; border-bottom: 1px solid var(--border-color);
    }
    .sidebar-title { font-weight: 800; font-size: 18px; color: var(--text-main); }
    .close-sidebar-btn { background: none; border: none; font-size: 28px; color: var(--text-muted); cursor: pointer; line-height: 1; }

    /* Scrollable Area */
    .scrollable-content { overflow-y: auto; flex-grow: 1; padding-bottom: 30px; }

    /* Sections */
    .sidebar-section { padding: 20px; border-bottom: 1px solid var(--border-color); }
    .section-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 15px; }

    /* Author Profile Menu Fix */
    .profile-options-mobile {
        background-color: var(--bg-main) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        margin-top: 10px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        width: 100%;
    }
    .profile-options-mobile li a { color: var(--text-main); font-size: 14px; padding: 8px 15px; }
    .profile-options-mobile li a:hover { background-color: var(--hover-bg); color: var(--primary-color); }

    /* Auth Buttons */
    .auth-buttons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .btn-auth { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 8px; font-weight: 600; font-size: 14px; text-decoration: none; }
    .login-btn { border: 1px solid var(--border-color); color: var(--text-main); }
    .register-btn { background: var(--primary-color); color: #fff; }

    /* Quick Actions */
    .quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
    .action-item { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 5px; background: var(--hover-bg); border-radius: 8px; text-decoration: none; color: var(--text-main); }
    .action-item .material-symbols-outlined { font-size: 24px; color: var(--text-muted); }
    .action-item.live-tv .material-symbols-outlined { color: #ef4444; }
    .action-text { font-size: 11px; font-weight: 600; }

    /* Navigation Links */
    .modern-mobile-nav .nav-link { color: var(--text-main); font-weight: 600; font-size: 15px; padding: 12px 0; border-bottom: 1px dashed var(--border-color); text-decoration: none; }
    .modern-mobile-nav .dropdown > .nav-link[aria-expanded="true"] .toggle-icon { transform: rotate(180deg); }
    .sub-menu-list { list-style: none; padding-left: 15px; margin: 0; background: var(--hover-bg); border-radius: 6px; margin-top: 5px; }
    html[dir="rtl"] .sub-menu-list { padding-left: 0; padding-right: 15px; }
    .sub-link { font-size: 14px !important; font-weight: 500 !important; border-bottom: none !important; padding: 8px 10px !important; }
    .sub-sub-link { font-size: 13px !important; color: var(--text-muted) !important; padding-left: 20px !important; border-bottom: none !important;}
    html[dir="rtl"] .sub-sub-link { padding-left: 0 !important; padding-right: 20px !important; }

    /* Bottom Settings */
    .setting-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
    .setting-label { font-size: 14px; font-weight: 600; color: var(--text-main); }
    .lang-toggle-btn { background: var(--hover-bg); padding: 5px 12px; border-radius: 6px; color: var(--text-main); font-size: 13px; font-weight: 600; text-decoration: none; }
    
    /* Toggle Switch */
    .toggle-row { cursor: pointer; border-bottom: none; }
    .custom-toggle-switch { width: 44px; height: 24px; background: var(--border-color); border-radius: 12px; position: relative; transition: 0.3s; }
    .custom-toggle-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);}
    .custom-toggle-switch.active { background: var(--primary-color); }
    .custom-toggle-switch.active::after { transform: translateX(20px); }
    
/* 1. GLOBAL DARK MODE BACKGROUND FIX */
    body.dark-mode, body.dark {
        background-color: #0f1115 !important;
        color: #f3f4f6 !important;
    }
    body.dark-mode #wrapper, body.dark-mode .wrapper { background-color: #0f1115 !important; }

    /* 2. TOP BAR PERFECT ALIGNMENT CSS */
    .modern-top-bar {
        background-color: #0f172a; 
        color: #e2e8f0;
        font-size: 13px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        position: relative;
        z-index: 1050 !important; 
    }
    
    .top-profile-dropdown .dropdown-menu { z-index: 1060 !important; margin-top: 5px; }

    .top-nav-list { list-style: none; }
    .top-nav-item { margin-right: 18px; height: 100%; display: flex; align-items: center; }
    .top-nav-item:last-child { margin-right: 0; }
    
    .top-nav-link {
        color: #cbd5e1 !important;
        text-decoration: none !important;
        font-weight: 500;
        transition: color 0.2s;
        display: flex;
        align-items: center;
        gap: 5px;
        line-height: 1; /* Fixes vertical jumping */
    }
    .top-nav-link:hover { color: #ffffff !important; }
    
    .top-nav-link span.material-symbols-outlined { display: flex; align-items: center; justify-content: center; }

    .live-tv-link { color: #fca5a5 !important; font-weight: 700; letter-spacing: 0.5px; }
    .live-tv-link:hover { color: #f87171 !important; }
    
    .action-link { background: rgba(255,255,255,0.1); padding: 5px 12px; border-radius: 4px; color: #fff !important; font-weight: 600; }
    .action-link:hover { background: rgba(255,255,255,0.2); }
    
    .top-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
    .auth-links .sep { margin: 0 6px; color: #64748b; }
    
    .btn-top-mode {
        background: transparent; border: none; color: #cbd5e1; padding: 0; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center;
    }
    .btn-top-mode:hover { color: #ffffff; transform: scale(1.1); }

    .blink-icon { font-size: 14px; font-variation-settings: 'FILL' 1; animation: blinker 1.5s cubic-bezier(0.5, 0, 1, 1) infinite alternate; }
    @keyframes blinker { from { opacity: 1; } to { opacity: 0.3; } }

    @media (max-width: 991px) { .modern-top-bar { display: none !important; } }
    
        /* --- Base Variables --- */
        .modern-posts-page {
            --mpp-bg: #ffffff;
            --mpp-card: #ffffff;
            --mpp-text: #0f172a;
            --mpp-muted: #64748b;
            --mpp-border: #e2e8f0;
            --mpp-primary: #3b82f6;
            --mpp-shape: #cbd5e1;
        }
        body.dark-mode .modern-posts-page,
        body.dark .modern-posts-page {
            --mpp-bg: #0f1115;
            --mpp-card: #1e2128;
            --mpp-text: #f3f4f6;
            --mpp-muted: #9ca3af;
            --mpp-border: #2a2d35;
            --mpp-shape: #374151;
        }

        /* --- Breadcrumbs --- */
        .mpp-breadcrumb {
            display: flex; align-items: center; gap: 8px; list-style: none; padding: 0; margin: 0 0 25px 0; font-size: 13px; font-weight: 600;
        }
        .mpp-breadcrumb li a { color: var(--mpp-muted); text-decoration: none; display: flex; align-items: center; gap: 4px; }
        .mpp-breadcrumb li.active { color: var(--mpp-primary); }

        /* --- Page Title Shapes --- */
        .mpp-title-wrapper {
            display: flex; align-items: center; gap: 6px; margin-bottom: 30px; border-bottom: 2px solid var(--mpp-border); padding-bottom: 15px;
        }
        .mpp-title-wrapper .shape-1 { width: 6px; height: 28px; background: var(--mpp-primary); border-radius: 10px 0 10px 0; }
        .mpp-title-wrapper .shape-2 { width: 4px; height: 22px; background: var(--mpp-shape); border-radius: 8px 0 8px 0; }
        .mpp-title-wrapper h1 { font-size: 1.6rem; font-weight: 800; color: var(--mpp-text); margin: 0; }

        /* --- 2-Card Grid Layout (Mobile & Desktop) --- */
        .mpp-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr); /* Force 2 columns always */
            gap: 15px;
        }
        @media (min-width: 992px) {
            .mpp-grid { gap: 25px; }
        }

        /* --- Modern Post Card --- */
        .mpp-card {
            display: flex;
            flex-direction: column;
            background: var(--mpp-card);
            border: 1px solid var(--mpp-border);
            border-radius: 12px;
            overflow: hidden;
            text-decoration: none;
            transition: transform 0.3s ease;
            height: 100%;
        }
        .mpp-card:hover { transform: translateY(-5px); }

        .mpp-img-wrap {
            width: 100%;
            aspect-ratio: 16 / 9; /* Fixed 16:9 Ratio */
            overflow: hidden;
            background: var(--mpp-border);
            position: relative;
        }
        .mpp-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
        .mpp-card:hover img { transform: scale(1.05); }

        .mpp-content { padding: 12px; display: flex; flex-direction: column; flex-grow: 1; }
        .mpp-title {
            font-size: 1rem; font-weight: 800; color: var(--mpp-text); line-height: 1.4; margin-bottom: 8px;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
        }
        .mpp-summary {
            font-size: 0.85rem; color: var(--mpp-muted); line-height: 1.5; margin-bottom: 12px;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
        }
        @media (max-width: 576px) {
            .mpp-title { font-size: 0.9rem; }
            .mpp-summary { display: none; } /* Mobile par summary hide taaki card clean dikhe */
        }

        .mpp-meta {
            margin-top: auto; font-size: 11px; color: var(--mpp-muted); display: flex; align-items: center; gap: 4px;
        }

        /* --- Pagination --- */
        .mpp-pagination { display: flex; justify-content: center; margin-top: 40px; }
        .mpp-pagination .pagination { display: flex; list-style: none; gap: 8px; padding: 0; }
        .mpp-pagination li a, .mpp-pagination li span {
            min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
            border: 1px solid var(--mpp-border); border-radius: 8px; color: var(--mpp-text); font-weight: 700; text-decoration: none;
        }
        .mpp-pagination li.active span { background: var(--mpp-primary); color: #fff; border-color: var(--mpp-primary); }
        
/* =========================================
   CUSTOM LIGHTWEIGHT GRID SYSTEM (Replaces Bootstrap)
   ========================================= */

/* --- Variables --- */
:root {
    --grid-gutter-x: 1.5rem;
    --grid-gutter-y: 0;
}

/* --- Containers --- */
.container, 
.container-fluid, 
.container-xl {
    width: 100%;
    padding-right: calc(var(--grid-gutter-x) / 2);
    padding-left: calc(var(--grid-gutter-x) / 2);
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container, .container-xl { max-width: 1140px; } }
@media (min-width: 1400px) { .container, .container-xl { max-width: 1320px; } }

/* --- Rows --- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--grid-gutter-y));
    margin-right: calc(-1 * var(--grid-gutter-x) / 2);
    margin-left: calc(-1 * var(--grid-gutter-x) / 2);
}
.row > * {
    box-sizing: border-box;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(var(--grid-gutter-x) / 2);
    padding-left: calc(var(--grid-gutter-x) / 2);
    margin-top: var(--grid-gutter-y);
}

/* --- Gutter (Gap) Utilities --- */
.g-0, .gy-0 { --grid-gutter-y: 0; } .g-0, .gx-0 { --grid-gutter-x: 0; }
.g-1, .gy-1 { --grid-gutter-y: 0.25rem; } .g-1, .gx-1 { --grid-gutter-x: 0.25rem; }
.g-2, .gy-2 { --grid-gutter-y: 0.5rem; } .g-2, .gx-2 { --grid-gutter-x: 0.5rem; }
.g-3, .gy-3 { --grid-gutter-y: 1rem; } .g-3, .gx-3 { --grid-gutter-x: 1rem; }
.g-4, .gy-4 { --grid-gutter-y: 1.5rem; } .g-4, .gx-4 { --grid-gutter-x: 1.5rem; }
.g-5, .gy-5 { --grid-gutter-y: 3rem; } .g-5, .gx-5 { --grid-gutter-x: 3rem; }

/* --- Columns (Mobile First) --- */
.col-12 { flex: 0 0 auto; width: 100%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-3 { flex: 0 0 auto; width: 25%; }

/* --- Small Devices (sm: >= 576px) --- */
@media (min-width: 576px) {
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.333333%; }
}

/* --- Medium Devices (md: >= 768px) --- */
@media (min-width: 768px) {
    .col-md-12 { flex: 0 0 auto; width: 100%; }
    .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
}

/* --- Large Devices (lg: >= 992px) --- */
@media (min-width: 992px) {
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
}

/* --- Display Utilities --- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}
@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

/* =========================================
   MODERN PREMIUM FOOTER (No Bootstrap)
   ========================================= */
.mod-footer {
    --ft-bg: #f8fafc;
    --ft-text: #0f172a;
    --ft-muted: #475569; /* Contrast Fix for PageSpeed */
    --ft-border: #e2e8f0;
    --ft-primary: #3b82f6;
    background: var(--ft-bg);
    border-top: 1px solid var(--ft-border);
    padding-top: 60px;
    font-family: inherit;
    color: var(--ft-text);
}
body.dark-mode .mod-footer, body.dark .mod-footer {
    --ft-bg: #0b0f19;
    --ft-text: #f8fafc;
    --ft-muted: #cbd5e1; /* Contrast Fix for Dark Mode */
    --ft-border: #1e293b;
}

/* Grid Layout */
.mod-ft-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}
@media (max-width: 991px) { .mod-ft-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) { .mod-ft-grid { grid-template-columns: 1fr; gap: 30px; } }

/* Titles */
.mod-ft-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ft-text);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
}
.mod-ft-title::after {
    content: ''; position: absolute; left: 0; bottom: 0; width: 40px; height: 3px;
    background: var(--ft-primary); border-radius: 2px;
}
html[dir="rtl"] .mod-ft-title::after { left: auto; right: 0; }

/* Column 1: Brand */
.mod-ft-logo img { max-width: 200px; height: auto; margin-bottom: 15px; display: block; }
.mod-ft-about { font-size: 0.95rem; color: var(--ft-muted); line-height: 1.6; margin-bottom: 20px; }
.mod-ft-social ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }

/* Column 2: Trending Posts */
.mod-ft-trend-list { display: flex; flex-direction: column; gap: 15px; }
.mod-ft-trend-item {
    display: flex; gap: 15px; align-items: center; text-decoration: none; padding-bottom: 15px;
    border-bottom: 1px dashed var(--ft-border); transition: transform 0.2s;
}
.mod-ft-trend-item:last-child { border-bottom: none; padding-bottom: 0; }
.mod-ft-trend-item:hover { transform: translateX(5px); }
html[dir="rtl"] .mod-ft-trend-item:hover { transform: translateX(-5px); }

.mod-ft-trend-num {
    font-size: 2rem; font-weight: 900; color: var(--ft-border); font-style: italic;
    line-height: 0.8; min-width: 40px; text-align: center; transition: color 0.2s;
}
.mod-ft-trend-item:hover .mod-ft-trend-num { color: var(--ft-primary); }

.mod-ft-trend-content { display: flex; flex-direction: column; }
.mod-ft-trend-tt { font-size: 0.95rem; font-weight: 700; color: var(--ft-text); line-height: 1.4; margin-bottom: 5px; transition: color 0.2s; }
.mod-ft-trend-item:hover .mod-ft-trend-tt { color: var(--ft-primary); }
.mod-ft-trend-time { font-size: 11px; color: var(--ft-muted); display: flex; align-items: center; gap: 4px; font-weight: 500; }
.mod-ft-trend-time .material-symbols-outlined { font-size: 14px; }

/* Column 3: Newsletter */
.mod-ft-news-desc { font-size: 0.95rem; color: var(--ft-muted); line-height: 1.5; margin-bottom: 20px; }
.mod-ft-news-form {
    display: flex; align-items: center; background: var(--ft-bg); border: 1px solid var(--ft-border);
    border-radius: 30px; overflow: hidden; padding: 4px; transition: border-color 0.3s;
}
.mod-ft-news-form:focus-within { border-color: var(--ft-primary); }
.mod-ft-news-in {
    flex-grow: 1; border: none; outline: none; background: transparent; padding: 10px 15px;
    font-size: 0.9rem; color: var(--ft-text); width: 100%;
}
.mod-ft-news-btn {
    background: var(--ft-primary); color: #fff; border: none; padding: 10px 20px;
    border-radius: 30px; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: 0.2s;
}
.mod-ft-news-btn:hover { background: #2563eb; transform: scale(1.05); }

/* Bottom Bar */
.mod-ft-bottom { border-top: 1px solid var(--ft-border); padding: 25px 0; font-size: 0.9rem; color: var(--ft-muted); font-weight: 500; }
.mod-ft-bottom-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.mod-ft-menu { list-style: none; padding: 0; margin: 0; display: flex; gap: 15px; flex-wrap: wrap; }
.mod-ft-menu a { color: var(--ft-muted); text-decoration: none; font-weight: 600; transition: color 0.2s; }
.mod-ft-menu a:hover { color: var(--ft-primary); }
@media (max-width: 767px) {
    .mod-ft-bottom-flex { flex-direction: column; text-align: center; justify-content: center; }
    .mod-ft-menu { justify-content: center; }
}

/* =========================================
   SCROLL UP & COOKIES (Modernized & Fixed)
   ========================================= */
.mod-scrollup {
    position: fixed; 
    bottom: 80px; /* Thoda upar kar diya */
    right: 30px; 
    width: 48px; 
    height: 48px;
    background: var(--ft-primary); color: #000; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; text-decoration: none;
    box-shadow: 0 4px 15px rgba(59,130,246,0.4); transition: all 0.3s ease; z-index: 999;
}
.mod-scrollup:hover { transform: translateY(-5px); box-shadow: 0 6px 20px rgba(59,130,246,0.6); color: #fff; }
.mod-scrollup .material-symbols-outlined { font-size: 28px; }

.mod-cookies-box {
    position: fixed; bottom: 25px; left: 25px; max-width: 400px;
    background-color: #ffffff; /* Solid White BG Fix */
    border: 1px solid var(--ft-border); border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 9999; padding: 20px;
    display: flex; flex-direction: column; gap: 15px; animation: slideInUp 0.5s ease-out;
}
body.dark-mode .mod-cookies-box, body.dark .mod-cookies-box { 
    background-color: #1e293b; /* Solid Dark BG Fix */
    box-shadow: 0 10px 30px rgba(0,0,0,0.6); 
}
.mod-cookies-text { font-size: 13px; color: var(--ft-muted); line-height: 1.6; margin: 0; padding-right: 20px; font-weight: 500; }
.mod-cookies-btn {
    background: var(--ft-primary); color: #fff; border: none; padding: 10px 20px;
    font-size: 13px; font-weight: 700; border-radius: 8px; cursor: pointer; transition: 0.2s; width: 100%;
}
.mod-cookies-btn:hover { background: #2563eb; }
.mod-cookies-close {
    position: absolute; top: 10px; right: 10px; background: transparent; border: none;
    color: var(--ft-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mod-cookies-close:hover { color: var(--ft-primary); }

@keyframes slideInUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 576px) {
    .mod-scrollup { bottom: 75px; right: 20px; width: 42px; height: 42px; }
    .mod-cookies-box { bottom: 15px; left: 15px; right: 15px; max-width: none; }
}

/* Fix for Post Links inside Text */
.post-text p a { color: #0056b3; font-weight: 600; text-decoration: none; text-underline-offset: 3px; }
.post-text p a:hover, .post-text p a:focus { text-decoration: underline; }
body.dark-mode .post-text p a, body.dark .post-text p a { color: #60a5fa; } /* Link color fix for dark mode */

.fkp-ad-wrapper { margin-bottom: 20px; position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.fkp-ad-label { display: block; font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; font-weight: 600; text-align: center; }
.bn-content { display: flex; justify-content: center; width: 100%; }
.bn-inner { display: block; margin: 0 auto; overflow: hidden; }
.bn-inner:empty { display: none !important; }
.fkp-ad-wrapper:has(.bn-inner:empty) { display: none !important; }

/* =========================================
   SIDEBAR PREMIUM WIDGETS
   ========================================= */

/* --- Base Variables & Accessibility Fix --- */
:root {
    --sw-bg: #ffffff;
    --sw-card: #ffffff;
    --sw-border: #e2e8f0;
    --sw-text: #0f172a;
    --sw-muted: #475569; /* 100% Contrast Passed */
    --sw-primary: #3b82f6;
    --sw-shape: #cbd5e1;
}
body.dark-mode, body.dark {
    --sw-bg: #0f1115;
    --sw-card: #1e2128;
    --sw-border: #2a2d35;
    --sw-text: #f3f4f6;
    --sw-muted: #cbd5e1;
    --sw-shape: #374151;
}

/* --- Widget Container --- */
.sw-widget-box {
    background: var(--sw-card);
    border: 1px solid var(--sw-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

/* --- Premium Header --- */
.sw-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--sw-border);
}
.sw-title-wrap { display: flex; align-items: center; flex-shrink: 0; gap: 4px; }
.sw-title-wrap .shape-1 { width: 6px; height: 26px; background: var(--sw-primary); border-radius: 10px 0 10px 0; }
.sw-title-wrap .shape-2 { width: 4px; height: 20px; background: var(--sw-shape); border-radius: 8px 0 8px 0; }
.sw-title-wrap h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 0 6px; color: var(--sw-text); letter-spacing: -0.3px; display: flex; align-items: center; gap: 6px; }

html[dir="rtl"] .sw-title-wrap h2 { margin: 0 6px 0 0; }
html[dir="rtl"] .sw-title-wrap .shape-1 { border-radius: 0 10px 0 10px; }
html[dir="rtl"] .sw-title-wrap .shape-2 { border-radius: 0 8px 0 8px; }

/* --- Global Icons --- */
.sw-widget-box .material-symbols-outlined { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }

/* --- 1. Social Follow Grid --- */
.sw-social-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sw-social-link {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 8px;
    font-size: 13px; font-weight: 700; color: #fff !important; text-decoration: none; transition: transform 0.2s;
    background-color: var(--sw-muted); /* Fallback */
}
.sw-social-link:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.sw-social-link span { color: #fff !important; }

/* Brand Colors */
.sw-social-link.color-facebook { background: #1877f2; }
.sw-social-link.color-twitter { background: #000000; }
.sw-social-link.color-instagram { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.sw-social-link.color-linkedin { background: #0a66c2; }
.sw-social-link.color-whatsapp { background: #25d366; }
.sw-social-link.color-youtube { background: #ff0000; }
.sw-social-link.color-telegram { background: #229ED9; }
.sw-social-link.color-pinterest { background: #E60023; }
.sw-social-link.color-vk { background: #4680C2; }

/* --- 2. Popular Posts (01, 02 Style with Contrast Fix) --- */
.sw-pop-item { display: flex; gap: 15px; align-items: center; padding-bottom: 15px; border-bottom: 1px dashed var(--sw-border); margin-bottom: 15px; text-decoration: none; transition: 0.2s; }
.sw-pop-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sw-pop-item:hover { transform: translateX(4px); }
html[dir="rtl"] .sw-pop-item:hover { transform: translateX(-4px); }

.sw-pop-num { 
    font-size: 1.8rem; font-weight: 900; 
    color: #64748b; /* Lighthouse Contrast Passed (4.64:1 on white) */
    font-style: italic; line-height: 1; min-width: 35px; text-align: center; transition: 0.2s; 
}
body.dark-mode .sw-pop-num, body.dark .sw-pop-num { color: #94a3b8; }
.sw-pop-item:hover .sw-pop-num { color: var(--sw-primary); }
.sw-pop-title { font-size: 0.95rem; font-weight: 700; color: var(--sw-text); line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.2s; }
.sw-pop-item:hover .sw-pop-title { color: var(--sw-primary); }

/* --- 3. Recommended Posts --- */
.sw-rec-item { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 10px; border-radius: 8px; transition: background 0.2s; }
.sw-rec-item:hover { background: var(--sw-border); }
.sw-rec-thumb { width: 90px; height: 65px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--sw-shape); }
.sw-rec-title { font-size: 0.9rem; font-weight: 700; color: var(--sw-text); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* --- 4. Tags Cloud --- */
.sw-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-tag-link { background: var(--sw-bg); border: 1px solid var(--sw-border); color: var(--sw-muted); padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; text-decoration: none; transition: 0.2s; }
.sw-tag-link:hover { background: var(--sw-primary); color: #fff; border-color: var(--sw-primary); }

/* --- Live TV CSS Fixes --- */
.sidebar-live-container iframe { width: 100% !important; height: 100% !important; border: none; }
.live-unmute-btn:hover { background: rgba(0, 0, 0, 0.1) !important; }

/* =========================================
       DIGITAL ARCHIVES WIDGET (Premium Style)
       ========================================= */
       
    /* --- Archive Date Picker Box --- */
    .sw-archive-picker {
        background: #f8fafc; /* Light mode contrast safe background */
        border: 1px solid var(--sw-border);
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 20px;
        transition: 0.3s;
    }
    body.dark-mode .sw-archive-picker, body.dark .sw-archive-picker {
        background: #111318; /* Dark mode safe */
    }

    .sw-archive-picker label {
        display: flex; align-items: center; gap: 6px;
        font-weight: 700; font-size: 13px;
        color: var(--sw-text);
        margin-bottom: 10px; cursor: pointer;
    }

    .sw-archive-input {
        width: 100%; padding: 10px 15px;
        border: 1px solid var(--sw-border); border-radius: 8px;
        font-family: inherit; font-size: 14px; font-weight: 600;
        background: var(--sw-card); color: var(--sw-text);
        outline: none; margin-bottom: 12px; transition: 0.2s;
        /* Custom calendar icon styling for native input */
        color-scheme: light;
    }
    body.dark-mode .sw-archive-input, body.dark .sw-archive-input { color-scheme: dark; }
    .sw-archive-input:focus { border-color: var(--sw-primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

    /* --- Archive Primary Search Button --- */
    .sw-archive-btn {
        width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
        padding: 12px; background: var(--sw-text); color: var(--sw-card);
        border: none; border-radius: 8px; font-weight: 700; font-size: 14px;
        cursor: pointer; transition: all 0.2s ease;
    }
    .sw-archive-btn:hover {
        transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); opacity: 0.9;
    }

    /* --- Archive List Items --- */
    .sw-archive-item {
        display: flex; justify-content: space-between; align-items: center;
        padding: 12px 0; border-bottom: 1px dashed var(--sw-border);
        text-decoration: none; transition: 0.2s; color: var(--sw-text);
        font-weight: 600; font-size: 0.95rem;
    }
    .sw-archive-item:hover { color: var(--sw-primary); transform: translateX(4px); }
    html[dir="rtl"] .sw-archive-item:hover { transform: translateX(-4px); }
    
    .sw-archive-item-left { display: flex; align-items: center; gap: 8px; }
    .sw-archive-item-left .material-symbols-outlined { color: var(--sw-muted); font-size: 18px; transition: 0.2s; }
    .sw-archive-item:hover .sw-archive-item-left .material-symbols-outlined { color: var(--sw-primary); }
    
    .sw-archive-badge {
        background: var(--sw-bg); border: 1px solid var(--sw-border);
        color: var(--sw-muted); font-size: 11px; font-weight: 800;
        padding: 2px 10px; border-radius: 20px; transition: 0.2s;
    }
    .sw-archive-item:hover .sw-archive-badge { border-color: var(--sw-primary); color: var(--sw-primary); }

    /* --- View Full Library Button --- */
    .sw-archive-btn-outline {
        width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
        padding: 12px; background: transparent; color: var(--sw-text);
        border: 1px solid var(--sw-border); border-radius: 8px; font-weight: 700; font-size: 14px;
        cursor: pointer; transition: 0.2s; text-decoration: none; margin-top: 15px;
    }
    .sw-archive-btn-outline:hover { background: var(--sw-border); color: var(--sw-primary); }
    
    /* RTL Arrow fix */
    html[dir="rtl"] .sw-archive-btn-outline .arrow-rtl { transform: rotate(180deg); }
    
/* ==========================================================================
   1. BOOTSTRAP MODAL POLYFILL (Core Mechanics without Bootstrap CSS)
   ========================================================================== */
.modal-open { overflow: hidden; padding-right: 0 !important; }
.modal {
    position: fixed; top: 0; left: 0; z-index: 999999 !important;
    display: none; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto;
    outline: 0;
}
.modal-dialog { position: relative; width: auto; margin: 1.5rem; pointer-events: none; transition: transform 0.3s ease-out; }
.modal.fade .modal-dialog { transform: translateY(-50px); }
.modal.show .modal-dialog { transform: none; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 3rem); }
.modal-content {
    position: relative; display: flex; flex-direction: column; width: 100%;
    pointer-events: auto; background-color: #fff; background-clip: padding-box;
    border-radius: 12px; outline: 0; box-shadow: 0 10px 25px rgba(0,0,0,0.15); border: none;
}
.modal-header {
    display: flex; flex-shrink: 0; align-items: center; justify-content: space-between;
    padding: 1.5rem 1.5rem 0.5rem; border-bottom: none; border-top-left-radius: 12px; border-top-right-radius: 12px;
}
.modal-title { margin-bottom: 0; line-height: 1.5; font-weight: 700; font-size: 1.3rem; color: #0f172a; }
.modal-body { position: relative; flex: 1 1 auto; padding: 1.25rem 1.5rem 2rem; }
.modal-backdrop { position: fixed; top: 0; left: 0; z-index: 999998 !important; width: 100vw; height: 100vh; background-color: #000; }
.modal-backdrop.fade { opacity: 0; transition: opacity 0.3s; }
.modal-backdrop.show { opacity: 0.5; }
.swal2-container { z-index: 1000000 !important; } /* SweetAlert Fix */

/* Close Buttons */
.close, .btn-close {
    padding: 0.5rem 1rem; background: transparent; border: 0; font-size: 1.8rem;
    font-weight: 700; line-height: 1; color: #64748b; opacity: 0.7; cursor: pointer;
    position: absolute; top: 10px; right: 15px; z-index: 10; transition: 0.2s;
}
html[dir="rtl"] .close, html[dir="rtl"] .btn-close { right: auto; left: 15px; }
.close:hover, .btn-close:hover { color: #ef4444; opacity: 1; }

/* Responsive Modal Sizes */
@media (min-width: 576px) {
    .modal-dialog { max-width: 500px; margin: 1.75rem auto; }
    .modal-dialog-centered { min-height: calc(100% - 3.5rem); }
}
@media (min-width: 992px) { .modal-lg { max-width: 800px; } }
@media (min-width: 1200px) { .modal-xl { max-width: 1140px; } }


/* ==========================================================================
   2. PREMIUM CUSTOM MODAL STYLES (Login, OTP, Post, Verification)
   ========================================================================== */

/* Dark Mode Global Overrides */
body.dark-mode .modal-content, body.dark .modal-content { background-color: #1e2128; color: #f3f4f6; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
body.dark-mode .modal-title { color: #f3f4f6; }
body.dark-mode .close, body.dark-mode .btn-close { color: #cbd5e1; }

/* --- 2.1 OTP & Login Modals --- */
.otp-form-modal-container .modal-icon { font-size: 48px; color: #3b82f6; margin-bottom: 1rem; vertical-align: middle; }
.otp-form-modal-container .otp-subtitle { color: #64748b; margin-bottom: 1.5rem; }
body.dark-mode .otp-form-modal-container .otp-subtitle { color: #94a3b8; }

.otp-form-modal-container .email-display {
    display: flex; align-items: center; justify-content: space-between;
    background-color: #f8fafc; padding: 0.75rem 1rem; border-radius: 8px;
    margin-bottom: 1.5rem; border: 1px solid #e2e8f0;
}
body.dark-mode .otp-form-modal-container .email-display { background-color: #111318; border-color: #2a2d35; }
.otp-form-modal-container .email-display .material-symbols-outlined { margin-right: 8px; color: #3b82f6; }
html[dir="rtl"] .otp-form-modal-container .email-display .material-symbols-outlined { margin-right: 0; margin-left: 8px; }
.otp-form-modal-container .email-text { font-weight: 600; color: #0f172a; }
body.dark-mode .otp-form-modal-container .email-text { color: #f3f4f6; }

#otp-inputs-modal { display: flex; justify-content: center; gap: 10px; direction: ltr; margin: 1.5rem 0; }
#otp-inputs-modal .otp-input {
    width: 48px; height: 55px; text-align: center; font-size: 1.8rem; font-weight: 700;
    border: 2px solid #cbd5e1; border-radius: 8px; transition: all 0.2s; background: transparent; color: inherit;
}
body.dark-mode #otp-inputs-modal .otp-input { border-color: #374151; }
#otp-inputs-modal .otp-input:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }

.otp-form-modal-container .info-box {
    background-color: #eff6ff; padding: 1rem; border-radius: 8px; font-size: 0.85rem;
    color: #1e3a8a; display: flex; align-items: center; border-left: 4px solid #3b82f6;
}
body.dark-mode .otp-form-modal-container .info-box { background-color: rgba(59,130,246,0.1); color: #93c5fd; }
.otp-form-modal-container .info-box .material-symbols-outlined { margin-right: 10px; font-size: 20px; }
html[dir="rtl"] .otp-form-modal-container .info-box { border-left: none; border-right: 4px solid #3b82f6; }
html[dir="rtl"] .otp-form-modal-container .info-box .material-symbols-outlined { margin-right: 0; margin-left: 10px; }

/* Modern Login Toggle */
.toggle-container-modal {
    background: #f1f5f9; border-radius: 8px; padding: 4px; display: flex; margin-bottom: 20px; border: 1px solid #e2e8f0;
}
body.dark-mode .toggle-container-modal { background: #111318; border-color: #2a2d35; }
.toggle-btn-modal {
    flex: 1; padding: 10px; border: none; background: transparent; color: #64748b;
    border-radius: 6px; cursor: pointer; transition: 0.3s; font-size: 0.9rem; font-weight: 600;
}
.toggle-btn-modal.active { background: #fff; color: #3b82f6; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
body.dark-mode .toggle-btn-modal.active { background: #2a2d35; color: #60a5fa; }

/* Input Groups */
.input-group-modal { position: relative; margin-bottom: 15px; }
.input-group-modal .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 1.2rem; z-index: 2; }
html[dir="rtl"] .input-group-modal .icon { left: auto; right: 15px; }
.form-input-modal {
    width: 100%; padding: 12px 12px 12px 45px; border: 2px solid #e2e8f0; border-radius: 10px;
    font-size: 0.95rem; transition: 0.3s; background: #fff; color: #0f172a; outline: none;
}
html[dir="rtl"] .form-input-modal { padding: 12px 45px 12px 12px; }
body.dark-mode .form-input-modal { background: #111318; border-color: #2a2d35; color: #f3f4f6; }
.form-input-modal:focus { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,0.15); }

/* Primary Button */
.btn-login-modal, .btn-custom {
    width: 100%; padding: 14px; border: none; border-radius: 10px;
    background: linear-gradient(to right, #3b82f6 0%, #06b6d4 100%); color: #fff;
    font-weight: 700; font-size: 1rem; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 10px rgba(59,130,246,0.3);
}
.btn-login-modal:hover, .btn-custom:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(59,130,246,0.4); }

/* Soft Alert for OTP */
.alert-soft-primary { background: rgba(59,130,246,0.1); color: #2563eb; padding: 12px; border-radius: 8px; font-weight: 600; }
body.dark-mode .alert-soft-primary { color: #60a5fa; }


/* --- 2.2 Add Post Modal Grid --- */
.modal-add-post .item {
    text-align: center; padding: 20px 10px; border-radius: 12px; transition: all 0.3s ease;
    height: 100%; cursor: pointer; display: flex; flex-direction: column; justify-content: center;
    background: transparent; border: 1px solid transparent;
}
.modal-add-post .col-add-post { margin-bottom: 20px; }
.modal-add-post .item:hover { background-color: #f8fafc; border-color: #e2e8f0; transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
body.dark-mode .modal-add-post .item:hover { background-color: #111318; border-color: #2a2d35; box-shadow: 0 8px 20px rgba(0,0,0,0.4); }

.modal-add-post .item-icon { margin-bottom: 15px; }
.modal-add-post .icon-background {
    width: 64px; height: 64px; border-radius: 50%; display: flex; justify-content: center; align-items: center;
    margin: 0 auto; color: #ffffff; transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.modal-add-post .icon-background .material-symbols-outlined { font-size: 32px; }
.modal-add-post a:hover .icon-background { transform: scale(1.1) rotate(5deg); }
.modal-add-post .item h5.title { font-size: 1.05rem; font-weight: 700; margin-bottom: 5px; color: inherit; }
.modal-add-post .item p.desc { font-size: 0.85rem; color: #64748b; min-height: 40px; margin: 0; }
body.dark-mode .modal-add-post .item p.desc { color: #94a3b8; }
.modal-add-post a { text-decoration: none; color: inherit; }


/* --- 2.3 Verification Badge Modal --- */
.modal-verification { max-width: 400px; }
@media (max-width: 576px) { .modal-verification { max-width: 95%; margin: 0.5rem auto; } }

.verification-badge {
    width: 70px; height: 70px; border-radius: 50%; background: #f1f5f9; display: flex;
    align-items: center; justify-content: center; margin: 0 auto 1rem;
    animation: pulse 2s infinite; overflow: hidden;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}
body.dark-mode .verification-badge { background: #111318; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.verification-title { text-align: center; font-weight: 800; margin-bottom: 1.2rem; font-size: 1.2rem; }
.verification-details { background-color: #f8fafc; border-radius: 10px; padding: 1rem; margin-bottom: 1rem; border: 1px solid #e2e8f0; }
body.dark-mode .verification-details { background-color: #111318; border-color: #2a2d35; }

.verification-item { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid #e2e8f0; font-size: 0.9rem; }
body.dark-mode .verification-item { border-bottom-color: #2a2d35; }
.verification-item:last-child { border-bottom: none; padding-bottom: 0; }
.detail-label { font-weight: 700; color: #64748b; }
body.dark-mode .detail-label { color: #94a3b8; }
.detail-value { font-weight: 600; text-align: right; }

.combined-info { border: 1px dashed #cbd5e1; border-radius: 8px; padding: 1rem; margin-top: 1rem; font-size: 0.9rem; text-align: center; color: #475569; }
body.dark-mode .combined-info { border-color: #475569; color: #cbd5e1; }
.verification-meta { font-size: 0.8rem; color: #94a3b8; margin-top: 0.8rem; display: flex; align-items: center; justify-content: center; gap: 5px; }

.btn-verified {
    background-color: #10b981; border: none; border-radius: 50px; padding: 0; overflow: hidden;
    margin: 0 auto; transition: all 0.3s; display: inline-block;
}
.btn-verified a {
    color: #fff; text-decoration: none; padding: 10px 20px; font-weight: 700; font-size: 0.95rem;
    display: flex; align-items: center; gap: 8px;
}
.btn-verified:hover { background-color: #059669; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); }