/* ===========================
   PromptVault — Main Stylesheet
   =========================== */

/* ---- CSS Variables ---- */
:root {
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #6c63ff;
  --accent-hover: #574fd6;
  --border: #e5e7eb;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --radius: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: 0.25s ease;
}

body.dark-mode {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-header: #13131f;
  --text: #e8e8f0;
  --text-muted: #9ca3af;
  --accent: #7c73ff;
  --accent-hover: #9b94ff;
  --border: #2d2d45;
  --shadow: 0 2px 12px rgba(0,0,0,0.35);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; transition: background var(--transition), color var(--transition); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }

/* ---- Accessibility ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- Layout ---- */
.container { width: min(1200px, 95%); margin-inline: auto; }
.hidden { display: none !important; }
.center-btn { text-align: center; margin-top: 2rem; }

/* ---- Header ---- */
.site-header { background: var(--bg-header); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 0; gap: 1rem; }
.logo { display: flex; align-items: center; gap: 0.4rem; font-size: 1.3rem; font-weight: 700; color: var(--text); }
.logo-icon { font-size: 1.5rem; }
.logo-text { background: linear-gradient(135deg, var(--accent), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.main-nav .nav-list { display: flex; align-items: center; gap: 0.25rem; }
.nav-link { padding: 0.45rem 0.8rem; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 0.95rem; transition: background var(--transition), color var(--transition); }
.nav-link:hover, .nav-link.active { background: var(--accent); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.theme-toggle { background: var(--border); border: none; border-radius: 50%; width: 38px; height: 38px; font-size: 1.1rem; transition: background var(--transition); }
.theme-toggle:hover { background: var(--accent); }

/* ---- Dropdown ---- */
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); min-width: 170px; box-shadow: var(--shadow); z-index: 200; padding: 0.5rem 0; }
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a { display: block; padding: 0.5rem 1rem; color: var(--text); font-size: 0.9rem; transition: background var(--transition); }
.dropdown-menu li a:hover { background: var(--accent); color: #fff; }

/* ---- Hamburger ---- */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 6px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* ---- Hero ---- */
.hero { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); color: #fff; padding: 4rem 0 3rem; text-align: center; }
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; line-height: 1.2; }
.hero-sub { font-size: 1.05rem; color: #c0c0d8; max-width: 620px; }
.search-bar { display: flex; gap: 0.5rem; width: min(600px, 100%); }
.search-bar input { flex: 1; padding: 0.85rem 1.2rem; border-radius: var(--radius); border: none; font-size: 1rem; background: rgba(255,255,255,0.12); color: #fff; backdrop-filter: blur(8px); }
.search-bar input::placeholder { color: rgba(255,255,255,0.55); }
.search-bar input:focus { outline: 2px solid var(--accent); }
.search-bar button { padding: 0.85rem 1.5rem; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600; transition: background var(--transition); }
.search-bar button:hover { background: var(--accent-hover); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; font-size: 0.9rem; color: rgba(255,255,255,0.75); }
.hero-stats span { background: rgba(255,255,255,0.1); padding: 0.4rem 1rem; border-radius: 20px; }

/* ---- Ad Banner ---- */
.ad-banner { margin: 1.5rem auto; }
.ad-placeholder { background: var(--border); border-radius: var(--radius); height: 90px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.85rem; border: 1px dashed var(--text-muted); }

/* ---- Section Titles ---- */
.section-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text); }
.section-title::after { content: ''; display: block; width: 50px; height: 3px; background: var(--accent); margin-top: 0.4rem; border-radius: 2px; }

/* ---- Category Filter ---- */
.category-filter-section { padding: 2.5rem 0 1rem; }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.filter-btn { padding: 0.5rem 1.1rem; border-radius: 20px; border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 0.9rem; font-weight: 500; transition: all var(--transition); }
.filter-btn:hover, .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- Prompts Grid ---- */
.prompts-section { padding: 1.5rem 0 2.5rem; }
.prompts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }

/* ---- Prompt Card ---- */
.prompt-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition); }
.prompt-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(108,99,255,0.15); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.card-category { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; background: var(--accent); color: #fff; padding: 0.2rem 0.6rem; border-radius: 20px; }
.card-platform { font-size: 0.8rem; color: var(--text-muted); }
.card-title { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.4; }
.card-prompt { font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; flex: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { font-size: 0.75rem; background: var(--border); color: var(--text-muted); padding: 0.2rem 0.55rem; border-radius: 12px; }
.card-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.btn-copy { flex: 1; padding: 0.55rem; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 0.88rem; font-weight: 600; transition: background var(--transition); }
.btn-copy:hover { background: var(--accent-hover); }
.btn-view { padding: 0.55rem 1rem; background: transparent; border: 1.5px solid var(--border); color: var(--text); border-radius: 8px; font-size: 0.88rem; transition: all var(--transition); }
.btn-view:hover { border-color: var(--accent); color: var(--accent); }
.no-results { text-align: center; padding: 3rem; color: var(--text-muted); font-size: 1.05rem; }

/* ---- Platforms ---- */
.platforms-section { padding: 2.5rem 0; }
.platforms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.platform-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 0.75rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--text); font-weight: 600; font-size: 0.9rem; transition: all var(--transition); box-shadow: var(--shadow); }
.platform-card:hover { background: var(--accent); color: #fff; transform: translateY(-3px); }
.platform-icon { font-size: 1.8rem; }

/* ---- Blog Preview ---- */
.blog-preview { padding: 2.5rem 0; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.blog-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform var(--transition); }
.blog-card:hover { transform: translateY(-3px); }
.blog-card-body { padding: 1.2rem; }
.blog-card-cat { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem; }
.blog-card-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; line-height: 1.4; }
.blog-card-excerpt { font-size: 0.87rem; color: var(--text-muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.blog-card-meta { display: flex; justify-content: space-between; margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-muted); }

/* ---- Buttons ---- */
.btn-primary { display: inline-block; padding: 0.75rem 2rem; background: var(--accent); color: #fff; border-radius: var(--radius); font-weight: 600; font-size: 0.95rem; transition: background var(--transition); border: none; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

/* ---- Footer ---- */
.site-footer { background: var(--bg-header); border-top: 1px solid var(--border); padding: 3rem 0 0; margin-top: 3rem; }
.footer-inner { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; padding-bottom: 2.5rem; }
.footer-brand p { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.75rem; max-width: 280px; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.footer-col h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }
.footer-col ul li { margin-bottom: 0.55rem; }
.footer-col ul li a { font-size: 0.88rem; color: var(--text-muted); transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); text-align: center; padding: 1.2rem 0; font-size: 0.85rem; color: var(--text-muted); }

/* ---- Toast ---- */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: #22c55e; color: #fff; padding: 0.75rem 1.5rem; border-radius: var(--radius); font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,0.2); opacity: 0; transform: translateY(20px); transition: all 0.3s ease; pointer-events: none; z-index: 999; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg-header); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: 1rem 0; }
  .main-nav.open { display: block; }
  .nav-list { flex-direction: column; padding: 0 1rem; gap: 0.25rem; }
  .dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 1rem; }
  .dropdown:hover .dropdown-menu { display: none; }
  .dropdown.open .dropdown-menu { display: block; }
  .hamburger { display: flex; }
  .site-header { position: sticky; }
}

@media (max-width: 540px) {
  .footer-links { grid-template-columns: 1fr; }
  .search-bar { flex-direction: column; }
  .hero-stats { font-size: 0.82rem; }
}