/* Projects UI Styling for MathOpenAi Atlas */

.projects-hero {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 40px;
  margin: 20px 0 32px;
  box-shadow: var(--shadow);
}

.projects-hero .eyebrow {
  color: var(--teal);
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.projects-hero h1 {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

.projects-hero .lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 950px;
  line-height: 1.6;
  margin: 0 0 28px;
}

.projects-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.p-metric {
  display: flex;
  flex-direction: column;
}

.p-metric strong {
  font-family: Georgia, serif;
  font-size: 2rem;
  color: var(--teal);
  line-height: 1.1;
}

.p-metric span {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Category Tabs */
.projects-categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}

.cat-tab {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cat-tab:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--mint);
}

.cat-tab.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.cat-badge {
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.cat-tab.active .cat-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Controls Toolbar */
.projects-controls {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field input {
  padding-left: 38px;
  border-radius: 9px;
  border: 1px solid #9baea8;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.timeline-filter select {
  border-radius: 9px;
  border: 1px solid #9baea8;
  width: 100%;
}

.btn-export {
  white-space: nowrap;
  font-size: 0.88rem;
  padding: 10px 18px;
  height: 44px;
}

/* Status Bar */
.projects-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.92rem;
  color: var(--muted);
}

.projects-status-bar strong {
  color: var(--ink);
}

/* Project Cards Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.p-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  scroll-margin-top: 30px;
}

.p-card:hover {
  box-shadow: var(--shadow);
  border-color: #b3c7be;
}

/* Card Header */
.p-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.p-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.p-id-tag {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.p-cat-tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--mint);
  color: var(--teal);
}

.p-timeline-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.p-card h3 {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--ink);
}

.p-tagline {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 16px;
  font-weight: 500;
}

.p-audience {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.45;
}

.p-audience strong {
  color: #1e293b;
  white-space: nowrap;
}

/* Pain & Secret Sauce blocks */
.p-block {
  margin-bottom: 16px;
}

.p-block-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.p-pain-title {
  color: #b91c1c;
}

.p-sauce-title {
  color: var(--teal);
}

.p-features-title {
  color: #4338ca;
}

.p-block p {
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
  color: var(--ink);
}

.p-sauce-box {
  background: var(--mint);
  border-left: 4px solid var(--teal);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}

.p-features-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.p-features-list li {
  font-size: 0.88rem;
  line-height: 1.45;
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
}

.p-features-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 800;
}

/* Expandable Deep Dive */
.p-deep-dive {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}

.p-details-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--teal);
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.p-details-toggle:hover {
  background: var(--mint);
  border-color: var(--teal);
}

.p-deep-content {
  display: none;
  margin-top: 18px;
  animation: fadeIn 0.2s ease-in-out;
}

.p-deep-content.open {
  display: block;
}

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

/* Deep dive sub-blocks */
.deep-section {
  background: #fbfbf9;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

.deep-section h4 {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
  color: var(--rust);
}

/* Tech Stack items */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stack-item {
  font-size: 0.84rem;
  background: var(--white);
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  border-radius: 6px;
}

.stack-item strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

/* Pricing Grid */
.pricing-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.tier-card {
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.tier-card strong {
  font-size: 0.88rem;
  color: var(--teal);
  margin-bottom: 6px;
}

.tier-card p {
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0;
  color: #374151;
}

/* Playbook Steps */
.playbook-steps {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 16px;
}

/* Math References */
.math-refs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.math-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--mint);
  border: 1px solid #b7d6c6;
  color: #1f4f44;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.math-link:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* Empty State */
.p-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.p-empty h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.p-empty p {
  color: var(--muted);
  margin: 0 0 16px;
}

/* Responsive adjustments */
@media (max-width: 1050px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .pricing-tiers {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .projects-hero {
    padding: 24px 20px;
  }
  .projects-metrics-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .projects-controls {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
  .stack-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .projects-metrics-bar {
    grid-template-columns: 1fr;
  }
  .p-card {
    padding: 20px 16px;
  }
}
