/* Project Details Modal - Case Study Panel Styles */

#projectDetailsModal .modal-content {
  background: #ffffff;
  color: #212529;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  border: 1px solid #e0e0e0;
  max-width: 900px;
  margin: 0 auto;
  animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

#projectDetailsModal .modal-header {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  padding: 28px 36px;
  border-radius: 18px 18px 0 0;
}

#projectDetailsModal .modal-title {
  color: #212529;
  font-weight: 800;
  font-size: 1.8rem;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #C8141F;
  position: relative;
  animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
  0% { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}

#projectDetailsModal .modal-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #C8141F, #ff4a58);
  animation: expandUnderline 0.8s ease 0.3s forwards;
}

@keyframes expandUnderline {
  100% { width: 100%; }
}

#projectDetailsModal .modal-subtitle {
  color: #6c757d;
  font-size: 1rem;
  margin-top: 8px;
  font-weight: 400;
}

#projectDetailsModal .btn-close {
  opacity: 0.8;
}

#projectDetailsModal .btn-close:hover {
  opacity: 1;
}

#projectDetailsModal .modal-body {
  padding: 36px;
  background: #ffffff;
}

/* Metric Boxes - Animated Counters */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.metric-box {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  text-align: center;
  padding: 18px 12px;
  font-size: 1.1rem;
  color: #212529;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

.metric-box:nth-child(1) { animation-delay: 0.1s; }
.metric-box:nth-child(2) { animation-delay: 0.2s; }
.metric-box:nth-child(3) { animation-delay: 0.3s; }
.metric-box:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

.metric-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(200,20,31,.2);
  border-color: #C8141F;
  background: linear-gradient(135deg, #ffffff, #fff5f5);
}

.metric-icon {
  font-size: 1.8rem;
  color: #C8141F;
  margin-bottom: 8px;
}

.metric-value {
  color: #C8141F;
  font-weight: 800;
  font-size: 1.6rem;
  display: block;
  margin-bottom: 4px;
}

.metric-label {
  color: #6c757d;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Section Headers */
.case-section {
  margin: 32px 0;
  opacity: 0;
  animation: fadeInSection 0.6s ease forwards;
}

@keyframes fadeInSection {
  to { opacity: 1; }
}

.section-title {
  color: #212529;
  font-weight: 800;
  font-size: 1.4rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i {
  color: #C8141F;
  font-size: 1.2rem;
}

.case-section p {
  color: #495057;
  line-height: 1.7;
  font-size: 1rem;
  margin: 0;
}

/* Solution Highlights */
.solution-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.solution-item {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.solution-item:hover {
  border-color: #C8141F;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(200,20,31,.15);
  background: #fff5f5;
}

.solution-item i {
  font-size: 2rem;
  color: #C8141F;
  margin-bottom: 10px;
  display: block;
}

.solution-item span {
  color: #212529;
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
}

/* Tech Tags */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tech-tag {
  display: inline-block;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  color: #495057;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tech-tag:hover {
  background: linear-gradient(135deg, #C8141F, #a3121a);
  border-color: #C8141F;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200,20,31,.3);
}

/* Impact Cards */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.impact-card {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border: 1px solid #e0e0e0;
  border-left: 4px solid #C8141F;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.impact-card:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(200,20,31,.15);
  background: #fff5f5;
}

.impact-card i {
  font-size: 1.5rem;
  color: #C8141F;
  margin-bottom: 8px;
}

.impact-card p {
  color: #495057;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Project Preview */
.project-preview {
  margin: 24px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.project-preview img {
  width: 100%;
  border-radius: 12px;
  display: block;
  transition: transform 0.4s ease;
  cursor: pointer;
}

.project-preview img:hover {
  transform: scale(1.03);
}

/* CTA Section */
.case-cta {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  padding: 28px;
  margin-top: 32px;
  text-align: center;
}

.case-cta h4 {
  color: #212529;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.case-cta p {
  color: #6c757d;
  font-size: 1rem;
  margin-bottom: 24px;
}

.case-cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-case-live {
  background: #C8141F;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-case-live:hover {
  background: #a3121a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(200,20,31,.4);
  color: #fff;
}

.btn-case-discuss {
  background: transparent;
  color: #C8141F;
  border: 2px solid #C8141F;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-case-discuss:hover {
  background: rgba(200,20,31,.1);
  color: #ff4a58;
  border-color: #ff4a58;
  transform: translateY(-2px);
}

/* Modal z-index and scroll lock */
#projectDetailsModal {
  z-index: 9999;
}

/* Ensure modal is accessible on mobile */
@media (max-width: 767px) {
  #projectDetailsModal {
    z-index: 10000;
  }

  #projectDetailsModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
  }

  #projectDetailsModal .modal-content {
    max-height: 95vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Bootstrap handles body.modal-open, but we ensure cleanup */
body.modal-open {
  overflow: hidden;
}

/* Ensure backdrop cleanup doesn't leave ghost elements */
.modal-backdrop {
  z-index: 1040;
}

/* Fix for when Bootstrap adds padding to body for scrollbar */
body.modal-open {
  padding-right: 0 !important;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  #projectDetailsModal .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
  }

  #projectDetailsModal .modal-content {
    border-radius: 12px;
    max-width: 100%;
  }

  #projectDetailsModal .modal-header {
    padding: 20px;
  }

  #projectDetailsModal .modal-title {
    font-size: 1.4rem;
    padding-bottom: 8px;
  }

  #projectDetailsModal .modal-subtitle {
    font-size: 0.9rem;
  }

  #projectDetailsModal .btn-close {
    padding: 8px;
    font-size: 1.2rem;
  }

  #projectDetailsModal .modal-body {
    padding: 20px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .metric-box {
    padding: 14px 10px;
    font-size: 1rem;
  }

  .metric-value {
    font-size: 1.4rem;
  }

  .metric-label {
    font-size: 0.8rem;
  }

  .solution-highlights {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .solution-item {
    padding: 14px;
  }

  .impact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .impact-card {
    padding: 16px;
  }

  .case-cta {
    padding: 20px;
    margin-top: 24px;
  }

  .case-cta h4 {
    font-size: 1.1rem;
  }

  .case-cta p {
    font-size: 0.9rem;
  }

  .case-cta-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .btn-case-live,
  .btn-case-discuss {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .case-section {
    margin: 24px 0;
  }

  .tech-tags {
    gap: 6px;
  }

  .tech-tag {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .project-preview {
    margin: 16px 0;
  }
}

@media (max-width: 575px) {
  #projectDetailsModal .modal-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  #projectDetailsModal .modal-title {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }

  #projectDetailsModal .modal-subtitle {
    font-size: 0.85rem;
  }

  #projectDetailsModal .btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px;
  }

  #projectDetailsModal .modal-body {
    padding: 16px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .metric-box {
    padding: 12px 10px;
  }

  .section-title {
    font-size: 1.1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .section-title i {
    font-size: 1rem;
  }

  .case-section p {
    font-size: 0.9rem;
    line-height: 1.6;
  }
}

