/*
Theme Name: WebUtilityHub WP
Theme URI: https://www.webutilityhub.online
Author: TechEmpireSoftware
Description: Pixel-Perfect Native WordPress Port with Vanilla JS Engine.
Version: 3.0
Text Domain: webutilityhub
*/

:root {
  --font-body: 'Roboto', sans-serif;
  --font-heading: 'Nunito', sans-serif;
  --bg-main: #f8fafc; --bg-surface: #ffffff; --bg-surface-alt: #f1f5f9; 
  --bg-footer: #0f172a; --bg-topbar: #1e293b; --bg-header: #1e3a8a;
  --text-main: #0f172a; --text-muted: #475569; --text-inverse: #ffffff; --text-footer-muted: #94a3b8;
  --brand: #2563eb; --brand-hover: #1d4ed8; --brand-light: #dbeafe;
  --success: #10b981; --warning: #f59e0b; --danger: #ef4444;
  --border: #e2e8f0; --border-footer: #334155;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px;
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 48px; --space-2xl: 80px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --desktop-post-width: 1600px;
  --mobile-post-width: 100%;
}

[data-theme="dark"] {
  --bg-main: #0f172a; --bg-surface: #1e293b; --bg-surface-alt: #334155; 
  --bg-topbar: #0b132b; --bg-header: #0f172a;
  --text-main: #f8fafc; --text-muted: #cbd5e1;
  --border: #334155; --brand-light: #1e3a8a;
  --brand: #3b82f6; --brand-hover: #60a5fa;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg-main); color: var(--text-main); line-height: 1.6; transition: background var(--transition), color var(--transition); overflow-x: hidden; }
h1, h2, h3, h4, h5, h6, .brand-text { font-family: var(--font-heading); }
a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-hover); }
ul { list-style: none; }
img, svg { max-width: 100%; height: auto; display: block; }
button, input, select { font-family: inherit; font-size: 1rem; outline: none; border: none; background: none; }
button { cursor: pointer; transition: all var(--transition); }

