/* ==========================================
   DELIVER SOLUTIONS - EXPANDABLE GRID
   Click to expand card and reveal full details
   ========================================== */

/* Main Container */
.deliver-grid {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
}

/* Individual Solution Card */
.solution-expand-card {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 420px;
  background: linear-gradient(135deg,
    rgba(15, 23, 42, 0.6) 0%,
    rgba(10, 15, 30, 0.8) 100%
  );
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  cursor: pointer;
  overflow: hidden;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed state (default) */
.solution-expand-card .card-collapsed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  transition: all 0.4s ease;
}

/* Expanded state content (hidden by default) */
.solution-expand-card .card-expanded {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

/* Hover state for collapsed cards */
.solution-expand-card:not(.active):hover {
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-5px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(0, 212, 255, 0.1);
}

/* Active/Expanded card */
.solution-expand-card.active {
  flex: 3;
  border-color: rgba(0, 212, 255, 0.4);
  background: linear-gradient(135deg,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(10, 15, 30, 0.98) 100%
  );
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(0, 212, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: default;
}

.solution-expand-card.active .card-collapsed {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
}

.solution-expand-card.active .card-expanded {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* Dimmed state for non-active cards when one is expanded */
.deliver-grid.has-active .solution-expand-card:not(.active) {
  flex: 0.6;
  opacity: 0.5;
  filter: brightness(0.7);
}

.deliver-grid.has-active .solution-expand-card:not(.active):hover {
  opacity: 0.8;
  filter: brightness(0.85);
}

/* ==========================================
   COLLAPSED CARD CONTENT
   ========================================== */

.card-number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(0, 212, 255, 0.6);
  margin-bottom: 1.5rem;
}

.card-icon-small {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  background: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 50%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: white;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.25);
  transition: all 0.4s ease;
}

.solution-expand-card:not(.active):hover .card-icon-small {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(0, 212, 255, 0.35);
}

.card-title-small {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-hint i {
  font-size: 0.65rem;
}

/* Badge for featured card */
.card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.3rem 0.7rem;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border: 1px solid rgba(236, 72, 153, 0.4);
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ec4899;
}

/* ==========================================
   EXPANDED CARD CONTENT
   ========================================== */

.expanded-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.expanded-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.card-icon-large {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 50%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 10px 25px rgba(0, 212, 255, 0.3);
}

.expanded-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.expanded-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #00d4ff;
}

.expanded-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin: 0;
}

/* Close button */
.close-card {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.close-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  transform: rotate(90deg);
}

/* Description */
.expanded-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1.5rem;
}

/* Features list */
.expanded-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.expanded-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.expanded-features li i {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
  border-radius: 50%;
  font-size: 0.6rem;
  color: #00d4ff;
  flex-shrink: 0;
}

/* CTA Button */
.expanded-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.expanded-cta:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-color: rgba(0, 212, 255, 0.5);
  transform: translateX(5px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
  color: white;
}

.expanded-cta i {
  transition: transform 0.3s ease;
}

.expanded-cta:hover i {
  transform: translateX(5px);
}

/* ==========================================
   COLOR ACCENTS PER CARD
   ========================================== */

