/*
Theme Name: Prompt Theme Pro
Theme URI: https://example.com/prompt-theme-pro
Author: Custom Theme Studio
Description: Premium modern AI Prompt theme with thumbnail-style cards, featured image first on single posts, author profile, comments, latest posts footer, and automatic uncategorized exclusion.
Version: 2.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: prompt-theme-pro
*/

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-code: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.08);
  --success: #10b981;
  --border: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 28px -6px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 9999px;
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #161f33;
  --bg-code: #070a12;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-soft: rgba(129, 140, 248, 0.15);
  --border: #1e293b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 30px -6px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

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

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

/* --- HEADER UI --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

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

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links .current-menu-item a {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* --- HERO & TABS SECTION --- */
.hero-section {
  padding: 44px 0 24px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero-subtitle {
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 26px;
  font-size: 1.05rem;
}

.hero-search-form {
  max-width: 580px;
  margin: 0 auto 26px;
  position: relative;
  display: flex;
  align-items: center;
}

.hero-search-input {
  width: 100%;
  padding: 16px 130px 16px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.98rem;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-search-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search-btn:hover {
  background: var(--accent-hover);
}

.prompt-type-tabs {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.prompt-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.prompt-tab-btn:hover,
.prompt-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

/* --- 1. THUMBNAIL STYLE CARDS --- */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  padding-bottom: 56px;
}

.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.prompt-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

/* Aspect Ratio like YouTube/Video Thumbnails (16:9) */
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-primary);
  overflow: hidden;
  display: block;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.prompt-card:hover .card-media img {
  transform: scale(1.05);
}

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.badge-tag {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.badge-ratio {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.38;
}

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

.card-footer-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-view-card {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  transition: all 0.2s;
}

.btn-view-card:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* --- 2. SINGLE POST: FEATURED IMAGE FIRST, THEN COPY CODE --- */
.single-post-wrapper {
  max-width: 840px;
  margin: 40px auto 64px;
}

.single-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 16px 0 16px;
}

.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.single-featured-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.single-featured-img img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.prompt-terminal-card {
  background: var(--bg-code);
  color: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 32px 0;
  border: 1px solid #1e293b;
  box-shadow: var(--shadow-md);
}

.terminal-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 12px;
}

.terminal-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
}

.terminal-prompt-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.98rem;
  line-height: 1.75;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 20px;
}

.ai-quick-launch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
}

.ai-launch-btn {
  padding: 9px 16px;
  border-radius: 8px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.ai-launch-btn:hover {
  background: var(--accent);
}

/* --- 3. AUTHOR PROFILE BOX --- */
.author-profile-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 40px 0;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.author-avatar img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.author-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.author-info p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* --- 3. LATEST POSTS (RELATED) SECTION --- */
.latest-posts-section {
  margin: 48px 0 32px;
  border-top: 1px solid var(--border);
  padding-top: 36px;
}

.latest-posts-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 20px;
}

/* Comments Section Styling */
.comments-area {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 40px;
  box-shadow: var(--shadow-sm);
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.comment-list {
  list-style: none;
  padding: 0;
}

.comment-body {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.comment-reply-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.88rem;
}

.comment-respond {
  margin-top: 32px;
}

.comment-form p {
  margin-bottom: 16px;
}

.comment-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.comment-form input[type="submit"] {
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.comment-form input[type="submit"]:hover {
  background: var(--accent-hover);
}

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-col h4 {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
}

/* Toast */
.copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  border-left: 4px solid var(--success);
}

.copy-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Pagination */
.pagination-wrap {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px 0 64px;
}

.pagination-wrap .page-numbers {
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
}

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

@media (max-width: 768px) {
  .header-inner { height: 68px; }
  .primary-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px;
    box-shadow: var(--shadow-md);
  }
  .primary-nav.active { display: flex; }
  .nav-links { flex-direction: column; gap: 16px; align-items: flex-start; width: 100%; }
  .mobile-menu-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .prompt-grid { grid-template-columns: 1fr; }
  .author-profile-box { flex-direction: column; text-align: center; }
}