.container { max-width: 1300px; margin: 0 auto; padding: 0 var(--space-md); }
.container-sm { max-width: 900px; margin: 0 auto; padding: 0 var(--space-md); }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); } .gap-md { gap: var(--space-md); } .gap-lg { gap: var(--space-lg); }
.w-full { width: 100%; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: var(--radius-md); font-weight: 700; text-align: center; transition: all var(--transition); font-family: var(--font-heading); }
.btn-primary { background: var(--brand); color: var(--text-inverse); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline { border: 2px solid var(--border); color: var(--text-main); background: var(--bg-surface); }
.btn-outline:hover { background: var(--bg-surface-alt); border-color: var(--brand-light); }
.btn-success { background: var(--success); color: var(--text-inverse); }
.btn-success:hover { background: #059669; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-md); color: var(--text-inverse); transition: background var(--transition); }
.btn-icon:hover { background: rgba(255,255,255,0.1); }

.top-bar { background: var(--bg-topbar); color: var(--text-inverse); padding: 8px 0; font-size: 0.85rem; }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.top-bar-links-wrapper { display: flex; gap: var(--space-xl); width: 100%; }
.top-bar-links-wrapper .widget { margin: 0; }
.top-bar-links-wrapper .widget-content ul { display: flex; gap: var(--space-md); margin: 0; padding: 0; }
.top-bar-links-wrapper .widget-content a { color: #e2e8f0; font-weight: 500; transition: color var(--transition); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px;}
.top-bar-links-wrapper .widget-content a:hover { color: #ffffff; }

.site-header { background: var(--bg-header); box-shadow: var(--shadow-sm); padding: var(--space-md) 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.brand-link { text-decoration: none; display: inline-block; flex-shrink: 0; }
.brand-text { font-size: 2.25rem; font-weight: 900; letter-spacing: -1px; margin: 0; line-height: 1; color: #ffffff; }
.brand-text span { color: #93c5fd; }

.header-ad-wrapper { flex: 1; display: flex; justify-content: center; align-items: center; min-height: 80px; padding: 5px 0; }
.header-ad-wrapper .widget { margin: 0; width: 100%; text-align: center; }

.mobile-menu-toggle { display: none; background: none; border: none; color: #fff; cursor: pointer; padding: 8px; }
.mobile-menu-toggle svg { width: 28px; height: 28px; fill: currentColor; }

.cat-nav { background: var(--bg-surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.cat-nav-inner { display: flex; overflow: visible; }
.mega-menu-root { display: flex; gap: var(--space-md); list-style: none; padding: 0; margin: 0; }
.mega-menu-item { position: relative; }
.mega-menu-link { display: flex; align-items: center; gap: 6px; font-family: var(--font-heading); font-weight: 700; color: var(--text-main); font-size: 0.95rem; padding: 16px 12px; cursor: pointer; transition: color var(--transition); text-decoration: none; }
.mega-menu-link svg { width: 14px; height: 14px; fill: currentColor; transition: transform var(--transition); }
.mega-menu-item:hover .mega-menu-link { color: var(--brand); }
.mega-menu-item:hover .mega-menu-link svg { transform: rotate(180deg); }

.mega-dropdown { position: absolute; top: 100%; left: 0; min-width: 280px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(15px); transition: all 0.3s ease; z-index: 1000; padding: var(--space-md); }
.mega-menu-item:hover .mega-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.mega-post-list { display: flex; flex-direction: column; gap: 4px; padding: 0; margin: 0; list-style: none; }
.mega-post-list a { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; display: block; padding: 10px 14px; border-radius: var(--radius-md); transition: all 0.2s; text-decoration: none; }
.mega-post-list a:hover { background: var(--brand-light); color: var(--brand); transform: translateX(4px); }

.mobile-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.mobile-sidebar { position: fixed; top: 0; left: 0; width: 300px; max-width: 85%; height: 100vh; background: var(--bg-surface); z-index: 2001; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow-y: auto; }

.sidebar-open .mobile-overlay { opacity: 1; visibility: visible; }
.sidebar-open .mobile-sidebar { transform: translateX(0); }

.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h3 { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 800; color: var(--text-main); margin: 0;}
.sidebar-close { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }

.sidebar-nav-section { padding: 20px 0; border-bottom: 1px solid var(--border); }
.sidebar-nav-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; padding: 0 20px; margin-bottom: 10px; }
.sidebar-nav-list { list-style: none; padding: 0; margin: 0; }
.sidebar-nav-list li a { display: block; padding: 12px 20px; color: var(--text-main); font-weight: 600; font-size: 0.95rem; border-left: 3px solid transparent; transition: all 0.2s; text-decoration: none; }
.sidebar-nav-list li a:hover { background: var(--bg-surface-alt); border-left-color: var(--brand); color: var(--brand); }

.ad-slot { display: flex; justify-content: center; align-items: center; width: 100%; overflow: visible; }
.ad-skyscraper { width: 160px; min-height: 600px; display: flex; }
.ad-banner-top, .ad-banner-bottom, .ad-middle, .header-ad-wrapper { min-height: 100px; }
.ad-banner-top { margin-bottom: var(--space-lg); }
.ad-banner-bottom { margin-top: var(--space-xl); }
.ad-middle { margin: var(--space-xl) 0; }

.hero { padding: var(--space-xl) 0 var(--space-2xl); text-align: center; background: var(--bg-main); min-height: 60vh; }
.hero-title { font-size: 2.5rem; font-weight: 900; margin-bottom: var(--space-sm); color: var(--text-main); letter-spacing: -0.5px; }
.hero-subtitle { font-size: 1.15rem; color: var(--text-muted); max-width: 600px; margin: 0 auto var(--space-xl); }

.converter-wrapper { display: flex; justify-content: center; gap: var(--space-lg); align-items: flex-start; }
.converter-center { flex: 1; max-width: 800px; width: 100%; display: flex; flex-direction: column; }

.converter-card, .post-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: var(--space-xl); box-shadow: var(--shadow-lg); width: 100%; box-sizing: border-box; text-align: left; }
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: var(--space-xl) var(--space-md); text-align: center; cursor: pointer; transition: all var(--transition); background: var(--bg-surface-alt); position: relative; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--brand); background: var(--brand-light); }
.file-input-hidden { display: none; }
.picker-actions { display: flex; gap: var(--space-sm); justify-content: center; margin-top: var(--space-md); flex-wrap: wrap; }

.file-list-ui { display: none; text-align: left; }
.file-list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--border); }
.file-list-header h3 { font-size: 1.25rem; font-weight: 800; font-family: var(--font-heading); }
.file-table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-lg); }
.file-table th { text-align: left; padding: 12px; color: var(--text-muted); font-size: 0.875rem; border-bottom: 1px solid var(--border); font-family: var(--font-heading); font-weight: 700;}
.file-table td { padding: 16px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.file-name-cell { display: flex; align-items: center; gap: 12px; font-weight: 500; word-break: break-all; }
.file-icon { width: 32px; height: 32px; fill: var(--brand); flex-shrink: 0; }
.file-size { font-size: 0.8rem; color: var(--text-muted); display: block; }
.target-select { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-main); font-weight: 500; cursor: pointer; }

.status-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; font-family: var(--font-heading);}
.status-pending { background: var(--bg-surface-alt); color: var(--text-muted); }
.status-converting { background: var(--brand-light); color: var(--brand); }
.status-done { background: #d1fae5; color: #065f46; }
.status-error { background: #fee2e2; color: #991b1b; }

.converter-actions-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: var(--space-md); }
.bulk-actions { display: flex; gap: var(--space-md); }

.blog-post-layout { max-width: var(--desktop-post-width) !important; }
@media (max-width: 992px) { .blog-post-layout { max-width: var(--mobile-post-width) !important; } }
.post-body-content img { max-width: 100%; height: auto; border-radius: var(--radius-md); margin: var(--space-md) 0; }
.post-body-content h2, .post-body-content h3 { color: var(--text-main); margin-top: 1.5em; margin-bottom: 0.5em; font-family: var(--font-heading); font-weight: 800; }
.post-body-content a { color: var(--brand); font-weight: 600; text-decoration: none; }
.post-body-content a:hover { color: var(--brand-hover); text-decoration: underline; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-lg); }

.seo-article-section { padding: var(--space-2xl) 0; background: var(--bg-surface); border-top: 1px solid var(--border);}
.seo-card { max-width: 900px; margin: 0 auto; color: var(--text-main); }
.seo-card h2 { font-size: 2.2rem; font-weight: 900; margin-bottom: var(--space-md); color: var(--text-main); letter-spacing: -0.5px;}
.seo-card h3 { font-size: 1.5rem; font-weight: 800; margin: 1.5em 0 0.5em; color: var(--brand); }
.seo-card p { margin-bottom: 1.2em; font-size: 1.1rem; line-height: 1.8; color: var(--text-muted); }

.safe-list { margin-bottom: 1.5em; list-style: none; padding-left: 0;}
.safe-list li { margin-bottom: 12px; font-size: 1.1rem; line-height: 1.6; color: var(--text-muted); display: flex; align-items: flex-start; gap: 10px; }
.safe-list li svg { width: 22px; height: 22px; fill: var(--brand); flex-shrink: 0; margin-top: 2px; }

.seo-highlight-box { background: var(--bg-surface-alt); border-left: 4px solid var(--brand); padding: var(--space-lg); border-radius: 0 var(--radius-md) var(--radius-md) 0; margin: var(--space-lg) 0; }
.seo-highlight-box h4 { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; color: var(--text-main); }
.seo-highlight-box p { margin: 0; font-size: 1rem; color: var(--text-muted); }

.faq-container { margin-top: var(--space-xl); }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); margin-bottom: var(--space-md); background: var(--bg-surface); }
.faq-question { font-weight: 800; font-size: 1.1rem; margin-bottom: 8px; color: var(--text-main); font-family: var(--font-heading); }
.faq-answer { color: var(--text-muted); font-size: 1rem; line-height: 1.6; }

