/*
Theme Name: iFixProblem Studio Pro (Unified Tech & AI Prompt Hub)
Theme URI: https://ifixproblem.com/
Author: Puthea Training
Description: Unified WordPress theme combining iFixProblem.com's Windows, Coding (.NET/C#/SQL/Python), and MS Office tutorials with a dedicated AI Prompt & Media Studio (Suno AI Music, Whisk AI Images, Flow AI Video, live prompt variable customizer, and Google AdSense slots).
Version: 3.3.5
Text Domain: ifixproblem
*/

:root {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-nav: rgba(255, 255, 255, 0.9);
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.12);
  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.12);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.12);
  --code-bg: #0f172a;
  --code-text: #f8fafc;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 14px -2px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.14);
  --radius-md: 12px;
  --radius-lg: 18px;
}

[data-theme="dark"] {
  --bg-page: #090d16;
  --bg-surface: #111827;
  --bg-subtle: #1e293b;
  --bg-nav: rgba(9, 13, 22, 0.9);
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.16);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.16);
  --code-bg: #020617;
  --code-text: #e2e8f0;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 14px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== HEADER ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 800;
}

.brand-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-menu ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 4px;
}

.nav-menu a {
  display: block;
  padding: 8px 13px;
  border-radius: 9px;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: 0.2s;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a {
  background: var(--bg-subtle);
  color: var(--accent);
}

.nav-menu li {
  position: relative;
}

.nav-menu ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  align-items: stretch;
}

.nav-menu li:hover > ul {
  display: flex;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.kbd-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.mobile-btn {
  display: none;
}

/* ==================== UNIFIED HERO & MODE SWITCHER ==================== */
.unified-hero {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 85% 0%, var(--purple-soft), transparent 45%),
              radial-gradient(circle at 10% 15%, var(--accent-soft), transparent 45%);
}

.hero-top-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 26px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
}

.hero-headline {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 740px;
}

.hero-lead {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 660px;
  margin-top: 10px;
}

/* Dual-Mode Hub Tabs (All / Tech & Fixes / AI Prompt Studio) */
.hub-mode-tabs {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 5px;
  border-radius: 14px;
  gap: 4px;
  box-shadow: var(--shadow-xs);
}

.mode-tab {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mode-tab:hover {
  color: var(--accent);
}

.mode-tab.active {
  background: var(--accent);
  color: #fff;
}

.mode-tab.active-ai {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
}

.hero-search-form {
  display: flex;
  align-items: center;
  max-width: 680px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.hero-search-form input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.94rem;
  outline: none;
}

.hero-search-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.topic-pill {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: 0.2s;
}

.topic-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==================== AI PROMPT STUDIO SHOWCASE SECTION ==================== */
.ai-studio-band {
  padding: 36px 0 12px;
}

.studio-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.studio-title-group h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Live Prompt Variable Bar */
.prompt-var-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-xs);
}

.prompt-var-bar label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--purple);
  display: block;
  margin-bottom: 4px;
}

.prompt-var-bar input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-main);
  font-size: 0.85rem;
}

.ai-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.ai-studio-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.ai-studio-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple);
  box-shadow: var(--shadow-sm);
}

.ai-media-preview {
  position: relative;
  height: 175px;
  background: #0f172a;
  overflow: hidden;
}

.ai-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.ai-tool-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  backdrop-filter: blur(6px);
}

.ai-card-body {
  padding: 18px;
}

.ai-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 10px;
}