/* Card 1: Chatbots - Cyan */
.solution-expand-card[data-solution="chatbots"].active {
  border-color: rgba(0, 212, 255, 0.4);
}
.solution-expand-card[data-solution="chatbots"] .card-icon-small,
.solution-expand-card[data-solution="chatbots"] .card-icon-large {
  background: linear-gradient(135deg, #00d4ff 0%, #0ea5e9 100%);
}

/* Card 2: Training - Purple */
.solution-expand-card[data-solution="training"].active {
  border-color: rgba(139, 92, 246, 0.4);
}
.solution-expand-card[data-solution="training"] .card-icon-small,
.solution-expand-card[data-solution="training"] .card-icon-large {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Card 3: Agents - Green */
.solution-expand-card[data-solution="agents"].active {
  border-color: rgba(16, 185, 129, 0.4);
}
.solution-expand-card[data-solution="agents"] .card-icon-small,
.solution-expand-card[data-solution="agents"] .card-icon-large {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Card 4: Agentic - Pink */
.solution-expand-card[data-solution="agentic"].active {
  border-color: rgba(236, 72, 153, 0.4);
}
.solution-expand-card[data-solution="agentic"] .card-icon-small,
.solution-expand-card[data-solution="agentic"] .card-icon-large {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

/* Card 5: Custom - Orange */
.solution-expand-card[data-solution="custom"].active {
  border-color: rgba(245, 158, 11, 0.4);
}
.solution-expand-card[data-solution="custom"] .card-icon-small,
.solution-expand-card[data-solution="custom"] .card-icon-large {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1200px) {
  .solution-expand-card {
    min-height: 380px;
    padding: 1.5rem 1.25rem;
  }

  .card-icon-small {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .card-title-small {
    font-size: 1rem;
  }

  .expanded-title {
    font-size: 1.5rem;
  }

  .expanded-features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .deliver-grid {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .solution-expand-card {
    flex: 1 1 calc(50% - 0.5rem);
    min-height: 320px;
  }

  .solution-expand-card.active {
    flex: 1 1 100%;
    min-height: 450px;
  }

  .deliver-grid.has-active .solution-expand-card:not(.active) {
    flex: 1 1 calc(25% - 0.75rem);
    min-height: 280px;
    opacity: 0.6;
  }

  .card-expanded {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  /* Mobile: Dropdown-style accordion */
  .deliver-grid {
    flex-direction: column;
    gap: 0.5rem;
  }

  .solution-expand-card {
    flex: none;
    min-height: 0;
    padding: 0;
    border-radius: 14px;
    background: linear-gradient(135deg,
      rgba(15, 23, 42, 0.7) 0%,
      rgba(10, 15, 30, 0.85) 100%
    );
  }

  /* Collapsed state - compact dropdown header */
  .solution-expand-card .card-collapsed {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    padding: 1rem 1.25rem;
    height: auto;
  }

  .card-collapsed::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    color: rgba(0, 212, 255, 0.6);
    transition: transform 0.3s ease;
    margin-left: auto;
  }


  .card-number {
    display: none;
  }

  .card-icon-small {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    margin-bottom: 0;
    flex-shrink: 0;
    border-radius: 10px;
  }

  .card-title-small {
    font-size: 0.95rem;
    flex: 1;
  }

  .card-hint {
    display: none;
  }

  .card-badge {
    top: 0.75rem;
    right: 2.5rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.5rem;
  }

  /* Expanded state - dropdown content */
  .solution-expand-card.active {
    min-height: 0;
  }

  /* Override desktop rule that hides collapsed state */
  .solution-expand-card.active .card-collapsed {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    border-bottom: none;
    padding-bottom: 1rem;
    margin-bottom: 0;
  }

  .solution-expand-card[data-open="true"] .card-collapsed {
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
  }

  /* CRITICAL: Override desktop .active rules for mobile */
  .solution-expand-card .card-expanded,
  .solution-expand-card.active .card-expanded {
    position: relative !important;
    padding: 0 1.25rem !important;
    transform: none !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
  }

  /* Only show expanded content when data-open is true */
  .solution-expand-card[data-open="true"] .card-expanded {
    max-height: 500px !important;
    padding: 1.25rem !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .solution-expand-card[data-open="true"] .card-collapsed::after {
    transform: rotate(180deg);
  }

  /* Hide close button on mobile - use chevron instead */
  .close-card {
    display: none;
  }

  .expanded-header {
    display: none;
  }

  .expanded-desc {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
  }

  .expanded-features {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
  }

  .expanded-features li {
    font-size: 0.85rem;
  }

  .expanded-features li i {
    width: 18px;
    height: 18px;
    font-size: 0.55rem;
  }

  .expanded-cta {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  /* Non-active cards stay normal (no dimming on mobile) */
  .deliver-grid.has-active .solution-expand-card:not(.active) {
    opacity: 1;
    filter: none;
  }

  /* Hover effect for mobile cards */
  .solution-expand-card:not(.active):active {
    transform: scale(0.98);
  }
}

@media (max-width: 480px) {
  .deliver-grid {
    gap: 0.4rem;
  }

  .solution-expand-card {
    border-radius: 12px;
  }

  .solution-expand-card .card-collapsed {
    padding: 0.875rem 1rem;
    gap: 0.875rem;
  }

  .card-icon-small {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    border-radius: 8px;
  }

  .card-title-small {
    font-size: 0.9rem;
  }

  .card-badge {
    font-size: 0.45rem;
    padding: 0.15rem 0.4rem;
    right: 2rem;
  }

  .solution-expand-card .card-expanded {
    padding: 0 1rem;
  }

  .solution-expand-card.active .card-expanded {
    padding: 1rem;
  }

  .expanded-desc {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  .expanded-features {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .expanded-features li {
    font-size: 0.8rem;
  }

  .expanded-cta {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}