@media (max-width: 992px) {
  .top-bar, .cat-nav { display: none; }
  .mobile-menu-toggle { display: block; margin-right: 10px; }
  .header-inner { justify-content: flex-start; }
  .brand-link { flex-grow: 1; text-align: center; padding-right: 20px; }
  .header-actions { display: flex; justify-content: flex-end; position: absolute; right: 15px; }
  
  .ad-skyscraper { display: none !important; }
  .header-ad-wrapper { display: none !important; }
  
  .hero-title { font-size: 1.8rem; line-height: 1.2; padding: 0 10px; }
  .hero-subtitle { font-size: 1rem; padding: 0 10px; }
  
  .converter-card, .post-card { margin-top: 10px; margin-bottom: 10px; padding: 20px 15px; }
  
  .picker-actions { flex-direction: column; }
  .file-table thead { display: none; }
  .file-table, .file-table tbody, .file-table tr, .file-table td { display: block; width: 100%; }
  .file-table tr { margin-bottom: var(--space-md); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface-alt); padding: var(--space-sm); }
  .file-table td { border: none; padding: 8px; text-align: center; }
  .file-name-cell { justify-content: center; flex-direction: column; text-align: center; }
  .converter-actions-bottom { flex-direction: column; gap: var(--space-md); }
  .bulk-actions { flex-direction: column; width: 100%; }
  .bulk-actions .btn { width: 100%; }
  
  .seo-card h2 { font-size: 1.6rem; }
  .seo-card h3 { font-size: 1.3rem; }
  .seo-card p { font-size: 1rem; }
}

.site-footer { background: var(--bg-footer); color: var(--text-footer-muted); padding: var(--space-xl) 0 var(--space-lg); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-xl); margin-bottom: var(--space-xl); }
.footer-col h4 { color: var(--text-inverse); font-size: 1.1rem; font-weight: 800; margin-bottom: var(--space-md); font-family: var(--font-heading);}
.footer-col ul { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.footer-col a { color: var(--text-footer-muted); font-size: 0.95rem; transition: color var(--transition); text-decoration: none; }
.footer-col a:hover { color: var(--brand-light); padding-left: 4px; }
.footer-bottom { padding-top: var(--space-lg); border-top: 1px solid var(--border-footer); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; font-size: 0.875rem; text-align: center; }
@media (max-width: 768px) { .footer-bottom { justify-content: center; flex-direction: column; } }

/* GLOBAL DARK MODE BRIDGE */
[data-theme="dark"] .wuh-wrapper,
[data-theme="dark"] .wuh-ctr-wrapper,
[data-theme="dark"] .post-body-content input,
[data-theme="dark"] .post-body-content select,
[data-theme="dark"] .post-body-content textarea,
[data-theme="dark"] .tool-container {
    background-color: var(--bg-surface-alt) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
}
[data-theme="dark"] .post-body-content { color: var(--text-muted); }