﻿/* ============================================================
   GitImsi — Case Studies & Proof Portfolio Page Styles
   ============================================================ */

/* --- Hero Section --- */
.cs-hero {
  position: relative;
  padding: var(--space-5xl) 0 var(--space-4xl);
  overflow: hidden;
  background: var(--bg-primary);
}

.cs-hero .grid-bg {
  opacity: 0.5;
}

.cs-hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.cs-hero-title {
  margin-bottom: var(--space-lg);
}

.cs-hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto var(--space-3xl);
}

/* Hero Summary Stats */
.cs-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: 720px;
  margin: 0 auto;
}

.cs-stat-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  transition: all var(--transition-base);
}

.cs-stat-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-indigo);
}

.cs-stat-value {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: var(--font-weight-black);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.cs-stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
}

/* --- Filter Bar Section --- */
.cs-filter-section {
  padding: var(--space-2xl) 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 72px;
  z-index: var(--z-dropdown);
  backdrop-filter: blur(16px);
}

.cs-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.cs-filter-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  flex-shrink: 0;
}

.cs-filter-tab {
  padding: 0.55rem 1.15rem;
  font-size: 0.825rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
}

.cs-filter-tab:hover {
  color: var(--text-secondary);
}

.cs-filter-tab.active {
  background: var(--accent-indigo);
  color: white;
  box-shadow: var(--shadow-sm);
}

.cs-filter-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.cs-search-wrapper {
  position: relative;
}

.cs-search-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.cs-search-input {
  padding: 0.6rem 1rem 0.6rem 2.35rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 220px;
  transition: all var(--transition-fast);
}

.cs-search-input::placeholder {
  color: var(--text-tertiary);
}

.cs-search-input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px var(--accent-indigo-muted);
  width: 280px;
}

.cs-sort-select {
  padding: 0.6rem 2.25rem 0.6rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%2394a3b8'%3E%3Cpath d='M2 4L6 8L10 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all var(--transition-fast);
}

.cs-sort-select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px var(--accent-indigo-muted);
}

.cs-sort-select option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* --- Case Study Cards Grid --- */
.cs-grid-section {
  padding: var(--space-4xl) 0;
}

.cs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.cs-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.cs-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-indigo);
}

.cs-card.hidden {
  display: none;
}

.cs-card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, var(--accent-indigo-muted) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.cs-card:hover .cs-card-glow {
  opacity: 1;
}

.cs-card-main {
  position: relative;
  z-index: 2;
  padding: var(--space-2xl);
}

/* Industry badge */
.cs-industry-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-lg);
}

.cs-industry-tag.marketing {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo-glow);
}

.cs-industry-tag.seo {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald-glow);
}

.cs-industry-tag.saas {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber-glow);
}

.cs-industry-tag.automation {
  background: rgba(244, 114, 182, 0.15);
  color: #f472b6;
}

.cs-industry-tag.enterprise {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.cs-company-name {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.cs-challenge-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: var(--space-xl);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Key metric */
.cs-key-metric {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: var(--font-weight-black);
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, var(--accent-indigo-glow), var(--accent-emerald-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Secondary metrics row */
.cs-secondary-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.cs-metric-item {
  text-align: center;
  padding: var(--space-sm) var(--space-xs);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.08);
}

.cs-metric-val {
  font-size: 0.95rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cs-metric-lbl {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Card footer */
.cs-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cs-read-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.6rem 1.25rem;
  font-size: 0.825rem;
  font-weight: var(--font-weight-semibold);
  color: var(--accent-indigo-glow);
  background: var(--accent-indigo-muted);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cs-read-btn:hover {
  background: var(--accent-indigo);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.cs-read-btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.cs-read-btn.expanded svg {
  transform: rotate(180deg);
}

/* Floating asset container inside cards */
.cs-card .floating-asset-container {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  opacity: 0.5;
  z-index: 1;
}

.cs-card .floating-asset-container .asset-3d-mock {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  opacity: 0.4;
}

/* Chart SVG visualization inside asset */
.cs-mini-chart {
  width: 100%;
  height: 100%;
}

.cs-mini-chart .chart-bar {
  fill: var(--accent-indigo);
  opacity: 0.6;
}

.cs-mini-chart .chart-bar:nth-child(even) {
  fill: var(--accent-emerald);
}

.cs-mini-chart .chart-line {
  stroke: var(--accent-indigo-glow);
  stroke-width: 2;
  fill: none;
  opacity: 0.7;
}

/* --- Expanded Detail Panel --- */
.cs-detail-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 0 solid var(--border-subtle);
}

.cs-card.expanded .cs-detail-panel {
  max-height: 1200px;
  border-top-width: 1px;
}

.cs-detail-content {
  padding: var(--space-2xl);
}

.cs-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.cs-detail-block h4 {
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-indigo-glow);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cs-detail-block p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Before/After Metrics */
.cs-ba-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.cs-ba-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.cs-ba-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.cs-ba-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.cs-ba-before {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.cs-ba-arrow {
  color: var(--accent-emerald);
  font-size: 0.9rem;
}

.cs-ba-after {
  font-size: 1.05rem;
  font-weight: var(--font-weight-bold);
  color: var(--accent-emerald-glow);
}

/* Timeline visualization */
.cs-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-xl);
  position: relative;
}

.cs-timeline-step {
  flex: 1;
  text-align: center;
  position: relative;
  padding: var(--space-md) var(--space-sm);
}

.cs-timeline-step::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-subtle);
  z-index: 0;
}

.cs-timeline-step:first-child::before {
  left: 50%;
}

.cs-timeline-step:last-child::before {
  right: 50%;
}

.cs-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-indigo);
  margin: 0 auto var(--space-sm);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.cs-timeline-step.completed .cs-timeline-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.cs-timeline-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cs-timeline-value {
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Tech tags */
.cs-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.cs-tech-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--accent-indigo-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-mono);
}

