/*
Theme Name: Modern News Pro
Theme URI: http://example.com/modern-news-pro
Author: Antigravity
Author URI: http://example.com
Description: A premium, world-class news and magazine theme inspired by high-end designs like Jannah.
Version: 1.2.0
License: GNU General Public License v2 or later
Text Domain: modern-news-pro
*/

:root {
    /* Jannah-Inspired Color Palette */
    --primary-color: #0088ff;
    /* Vibrant Blue */
    --primary-hover: #0077ee;
    --secondary-color: #1a1a1a;
    /* Dark Rich Black */
    --accent-color: #e64946;
    /* World News Red */
    --background-color: #f4f7f9;
    --white: #ffffff;
    --text-main: #222222;
    --text-muted: #555555;
    --text-meta: #888888;
    --border-color: #e1e8ed;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.05);

    /* Shadows & Elevation */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.12);

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --font-arabic: 'Cairo', sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--background-color);
    margin: 0;
    line-height: 1.6;
    font-size: 15px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    margin-top: 0;
    font-weight: 700;
    line-height: 1.3;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Premium 3-Layer Header --- */
.site-header {
    background: var(--white);
    z-index: 1000;
    width: 100%;
}

/* Layer 1: Top Bar */
.top-bar {
    background: var(--secondary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 500;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.top-bar-right .social-links {
    display: flex;
    gap: 15px;
}

.top-bar-right a:hover {
    color: var(--primary-color);
}

/* Layer 2: Branding Area */
.branding-area {
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.branding-area .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo img {
    max-height: 60px;
    width: auto;
}

.header-ad-banner {
    flex: 0 1 728px;
    height: 90px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

/* Layer 3: Nav Bar (Sticky) */
.main-nav-bar {
    background: var(--white);
    border-bottom: 2px solid var(--primary-color);
    position: sticky;
    top: 0;
    box-shadow: var(--shadow-sm);
    z-index: 999;
    height: 60px;
    display: flex;
    align-items: center;
}

.main-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav-links li {
    position: relative;
}

.main-nav-links li a {
    display: block;
    padding: 15px 20px;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.main-nav-links li a:hover,
.main-nav-links li.current-menu-item a {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ajax-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field {
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    width: 180px;
    transition: width 0.3s ease, border-color 0.3s ease;
    background: var(--background-color);
    color: var(--text-main);
}

.search-field:focus {
    width: 250px;
    outline: none;
    border-color: var(--primary-color);
}

/* --- Jannah-Inspired Dark Mode --- */
body.mnp-dark-mode {
    --background-color: #121212;
    --white: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    --text-meta: #777777;
    --border-color: #333333;
    --secondary-color: #ffffff;
    --glass-bg: rgba(30, 30, 30, 0.95);
}

body.mnp-dark-mode .post-card,
body.mnp-dark-mode .widget,
body.mnp-dark-mode .site-header,
body.mnp-dark-mode .main-nav-bar {
    background: var(--white);
    color: var(--text-main);
}

body.mnp-dark-mode a:not(.cat-badge) {
    color: var(--text-main);
}

/* --- Jannah-Style Video Playlist --- */
.mnp-video-playlist {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    color: #fff;
    margin-bottom: 30px;
}

.main-video-player {
    background: #000;
}

.video-playlist-items {
    max-height: 250px;
    overflow-y: auto;
    background: #111;
}

.playlist-item {
    display: flex;
    gap: 15px;
    padding: 10px 15px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    transition: background 0.2s;
    align-items: center;
}

.playlist-item:hover {
    background: #222;
}

.playlist-item.active {
    background: #333;
    border-left: 4px solid var(--primary-color);
}

.playlist-item img {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
}

.playlist-item span {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

/* --- Jannah-Style Social Counter --- */
.mnp-social-counter {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.social-box {
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    color: #fff;
    transition: transform 0.2s;
}

.social-box:hover {
    transform: translateY(-3px);
}

.social-box i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 5px;
}

.social-box .count {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
}

.social-box .label {
    font-size: 0.65rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-box.facebook {
    background: #3b5998;
}

.social-box.twitter {
    background: #1da1f2;
}

.social-box.youtube {
    background: #ff0000;
}

@media (max-width: 768px) {
    .mnp-social-counter {
        grid-template-columns: 1fr;
    }
}

/* Custom Scrollbar for Playlist */
.video-playlist-items::-webkit-scrollbar {
    width: 5px;
}

.video-playlist-items::-webkit-scrollbar-track {
    background: #111;
}

.video-playlist-items::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

/* --- AJAX Search Styles --- */
#ajax-search-results {
    position: absolute;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    z-index: 10001;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    margin-top: 10px;
}

.ajax-search-result {
    display: flex;
    gap: 15px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    text-decoration: none !important;
}

.ajax-search-result:hover {
    background: var(--background-color);
}

.ajax-search-result img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 3px;
}

.ajax-search-result h4 {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

/* --- News Ticker --- */
.ticker-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 10px;
    border-radius: 3px;
    max-width: 400px;
    overflow: hidden;
}

.ticker-label {
    background: var(--primary-color);
    padding: 2px 8px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
    margin-right: 10px;
    border-radius: 2px;
}

/* --- Magazine Homepage Layout --- */
.magazine-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    margin-top: 40px;
}

/* Hero Section (Block 1) */
.hero-block {
    position: relative;
    height: 450px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
}

.hero-item {
    height: 100%;
    position: relative;
}

.hero-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
}

.hero-overlay h2 {
    color: var(--white);
    font-size: 2.5rem;
    margin: 0 0 15px;
    line-height: 1.2;
}

/* Content Blocks */
.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--secondary-color);
    margin-bottom: 25px;
    position: relative;
}

.block-title {
    background: var(--secondary-color);
    color: var(--white);
    padding: 8px 18px;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 700;
}

.block-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: -1;
}

/* Post Cards (Jannah Style) */
.post-card {
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.post-thumb {
    position: relative;
    overflow: hidden;
    background: #eee;
    height: 200px;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumb img {
    transform: scale(1.1);
}

.cat-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: #fff;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 2px;
    z-index: 10;
}

.post-details {
    padding: 20px;
}

.post-details h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-meta {
    font-size: 0.8rem;
    color: var(--text-meta);
    display: flex;
    gap: 15px;
}

/* Category Specific Colors */
.category-news .cat-badge,
.category-news .block-title {
    background: #0088ff !important;
}

.category-world .cat-badge,
.category-world .block-title {
    background: #e64946 !important;
}

.category-tech .cat-badge,
.category-tech .block-title {
    background: #81d742 !important;
}

.category-sports .cat-badge,
.category-sports .block-title {
    background: #ff9800 !important;
}

.category-health .cat-badge,
.category-health .block-title {
    background: #00bcd4 !important;
}

/* Sidebar Styling */
.widget {
    background: var(--white);
    padding: 25px;
    border-radius: 6px;
    margin-bottom: 35px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.trending-widget {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-widget li {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    counter-increment: trending-counter;
}

.trending-widget li::before {
    content: counter(trending-counter);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--border-color);
    line-height: 1;
    width: 30px;
    flex-shrink: 0;
}

.trending-content h4 {
    margin: 0 0 5px;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* --- RTL Precision --- */
body.rtl {
    font-family: var(--font-arabic);
}

body.rtl .cat-badge {
    left: auto;
    right: 15px;
}

body.rtl .trending-widget li::before {
    margin-left: 10px;
    margin-right: 0;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .magazine-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-block {
        height: 350px;
    }

    .hero-overlay h2 {
        font-size: 1.8rem;
    }
}

/* --- Jannah-Style Review Box --- */
.mnp-review-box {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 30px 0;
    overflow: hidden;
}

.review-header {
    background: var(--secondary-color);
    color: var(--white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
}

.review-score {
    background: var(--primary-color);
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    line-height: 1;
}

.score-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
}

.score-label {
    font-size: 0.6rem;
    opacity: 0.9;
}

.review-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 25px;
}

.review-details h4 {
    margin-top: 0;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.review-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.review-details li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.review-pros h4 {
    border-color: #4caf50;
}

.review-cons h4 {
    border-color: #f44336;
}

/* --- Select & Share Highlighter --- */
.mnp-share-tooltip {
    position: absolute;
    background: var(--secondary-color);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 10002;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 10px;
    align-items: center;
}

.mnp-share-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--secondary-color) transparent transparent transparent;
}

/* --- Pro Mobile Menu (Off-canvas) --- */
.mnp-off-canvas-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background: #1a1a1a;
    color: #fff;
    z-index: 10005;
    transition: left 0.3s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
}

body.rtl .mnp-off-canvas-menu {
    left: auto;
    right: -320px;
    transition: right 0.3s cubic-bezier(0.77, 0, 0.175, 1);
}

body.off-canvas-active .mnp-off-canvas-menu {
    left: 0;
}

body.rtl.off-canvas-active .mnp-off-canvas-menu {
    right: 0;
}

.mnp-off-canvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10004;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

body.off-canvas-active .mnp-off-canvas-overlay {
    opacity: 1;
    visibility: visible;
}

.off-canvas-header {
    padding: 30px;
    background: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.off-canvas-close {
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.off-canvas-content {
    padding: 30px;
    flex-grow: 1;
    overflow-y: auto;
}

.mobile-search input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 25px;
    border: none;
    background: #333;
    color: #fff;
    margin-bottom: 30px;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-links li a {
    display: block;
    padding: 12px 0;
    color: #eee;
    text-decoration: none;
    font-size: 1.1rem;
    border-bottom: 1px solid #333;
}

.mobile-menu-toggle {
    display: none;
    width: 30px;
    height: 20px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 2px;
}

@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav-links {
        display: none;
    }
}

/* --- Advanced Mega Menu --- */
.menu-item-mega-menu {
    position: static !important;
}

.main-nav-bar .container {
    position: relative;
}

.mega-menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-bottom: 4px solid var(--primary-color);
    padding: 30px;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border-top: 1px solid var(--border-color);
}

.menu-item-mega-menu:hover .mega-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.mega-post-item a {
    text-decoration: none;
    color: var(--text-main);
}

.mega-post-thumb img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: transform 0.3s;
}

.mega-post-item:hover .mega-post-thumb img {
    transform: scale(1.05);
}

.mega-post-item h5 {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 600;
}

.mega-menu-loading {
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
}

/* Weather Widget & Final Polish */
.weather-widget {
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

body.mnp-dark-mode .mega-menu-panel {
    background: var(--white);
    border-top-color: #333;
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Jannah-Style Instagram Feed --- */
.mnp-instagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 15px;
}

.instagram-item {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 4px;
}

.instagram-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.instagram-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(225, 48, 108, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
}

.instagram-item:hover .instagram-overlay {
    opacity: 1;
}

.instagram-item:hover img {
    transform: scale(1.1);
}

.follow-instagram {
    display: block;
    background: #e1306c;
    color: #fff;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
}