.ai-prompt-snippet {
  background: var(--code-bg);
  color: var(--code-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 12px;
  border-radius: 10px;
  border-left: 3px solid #a855f7;
  max-height: 92px;
  overflow: hidden;
  position: relative;
}

.ai-card-actions {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-copy-sm {
  padding: 7px 13px;
  border-radius: 8px;
  border: none;
  background: var(--purple);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-copy-sm:hover {
  opacity: 0.9;
}

.btn-audio-preview {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== GOOGLE ADSENSE CONTAINERS ==================== */
.ad-slot-wrapper {
  margin: 24px 0;
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  min-height: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

/* ==================== MAIN 2-COLUMN TECH & TUTORIAL FEED ==================== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  padding: 32px 0 64px;
  align-items: start;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-label h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feed-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow-xs);
  transition: 0.2s;
}

.feed-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.feed-thumb {
  height: 142px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 8px;
}

.badge-tag.prompt-badge {
  background: var(--purple-soft);
  color: var(--purple);
}

.feed-title {
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}

.feed-title a:hover {
  color: var(--accent);
}

.feed-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.79rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Sticky Sidebar */
.sticky-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.widget-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
}

.widget-head {
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tag-pills a {
  display: inline-block;
  font-size: 0.77rem !important;
  font-weight: 600;
  padding: 5px 10px;
  margin: 0 4px 6px 0;
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.tag-pills a:hover {
  background: var(--accent);
  color: #fff;
}

/* ==================== SINGLE POST READER VIEW ==================== */
.reader-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 40px;
  padding: 40px 0 72px;
  align-items: start;
}

.reader-article {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-xs);
}

.reader-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 16px;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.86rem;
  color: var(--text-muted);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.reader-content {
  font-size: 1.03rem;
  color: var(--text-secondary);
}

.reader-content h2 {
  color: var(--text-main);
  font-size: 1.45rem;
  font-weight: 800;
  margin: 32px 0 14px;
}

.reader-content h3 {
  color: var(--text-main);
  font-size: 1.18rem;
  font-weight: 700;
  margin: 24px 0 10px;
}

.reader-content p {
  margin-bottom: 18px;
}

.reader-content pre,
.ai-prompt-card {
  position: relative;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 22px;
  border-radius: 14px;
  margin: 24px 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-prompt-card {
  border-left: 4px solid #a855f7;
}

.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.code-copy-btn:hover {
  background: var(--accent);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.86rem;
}

.toc-list a {
  color: var(--text-muted);
  display: block;
  padding-left: 10px;
  border-left: 2px solid var(--border);
}

.toc-list a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}

.pagination {
  display: flex;
  gap: 8px;
  margin-top: 32px;
}

.pagination .page-numbers {
  padding: 9px 15px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.88rem;
}

.pagination .page-numbers.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 52px 0 28px;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.footer-col h4 {
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.88rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  font-size: 0.84rem;
}

@media (max-width: 1024px) {
  .ai-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-layout,
  .reader-layout {
    grid-template-columns: 1fr;
  }
  .prompt-var-bar {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  .nav-menu.open {
    display: block;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    padding: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-menu.open ul {
    flex-direction: column;
    align-items: stretch;
  }
  .mobile-btn {
    display: inline-flex;
  }
  .ai-cards-grid,
  .feed-card,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== SUNO EMBED PLAYER WRAPPER ==================== */
.suno-embed-wrap {
  margin: 20px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f172a;
  box-shadow: var(--shadow-sm);
}

.suno-embed-wrap iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
}

.suno-embed-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.95);
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 600;
}

.suno-embed-bar a {
  color: #c084fc;
  font-weight: 700;
}

/* ==================== STUDIO ARCHIVE / COLLECTION VIEW (v3.2) ==================== */
.studio-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.studio-type-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.studio-type-pill:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.studio-type-pill.active {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.studio-card-footer-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  padding: 0 18px 12px;
}

/* Standard pages and standalone music studio */
.ifix-standard-page { padding-top: 32px; padding-bottom: 64px; }
.ifix-page-article { min-width: 0; }
.ifix-page-content { min-width: 0; overflow-wrap: break-word; }
.ifix-page-content > p { margin-bottom: 1em; }
[data-theme="dark"] .ifms { --ink: #e2e8f0; --line: #334155; background: #0f172a; }
[data-theme="dark"] .ifms .ifms-output { background: #1e293b; }
[data-theme="dark"] .ifms select, [data-theme="dark"] .ifms textarea { background: #1e293b; color: #e2e8f0; border-color: #475569; }