/* --- Results Aggregation Section --- */
.cs-results-section {
  padding: var(--space-5xl) 0;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.cs-results-counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-4xl);
}

.cs-counter-card {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.cs-counter-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.cs-counter-value {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: var(--font-weight-black);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.cs-counter-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* CSS-only bar chart */
.cs-bar-chart {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
}

.cs-chart-title {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xl);
  color: var(--text-primary);
}

.cs-chart-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.cs-chart-label {
  width: 140px;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: right;
}

.cs-chart-bar-track {
  flex: 1;
  height: 28px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.cs-chart-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-emerald));
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: var(--space-sm);
}

.cs-chart-bar-fill.animated {
  /* Width set via inline style */
}

.cs-chart-bar-value {
  font-size: 0.72rem;
  font-weight: var(--font-weight-bold);
  color: white;
  white-space: nowrap;
}

.cs-chart-bar-fill.emerald {
  background: linear-gradient(90deg, var(--accent-emerald-deep), var(--accent-emerald-glow));
}

.cs-chart-bar-fill.amber {
  background: linear-gradient(90deg, var(--accent-amber-deep), var(--accent-amber-glow));
}

.cs-chart-bar-fill.indigo {
  background: linear-gradient(90deg, var(--accent-indigo-deep), var(--accent-indigo-glow));
}

.cs-chart-bar-fill.pink {
  background: linear-gradient(90deg, #be185d, #f472b6);
}

/* --- CTA Section --- */
.cs-cta-section {
  padding: var(--space-5xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cs-cta-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
}

.cs-cta-title {
  margin-bottom: var(--space-lg);
}

.cs-cta-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
}

.cs-cta-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* No results state */
.cs-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-4xl);
  color: var(--text-secondary);
  display: none;
}

.cs-no-results.visible {
  display: block;
}

.cs-no-results-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.4;
}

.cs-no-results h3 {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .cs-grid {
    grid-template-columns: 1fr;
  }

  .cs-results-counters {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .cs-filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cs-filter-controls {
    justify-content: space-between;
  }

  .cs-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .cs-hero-stats {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .cs-secondary-metrics {
    grid-template-columns: 1fr;
  }

  .cs-ba-metrics {
    grid-template-columns: 1fr;
  }

  .cs-results-counters {
    grid-template-columns: 1fr;
  }

  .cs-chart-label {
    width: 80px;
    font-size: 0.7rem;
  }

  .cs-filter-controls {
    flex-direction: column;
  }

  .cs-search-input {
    width: 100%;
  }

  .cs-search-input:focus {
    width: 100%;
  }

  .cs-sort-select {
    width: 100%;
  }

  .cs-timeline {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .cs-timeline-step::before {
    display: none;
  }

  .cs-timeline-step {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-align: left;
    padding: var(--space-sm) 0;
  }

  .cs-timeline-dot {
    margin: 0;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .cs-card-main {
    padding: var(--space-lg);
  }

  .cs-detail-content {
    padding: var(--space-lg);
  }

  .cs-key-metric {
    font-size: 1.75rem;
  }
}

/* --- 480px Mobile --- */
@media (max-width: 480px) {
    .cs-metrics { grid-template-columns: 1fr !important; }
    .cs-filter-tabs { flex-wrap: wrap; }
    .cs-filter-tabs .tab-btn { flex: 1; min-width: 80px; text-align: center; }
}