/* ==========================================
   DESIGN SYSTEM & CUSTOM PROPERTIES
   ========================================== */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  /* Color Palette */
  --bg-dark: #07070f;
  --bg-surface: rgba(24, 20, 15, 0.55);
  --bg-surface-hover: rgba(38, 30, 20, 0.7);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-glass-hover: rgba(245, 158, 11, 0.4);
  
  --primary-glow: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  --primary-color: #f59e0b;
  --primary-light: #fcd34d;
  --accent-cyan: #10b981;
  --accent-pink: #f43f5e;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  /* Transitions */
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Shadows */
  --shadow-neon: 0 0 20px rgba(245, 158, 11, 0.15);
  --shadow-neon-hover: 0 0 35px rgba(245, 158, 11, 0.3), 0 0 10px rgba(16, 185, 129, 0.2);
}

/* ==========================================
   BASE & RESET STYLES
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  overflow-x: hidden;
}

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

/* Modern Grid Background & Noise Overlay */
.grid-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
}

.grid-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle 800px at 50% -100px, rgba(139, 92, 246, 0.15), transparent 80%);
  pointer-events: none;
}

.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #05050c;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  border: 2px solid #05050c;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ==========================================
   TYPOGRAPHY & UTILITIES
   ========================================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.required {
  color: var(--accent-pink);
  margin-left: 2px;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-bounce);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-glow);
  color: #fff;
  box-shadow: var(--shadow-neon);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon-hover);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon svg {
  transition: var(--transition-smooth);
}

.btn-icon:hover svg {
  transform: scale(1.1);
}

/* ==========================================
   HEADER
   ========================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 12, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  transition: var(--transition-smooth);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.logo-icon {
  font-size: 1.8rem;
  animation: pulse 2s infinite;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}

.logo-text span {
  color: var(--primary-light);
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero-section {
  padding: 80px 24px 40px;
  text-align: center;
  position: relative;
}

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

.badge-container {
  margin-bottom: 20px;
}

.hero-badge {
  background: rgba(168, 85, 247, 0.1);
  color: var(--primary-light);
  border: 1px solid rgba(168, 85, 247, 0.2);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  line-height: 1.15;
  margin-bottom: 24px;
  font-weight: 800;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  font-weight: 400;
}

/* ==========================================
   MAIN CONTENT & FILTER BAR
   ========================================== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 80px;
  min-width: 0;
}

.filter-bar {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* Search Box */
.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
}

#search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  padding: 16px 16px 16px 52px;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: var(--transition-smooth);
  outline: none;
}

#search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
  background: rgba(0, 0, 0, 0.5);
}

#search-input:focus + .search-icon {
  color: var(--primary-light);
}

/* Tag Filters */
.tags-filter-container {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.filter-label {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.filter-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.tag-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-bounce);
  white-space: normal;
  text-align: left;
}

.tag-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.tag-pill.active {
  background: var(--primary-glow);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* Results Metadata Row */
.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 4px;
}

.results-count {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.sort-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

#sort-select {
  background: rgba(13, 12, 28, 0.8);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

#sort-select:focus {
  border-color: var(--primary-light);
}

/* ==========================================
   PROJECT GRID & CARDS
   ========================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 30px;
  min-width: 0;
}

.project-card {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-bounce);
  position: relative;
  cursor: pointer;
  min-width: 0;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-glass-hover);
  box-shadow: var(--shadow-neon-hover);
}

/* Preview Image Area */
.card-preview {
  height: 180px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

/* Mock UI decoration inside fallback gradients */
.card-fallback-glow {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
}

.card-fallback-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 5, 12, 0.4) 0%, transparent 100%);
}

.mock-ui-browser {
  width: 80%;
  height: 90px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px 8px 0 0;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: translateY(10px);
  transition: var(--transition-smooth);
}

.project-card:hover .mock-ui-browser {
  transform: translateY(0px) scale(1.03);
  background: rgba(255, 255, 255, 0.1);
}

.mock-ui-dots {
  display: flex;
  gap: 5px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
}

