/* ============================================================
   PROMPTNEXUS - MODERN DESIGN SYSTEM & STYLESHEET
   ============================================================ */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 36, 56, 0.85);
  --bg-input: rgba(13, 17, 28, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(139, 92, 246, 0.4);
  
  --primary: #8b5cf6;
  --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 50%, #06b6d4 100%);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-pink: #ec4899;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Background Glowing Ambient Orbs */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}
.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: #8b5cf6;
  top: -100px;
  left: 20%;
}
.bg-glow-2 {
  width: 450px;
  height: 450px;
  background: #06b6d4;
  top: 400px;
  right: 10%;
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 24px;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  cursor: pointer;
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text .highlight {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-weight: 600;
  margin-left: 4px;
}

.nav-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-item {
  font-size: 0.88rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}
.stat-num {
  color: var(--text-main);
  font-weight: 700;
}

.nav-btn-fav {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}
.nav-btn-fav:hover {
  background: rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}

/* Hero Section */
.hero {
  position: relative;
  z-index: 10;
  padding: 60px 24px 30px;
  text-align: center;
}

.hero-container {
  max-width: 850px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* Search Box */
.search-box-wrapper {
  margin-bottom: 22px;
}

.search-input-box {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.6;
}

.search-input-box input {
  width: 100%;
  padding: 18px 50px 18px 54px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  color: var(--text-main);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.search-input-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3), 0 12px 35px rgba(0, 0, 0, 0.5);
}

.clear-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
}

/* Engine Filter Pills */
.engine-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.engine-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.engine-pill:hover, .engine-pill.active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.5);
  color: var(--text-main);
}
.engine-pill.active {
  font-weight: 600;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}

/* Main Container */
.main-container {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0 20px;
  scrollbar-width: thin;
  margin-bottom: 24px;
}
.category-tabs::-webkit-scrollbar {
  height: 4px;
}
.category-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.cat-tab {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.cat-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}
.cat-tab.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

/* Grid Header & Sorting */
.prompts-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.results-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.results-info span {
  color: var(--text-main);
  font-weight: 700;
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.sort-wrapper select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

/* Prompts Grid */
.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

/* Prompt Card */
.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.prompt-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.engine-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.engine-badge.midjourney {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.3);
}

.card-fav-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.5;
  transition: var(--transition);
}
.card-fav-btn:hover, .card-fav-btn.active {
  opacity: 1;
  transform: scale(1.15);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

/* Prompt Code / Text Box */
.prompt-box {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.6;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
  position: relative;
}

.variable-highlight {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 600;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-copy {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-copy:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.btn-customize {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-customize:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: #0f1624;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  overflow: hidden;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.modal-badge {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.variable-inputs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.input-group input, .input-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
}
.input-group input:focus, .input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.preview-box-wrapper {
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-box-wrapper textarea {
  width: 100%;
  height: 140px;
  background: transparent;
  border: none;
  padding: 14px;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  resize: none;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.btn-reset-filter {
  margin-top: 18px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  background: rgba(9, 13, 22, 0.9);
}
.footer-brand {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .prompts-grid {
    grid-template-columns: 1fr;
  }
  .nav-stats .stat-item {
    display: none;
  }
  .hero-title {
    font-size: 1.85rem;
  }
}
