/* ================================================
   CASE STUDIES COMPONENT
   Exact replica of tomasomarketing.net Results page
   Cards + Modal + Lightbox
   ================================================ */

/* ── Card Grid ───────────────────────────────── */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Card ────────────────────────────────────── */
.cs-card {
  background: #0a0a0a;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  position: relative;
}
.cs-card:hover {
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  transform: translateY(-8px);
}

/* Hover glow border */
.cs-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 24px;
  pointer-events: none;
  transition: border-color 0.3s ease;
}
.cs-card:hover::after {
  border-color: var(--cs-color, #38C4DA);
  opacity: 0.4;
}

/* ── Card Logo Area ──────────────────────────── */
.cs-card-logo-area {
  height: 210px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #1a1a2e);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

/* Dot pattern background */
.cs-card-dot-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: radial-gradient(circle at 2px 2px, var(--cs-color, #38C4DA) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Glow effect */
.cs-card-glow {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background: radial-gradient(circle at center, var(--cs-color, #38C4DA), transparent 70%);
  transition: opacity 0.5s ease;
}
.cs-card:hover .cs-card-glow {
  opacity: 0.35;
}

/* Logo image */
.cs-card-logo-area img {
  position: relative;
  z-index: 2;
  max-width: 180px;
  max-height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
  transition: transform 0.5s ease;
}
.cs-card:hover .cs-card-logo-area img {
  transform: scale(1.1);
}

/* View button overlay */
.cs-card-view-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(0,0,0,0.4);
  transition: opacity 0.3s ease;
  z-index: 3;
}
.cs-card:hover .cs-card-view-overlay {
  opacity: 1;
}
.cs-card-view-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary, #38C4DA);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56,196,218,0.6);
  transform: scale(0.5);
  transition: transform 0.3s ease;
}
.cs-card:hover .cs-card-view-btn {
  transform: scale(1);
}

/* ── Card Content ────────────────────────────── */
.cs-card-content {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.cs-card-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  transition: color 0.3s ease;
}
.cs-card:hover .cs-card-name {
  color: var(--color-primary, #38C4DA);
}
.cs-card-desc {
  font-size: 0.9rem;
  color: #9ca3af;
  line-height: 1.6;
  margin: 0 0 24px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Card Stats ──────────────────────────────── */
.cs-card-stats {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cs-stat-badge {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: border-color 0.3s ease;
}
.cs-stat-badge:hover {
  border-color: rgba(255,255,255,0.2);
}
.cs-stat-badge-label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 4px;
  font-weight: 500;
}
.cs-stat-badge-value {
  font-family: var(--font-display, 'Bebas Neue', cursive);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.cs-stat-trend {
  color: #4ade80;
  font-size: 0.7rem;
  margin-bottom: 3px;
}


/* ════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════ */

/* Backdrop */
.cs-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(12px);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cs-modal-backdrop.active {
  display: block;
  opacity: 1;
}

/* Modal container */
.cs-modal {
  display: none;
  position: fixed;
  inset: 0;
  top: 5vh;
  background: #050505;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  z-index: 10001;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 -20px 50px rgba(0,0,0,0.8);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.cs-modal.active {
  display: block;
  transform: translateY(0);
}

/* Close button */
.cs-modal-close {
  position: fixed;
  top: calc(5vh + 24px);
  left: 24px;
  z-index: 10010;
  padding: 12px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  display: none;
  line-height: 0;
}
.cs-modal-close:hover {
  background: #fff;
  color: #000;
}
.cs-modal-close.active {
  display: block;
}

/* Modal inner container */
.cs-modal-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding-bottom: 80px;
  direction: rtl;
}

/* ── Modal Hero ──────────────────────────────── */
.cs-modal-hero {
  position: relative;
  width: 100%;
  height: 50vh;
  min-height: 350px;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #1a1a2e);
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  overflow: hidden;
}
.cs-modal-hero-dots {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: radial-gradient(circle at 2px 2px, var(--cs-color, #38C4DA) 1px, transparent 0);
  background-size: 32px 32px;
}
.cs-modal-hero-glow {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background: radial-gradient(circle at center, var(--cs-color, #38C4DA), transparent 70%);
}
.cs-modal-hero-logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cs-modal-hero-logo img {
  max-width: 350px;
  max-height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.5));
}
.cs-modal-hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to top, #050505, transparent);
}
.cs-modal-hero-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 48px;
  background: linear-gradient(to top, #050505, rgba(5,5,5,0.8), transparent);
  padding-top: 80px;
}
.cs-modal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border-radius: 50px;
  font-size: 0.75rem;
  color: #d1d5db;
  border: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}
.cs-modal-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-family: var(--font-display, 'Bebas Neue', cursive);
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1;
}
.cs-modal-hero-desc {
  font-size: 1.15rem;
  color: #d1d5db;
  font-weight: 300;
  line-height: 1.6;
  max-width: 700px;
  margin: 0;
}

/* ── Modal Grid Layout ───────────────────────── */
.cs-modal-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  padding: 48px;
}

/* ── Sidebar (Stats & Growth) ────────────────── */
.cs-modal-sidebar {
  position: sticky;
  top: 32px;
  align-self: start;
}
.cs-modal-sidebar-box {
  background: #0a0a0a;
  padding: 32px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
}
.cs-modal-sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Social Growth Stats */
.cs-growth-card {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.cs-growth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cs-growth-platform {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #d1d5db;
  text-transform: capitalize;
}
.cs-growth-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(74,222,128,0.1);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(74,222,128,0.2);
}
.cs-growth-numbers {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}
.cs-growth-before-label,
.cs-growth-after-label {
  font-size: 0.7rem;
  margin-bottom: 4px;
}
.cs-growth-before-label {
  color: #6b7280;
}
.cs-growth-after-label {
  color: var(--color-primary, #38C4DA);
}
.cs-growth-before-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #9ca3af;
}
.cs-growth-after-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display, 'Bebas Neue', cursive);
}
.cs-growth-arrow {
  flex: 1;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.cs-growth-arrow-line {
  height: 2px;
  width: 100%;
  background: linear-gradient(to left, var(--color-primary, #38C4DA), rgba(107,114,128,0.3));
  border-radius: 99px;
}
.cs-growth-arrow svg {
  position: absolute;
  color: var(--color-primary, #38C4DA);
}

/* Stats list */
.cs-modal-stats-list {
  margin-top: 24px;
}
.cs-modal-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  transition: background 0.3s ease;
}
.cs-modal-stat-row:last-child {
  border-bottom: none;
}
.cs-modal-stat-row:hover {
  background: rgba(255,255,255,0.05);
}
.cs-modal-stat-label {
  font-size: 0.85rem;
  color: #9ca3af;
}
.cs-modal-stat-value-wrap {
  text-align: left;
}
.cs-modal-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-display, 'Bebas Neue', cursive);
}
.cs-modal-stat-trend {
  font-size: 0.6rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* CTA button in sidebar */
.cs-modal-cta-wrap {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.cs-modal-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  background: #E7437A;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(231,67,122,0.2);
  text-decoration: none;
}
.cs-modal-cta-btn:hover {
  background: #d13a6d;
  box-shadow: 0 8px 24px rgba(231,67,122,0.4);
  color: #fff;
}

/* ── Main Content (Narrative & Media) ────────── */
.cs-modal-main {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

/* Challenge & Solution grid */
.cs-narrative-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.cs-narrative-card {
  background: #111111;
  padding: 32px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.cs-narrative-card:hover {
  border-color: rgba(255,255,255,0.2);
}
.cs-narrative-card-icon {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 80px;
  opacity: 0.05;
  transition: opacity 0.3s ease;
  line-height: 1;
}
.cs-narrative-card:hover .cs-narrative-card-icon {
  opacity: 0.1;
}
.cs-narrative-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.cs-narrative-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cs-narrative-number.challenge {
  background: rgba(239,68,68,0.2);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}
.cs-narrative-number.solution {
  background: rgba(56,196,218,0.2);
  color: var(--color-primary, #38C4DA);
  border: 1px solid rgba(56,196,218,0.3);
}
.cs-narrative-text {
  font-size: 1rem;
  color: #e5e7eb;
  line-height: 1.7;
  margin: 0;
  position: relative;
  z-index: 2;
}

/* ── Gallery Images ──────────────────────────── */
.cs-gallery-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cs-gallery-title svg {
  color: var(--color-primary, #38C4DA);
}
.cs-gallery-scroll {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 16px;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.cs-gallery-scroll::-webkit-scrollbar {
  display: none;
}
.cs-gallery-item {
  flex-shrink: 0;
  width: 320px;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  background: #0a0a0a;
  position: relative;
  cursor: pointer;
  scroll-snap-align: center;
  transition: border-color 0.3s ease;
}
.cs-gallery-item:hover {
  border-color: rgba(56,196,218,0.5);
}
.cs-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.cs-gallery-item:hover img {
  transform: scale(1.05);
}
.cs-gallery-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.3s ease;
  opacity: 0;
}
.cs-gallery-item:hover .cs-gallery-zoom {
  background: rgba(0,0,0,0.4);
  opacity: 1;
}
.cs-gallery-zoom-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.cs-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.cs-gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}
.cs-gallery-dot:first-child {
  background: var(--color-primary, #38C4DA);
}


/* ════════════════════════════════════════════════
   IMAGE LIGHTBOX
   ════════════════════════════════════════════════ */
.cs-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: rgba(0,0,0,0.98);
  backdrop-filter: blur(20px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cs-lightbox.active {
  display: flex;
}
.cs-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  padding: 8px;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 0;
}
.cs-lightbox-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.2);
}
.cs-lightbox-nav {
  position: absolute;
  z-index: 10;
  padding: 12px;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 0;
}
.cs-lightbox-nav:hover {
  color: #fff;
  background: rgba(255,255,255,0.2);
}
.cs-lightbox-prev {
  left: 16px;
}
.cs-lightbox-next {
  right: 16px;
}
.cs-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.cs-lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  background: rgba(0,0,0,0.5);
  padding: 8px 16px;
  border-radius: 50px;
  backdrop-filter: blur(12px);
}


/* ════════════════════════════════════════════════
   SECTION WRAPPER (for embedding in pages)
   ════════════════════════════════════════════════ */
.cs-section-header {
  text-align: center;
  margin-bottom: 48px;
}
.cs-section-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-primary, #38C4DA);
  margin: 0 0 12px;
  font-weight: 600;
}
.cs-section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px;
}
.cs-section-subtitle {
  font-size: 1.05rem;
  color: #9ca3af;
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}


/* ════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .cs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .cs-modal-grid {
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 32px;
  }
  .cs-modal-sidebar {
    position: static;
    order: 2;
  }
  .cs-modal-main {
    order: 1;
  }
  .cs-modal-hero {
    height: 40vh;
    min-height: 280px;
  }
  .cs-modal-hero-info {
    padding: 24px;
  }
  .cs-modal-hero-logo img {
    max-width: 250px;
    max-height: 150px;
  }
}

@media (max-width: 768px) {
  .cs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cs-card-logo-area {
    height: 180px;
  }
  .cs-card-content {
    padding: 20px 24px;
  }
  .cs-modal {
    top: 0;
    border-radius: 0;
  }
  .cs-modal-close {
    top: 24px;
  }
  .cs-modal-hero {
    height: 35vh;
    min-height: 250px;
    border-radius: 0;
  }
  .cs-modal-grid {
    padding: 16px;
    gap: 24px;
  }
  .cs-narrative-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cs-gallery-item {
    width: 260px;
    height: 180px;
  }
  .cs-modal-hero-title {
    font-size: 2rem;
  }
  .cs-modal-hero-desc {
    font-size: 1rem;
  }
}

/* ── SVG Icons inline ────────────────────────── */
.cs-icon-instagram,
.cs-icon-tiktok {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Body scroll lock */
body.cs-modal-open {
  overflow: hidden;
}