.mock-ui-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.mock-ui-dots span:nth-child(1) { background: var(--accent-pink); }
.mock-ui-dots span:nth-child(2) { background: #eab308; }
.mock-ui-dots span:nth-child(3) { background: #22c55e; }

.mock-ui-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.mock-ui-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.mock-ui-wireframe {
  width: 50px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin-top: 6px;
}

/* Card Body */
.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  z-index: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-author {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-author span {
  color: var(--primary-light);
  font-weight: 500;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.project-card:hover .card-title {
  color: var(--primary-light);
}

.card-tagline {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8rem;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-stack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 70%;
  min-width: 0;
}

.stack-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

/* Card Upvote Button */
.btn-vote {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: var(--primary-light);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.btn-vote:hover {
  background: var(--primary-glow);
  color: #fff;
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.btn-vote.voted {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 800;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.btn-vote.voted .vote-arrow {
  color: #000;
}

.btn-card-shortlist {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.btn-card-shortlist:hover,
.btn-card-shortlist.shortlisted,
.btn.shortlisted {
  background: rgba(245, 158, 11, 0.12);
  color: var(--primary-light);
  border-color: rgba(245, 158, 11, 0.35);
}

.vote-arrow {
  font-size: 0.65rem;
  transition: var(--transition-smooth);
}

.btn-vote:hover .vote-arrow {
  transform: translateY(-2px);
}

/* ==========================================
   MODALS LAYOUT
   ========================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 2, 8, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1;
}

.modal-content {
  background: rgba(10, 8, 24, 0.95);
  border: 1px solid var(--border-glass-hover);
  border-radius: 24px;
  width: 90%;
  max-width: 650px;
  min-width: 0;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), var(--shadow-neon-hover);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-bounce);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* --- DETAIL MODAL SPECIFICS --- */
.detail-modal-content {
  max-width: 750px;
  width: min(750px, calc(100vw - 28px));
}

.detail-header-image {
  height: 280px;
  width: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
}

.detail-header-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 8, 24, 1) 0%, rgba(10, 8, 24, 0.6) 50%, rgba(10, 8, 24, 0) 100%);
}

.detail-body {
  padding: 40px;
}

.detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-author {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.detail-author span {
  color: var(--primary-light);
  font-weight: 600;
}

.detail-stack-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-title {
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.detail-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.detail-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 30px;
}

.btn-vote-large {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--primary-light);
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 24px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.btn-vote-large:hover {
  background: var(--primary-glow);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon-hover);
}

.btn-vote-large.voted {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 800;
  border-color: transparent;
}

.btn-vote-large.voted .vote-arrow {
  color: #000;
}

.detail-divider {
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 30px;
}

.detail-story-section h3 {
  font-size: 1.3rem;
  margin-bottom: 14px;
  color: var(--primary-light);
}

.story-paragraph {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-line;
}

/* --- SUBMIT MODAL SPECIFICS --- */
.submit-modal-content {
  padding: 40px;
}

.submit-header {
  margin-bottom: 30px;
}

.submit-header h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.submit-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.submit-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 550px) {
  .modal {
    align-items: flex-start;
    padding: 10px;
  }

  .modal-content {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
  }

  .detail-header-image {
    height: 150px;
    padding: 18px;
  }

  .detail-body,
  .submit-modal-content {
    padding: 20px 16px;
  }

  .detail-title {
    font-size: 1.6rem;
  }

  .detail-tagline {
    font-size: 0.98rem;
    margin-bottom: 20px;
  }

  .detail-actions {
    gap: 10px;
    align-items: stretch;
    flex-direction: column;
  }

  .detail-actions .btn,
  .btn-vote-large {
    width: 100%;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
  }

  .detail-tabs {
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .detail-tab {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .detail-articles-header {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .builder-profile-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .builder-info,
  .btn-hire {
    width: 100%;
  }

  .skills-list {
    min-width: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.15);
}

.help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Stack Checkboxes Grid */
.stack-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  padding: 16px;
  border-radius: 10px;
}

.stack-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stack-check-label input {
  cursor: pointer;
  accent-color: var(--primary-color);
}

.stack-check-label span {
  transition: var(--transition-smooth);
}

.stack-check-label input:checked + span {
  color: var(--primary-light);
  font-weight: 600;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

/* ==========================================
   FOOTER
   ========================================== */
.app-footer {
  border-top: 1px solid var(--border-glass);
  padding: 30px 24px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.footer-link:hover {
  color: var(--primary-light);
}

@media (max-width: 600px) {
  .app-header {
    position: static;
  }

  .header-container {
    padding: 12px 14px;
    flex-wrap: wrap;
  }

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

  .logo-text {
    font-size: 1.08rem;
  }

  .header-actions {
    margin-left: auto;
  }

  .header-actions .btn {
    padding: 9px 11px;
    font-size: 0.82rem;
    border-radius: 10px;
    gap: 6px;
    white-space: nowrap;
  }

  .header-actions .btn svg {
    width: 15px;
    height: 15px;
  }

  .hero-section {
    padding: 44px 14px 24px;
  }

  .hero-badge {
    display: inline-flex;
    max-width: 100%;
    font-size: 0.68rem;
    line-height: 1.35;
    white-space: normal;
    text-align: center;
    justify-content: center;
  }

  .hero-title {
    font-size: 2.15rem;
    line-height: 1.08;
    margin-bottom: 16px;
  }

  .hero-subtitle {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .main-content {
    padding: 14px 14px 56px;
  }

  .filter-bar {
    padding: 14px;
    border-radius: 16px;
    gap: 16px;
  }

  #search-input,
  .location-dropdown {
    height: auto;
    min-height: 50px;
    font-size: 0.9rem;
  }

  #search-input {
    padding: 13px 12px 13px 42px;
  }

  .search-icon {
    left: 14px;
    width: 17px;
    height: 17px;
  }

  .filter-label {
    width: 100%;
    font-size: 0.82rem;
  }

  .filter-tags {
    gap: 8px;
  }

  .tag-pill {
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  .results-meta {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .sort-selector {
    width: 100%;
    justify-content: space-between;
  }

  #sort-select {
    max-width: 170px;
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .card-preview {
    height: 150px;
  }

  .card-body {
    padding: 16px;
  }

  .card-badges-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-status-badges {
    justify-content: flex-start;
  }

  .card-title {
    font-size: 1.14rem;
  }

  .card-tagline {
    height: auto;
    min-height: 0;
    -webkit-line-clamp: 3;
  }

  .card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-stack {
    max-width: 100%;
  }

  .card-actions {
    width: 100%;
    justify-content: space-between;
  }

  .btn-card-shortlist,
  .btn-vote {
    min-height: 36px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 16px;
  }
}

/* ==========================================
   ANIMATIONS & KEYFRAMES
   ========================================== */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.3));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.7));
  }
}

/* ==========================================
   DETAIL MODAL TABS & ARTICLES
   ========================================== */
.detail-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.detail-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 4px 14px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
  outline: none;
}

.detail-tab:hover {
  color: var(--text-primary);
}

.detail-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-glow);
  transform: scaleX(0);
  transition: var(--transition-smooth);
}

.detail-tab.active {
  color: var(--primary-light);
}

.detail-tab.active::after {
  transform: scaleX(1);
}

.tab-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.15);
  color: var(--primary-light);
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-articles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.detail-articles-header h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
}

/* Write Article Form */
.write-article-form {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lead-form {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.18);
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lead-form-header h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.lead-form-header p,
.lead-form-status {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.lead-form-status {
  min-height: 1.3em;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Article Feed list */
.detail-articles-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.article-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 20px;
  transition: var(--transition-bounce);
}

.article-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(168, 85, 247, 0.25);
  box-shadow: 0 5px 15px rgba(168, 85, 247, 0.05);
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.article-author-name {
  color: var(--primary-light);
  font-weight: 600;
}

.article-item-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.article-item-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.empty-articles {
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--border-glass);
  border-radius: 14px;
  color: var(--text-muted);
}

.empty-articles-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

/* ==========================================
   REPUTATION & VALIDATION WIDGETS
   ========================================== */

/* Project Card Badges */
.card-badges-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

.card-validation-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.05);
}

.card-status-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.card-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.card-status-badge.hireable {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.card-status-badge.opportunity {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.card-status-badge.acquisition {
  background: rgba(168, 85, 247, 0.1);
  color: var(--primary-light);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

/* Detail Modal Reputation Grid */
.detail-reputation-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 550px) {
  .detail-reputation-row {
    grid-template-columns: 1fr;
  }
}

.validation-score-box, .builder-status-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.score-label, .status-box-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.score-value-wrapper {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.score-number {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--accent-cyan);
  line-height: 1.1;
  text-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.score-total {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.score-rating {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

.status-badges-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.reputation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 8px;
}

.reputation-badge.hireable {
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.reputation-badge.acquisition {
  background: rgba(168, 85, 247, 0.08);
  color: var(--primary-light);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.reputation-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.reputation-badge.hireable .reputation-badge-dot {
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.reputation-badge.acquisition .reputation-badge-dot {
  background-color: var(--primary-light);
  box-shadow: 0 0 8px var(--primary-light);
}

.opportunity-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.opportunity-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 13px 16px;
  min-width: 0;
}

.opportunity-item span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.opportunity-item strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

@media (max-width: 550px) {
  .opportunity-panel {
    grid-template-columns: 1fr;
  }
}

/* Builder Profile Card inside Modal */
.builder-profile-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.01);
}

.builder-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.builder-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-neon);
}

.builder-info {
  flex-grow: 1;
}

.builder-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.builder-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-hire {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%) !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.2) !important;
  font-weight: 700 !important;
}

.btn-hire:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.4) !important;
  filter: brightness(1.1);
}

.builder-bio {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.builder-skills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

.skills-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.skills-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.skills-list .stack-badge {
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
}

/* Search and Location Grid layout */
.search-location-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  width: 100%;
}

@media (max-width: 650px) {
  .search-location-row {
    grid-template-columns: 1fr;
  }
}

.location-dropdown {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  padding: 16px 16px;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: var(--transition-smooth);
  outline: none;
  cursor: pointer;
  height: 56px;
}

.location-dropdown:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
  background: rgba(0, 0, 0, 0.5);
}

/* AI Copywriter Button Animation */
#btn-ai-assist {
  transition: var(--transition-bounce);
}

#btn-ai-assist:hover {
  transform: scale(1.05);
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

#btn-ai-assist:active {
  transform: scale(0.95);
}
