/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --project-card-radius: 12px;
  --project-card-shadow: 0 2px 8px rgba(0,0,0,0.04);
  --project-card-shadow-hover: 0 12px 30px rgba(0,0,0,0.12);
  --project-border-color: #e9ecef;
  --project-border-color-hover: #dee2e6;
  --project-text-primary: #212529;
  --project-text-secondary: #6c757d;
  --project-text-success: #198754;
  --project-bg-light: #f8f9fa;
  --project-transition: all 0.3s ease;
  --project-image-height: 200px;
  --project-image-height-mobile: 180px;
}

/* ===== PROJECT CARDS ===== */
.project-card {
  border-radius: 1rem !important;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--project-border-color);
  background: #fff;
  height: 100%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.6s ease-out;
  position: relative;
}

.project-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 15px 35px rgba(7, 34, 56, 0.15) !important;
  border-color: rgba(240, 194, 75, 0.3) !important;
}

.project-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

/* Accessibility improvements */
.project-link:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
  border-radius: var(--project-card-radius);
}

.project-card:focus-within {
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
  border-radius: var(--project-card-radius);
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== PROJECT IMAGES ===== */
.project-image-container {
  position: relative;
  height: 250px !important;
  overflow: hidden;
  background-color: #f8f9fa;
}

.project-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform 0.3s ease !important;
  background-color: #f8f9fa;
}

.project-card:hover .project-image {
  transform: scale(1.05) !important;
}

/* ===== STATUS BADGES ===== */
.project-status {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.status-ongoing {
  background: linear-gradient(45deg, #ffc107, #ffb300);
  color: #000;
}

.status-launching {
  background: linear-gradient(45deg, #0dcaf0, #0aa2c0);
  color: #fff;
}

.status-completed {
  background: linear-gradient(45deg, #198754, #146c43);
  color: #fff;
}

.status-coming-soon {
  background: linear-gradient(45deg, #fd7e14, #e96500);
  color: #fff;
}

/* ===== PROJECT CONTENT ===== */
.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--project-text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-location,
.project-type {
  font-size: 0.875rem;
  color: var(--project-text-secondary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.project-location i,
.project-type i {
  width: 14px;
  text-align: center;
}

/* ===== PROJECT DETAILS ===== */
.project-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--project-border-color);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-label {
  font-size: 0.8rem;
  color: var(--project-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.detail-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--project-text-primary);
  text-align: right;
}

/* ===== CATEGORY CARDS ===== */
.category-card {
  padding: 1.5rem;
  background: #fff;
  border-radius: 1rem;
  transition: all 0.3s ease;
  border: 1px solid var(--project-border-color);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.category-icon i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* ===== SECTION STYLING ===== */
.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--lg-navy);
  line-height: 1.2;
  margin-bottom: 0;
}

.title-accent {
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--lg-gold), rgba(240, 194, 75, 0.3));
  border-radius: 2px;
  margin: 0.5rem auto 0;
}

/* ===== LAYOUT ===== */
.bg-light {
  background: var(--project-bg-light) !important;
}

.border-bottom {
  border-bottom: 1px solid var(--project-border-color) !important;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
}

.breadcrumb-item {
  font-size: 0.875rem;
}

.breadcrumb-item a {
  color: var(--project-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: #007bff;
}

.breadcrumb-item.active {
  color: #007bff;
  font-weight: 500;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

/* ===== UTILITIES ===== */
.text-primary {
  color: #007bff !important;
}

.text-success {
  color: var(--project-text-success) !important;
}

.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  max-width: 500px;
  margin: 0 auto;
}

.empty-state .fas {
  opacity: 0.5;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
   .project-image-container {
     height: 220px !important;
   }
 }

@media (max-width: 992px) {
   .project-image-container {
     height: 200px !important;
   }

   .project-content {
     padding: 1.25rem;
   }
 }

@media (max-width: 768px) {
   .project-image-container {
     height: 180px !important;
   }

   .project-content {
     padding: 1rem;
   }

   .project-title {
     font-size: 1rem;
     line-height: 1.2;
   }

   .category-card {
     margin-bottom: 1rem;
   }

   .title-accent {
     width: 50px;
     margin-left: 0;
     margin-right: 0;
   }

   .btn {
     padding: 0.5rem 1rem;
     font-size: 0.875rem;
   }

   /* Better mobile spacing */
   .row.g-2.g-md-3 {
     margin: 0 -0.5rem;
   }

   .row.g-2.g-md-3 > [class*="col-"] {
     padding: 0 0.5rem;
   }
 }

@media (max-width: 768px) {
  .project-image-container {
    height: 220px;
  }

  .project-content {
    padding: 1rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
    min-height: 44px; /* Touch-friendly button size */
  }

  .category-card {
    padding: 1rem;
  }

  /* Better mobile spacing */
  .project-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }

  .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .detail-value {
    text-align: left;
  }
}

@media (max-width: 576px) {
   .project-image-container {
     height: 160px !important;
   }

   .project-content {
     padding: 0.875rem;
   }

   .project-title {
     font-size: 0.95rem;
     line-height: 1.3;
   }

   .btn {
     width: 100%;
     margin-bottom: 0.5rem;
     min-height: 44px; /* Touch-friendly button size */
   }

   .category-card {
     padding: 1rem;
   }

   /* Better mobile spacing */
   .project-details {
     margin-top: 0.75rem;
     padding-top: 0.75rem;
   }

   .detail-item {
     flex-direction: column;
     align-items: flex-start;
     gap: 0.25rem;
   }

   .detail-value {
     text-align: left;
   }

   /* Improved mobile grid spacing */
   .row.g-2.g-md-3 {
     margin: 0 -0.25rem;
   }

   .row.g-2.g-md-3 > [class*="col-"] {
     padding: 0 0.25rem;
   }
 }

/* Additional responsive breakpoints */
@media (max-width: 480px) {
   .section-title {
     font-size: 1.75rem;
     line-height: 1.2;
   }

   .project-card {
     margin-bottom: 1rem;
   }

   .project-image-container {
     height: 140px !important;
   }

   .project-content {
     padding: 0.75rem;
   }

   .project-title {
     font-size: 0.9rem;
     line-height: 1.3;
   }

   /* Improve touch targets */
   .project-link {
     min-height: 44px;
     display: flex;
     flex-direction: column;
   }

   /* Better spacing for very small screens */
   .row.g-2.g-md-3 {
     margin: 0;
   }

   .row.g-2.g-md-3 > [class*="col-"] {
     padding: 0.5rem 0.5rem 0 0.5rem;
   }

   .row.g-2.g-md-3 > [class*="col-"]:last-child {
     padding-right: 0.5rem;
   }

   /* Status badge adjustments for small screens */
   .status-badge {
     font-size: 0.7rem;
     padding: 0.25rem 0.5rem;
   }

   /* Breadcrumb adjustments */
   .breadcrumb-item {
     font-size: 0.8rem;
   }
 }

/* Additional mobile improvements */
@media (max-width: 768px) {
   /* Disable hover effects on touch devices */
   .project-card:hover {
     transform: none !important;
     box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
   }

   .project-card:hover .project-image {
     transform: none !important;
   }

   /* Better touch targets for mobile */
   .project-card {
     cursor: default;
   }

   .project-link {
     cursor: pointer;
   }

   /* Improve text readability on mobile */
   .project-title {
     -webkit-tap-highlight-color: transparent;
   }

   /* Better spacing for mobile grid */
   .project-card {
     border-radius: 0.75rem;
   }
 }

@media (max-width: 360px) {
   /* Extra small mobile devices */
   .project-image-container {
     height: 120px !important;
   }

   .project-content {
     padding: 0.625rem;
   }

   .project-title {
     font-size: 0.85rem;
   }

   .status-badge {
     font-size: 0.65rem;
     padding: 0.2rem 0.4rem;
   }
 }

/* High contrast mode support */
@media (prefers-contrast: high) {
   .project-card {
     border-width: 2px;
   }

   .status-badge {
     border: 2px solid currentColor;
   }
 }

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .project-card,
  .project-image,
  .category-card,
  .breadcrumb-item a {
    transition: none;
  }

  .project-card {
    animation: none;
  }
}

/* ===== IMAGE ZOOM MODAL ===== */
.image-zoom-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-zoom-modal.show {
  opacity: 1;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoomed-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  background-color: #fff;
}

.close-btn {
  position: absolute;
  top: -50px;
  right: 0;
  color: #fff;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s ease;
}

.close-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Modal responsive design */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
  }

  .zoomed-image {
    border-radius: 4px;
  }

  .close-btn {
    top: -40px;
    font-size: 30px;
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    max-width: 98vw;
    max-height: 98vh;
  }

  .close-btn {
    top: -35px;
    right: -10px;
    font-size: 28px;
    width: 32px;
    height: 32px;
  }
}

/* Loading state for zoomed image */
.zoomed-image {
  transition: opacity 0.3s ease;
}

.zoomed-image[src=""] {
  opacity: 0;
}

/* Focus styles for accessibility */
.close-btn:focus {
   outline: 2px solid #007bff;
   outline-offset: 2px;
 }

 .project-image:focus {
   outline: 2px solid #007bff;
   outline-offset: 2px;
   border-radius: 4px;
 }

/* ===== WHATSAPP BUTTON CONSISTENCY ===== */
/* Compact WhatsApp button matching other pages */
.btn-whatsapp {
   background: #25D366;
   color: #fff;
   border-radius: 50px;
   padding: .6rem 1rem;
   box-shadow: 0 4px 12px rgba(37, 211, 102, .3);
   transition: all .3s ease;
   z-index: 1000;
   font-size: 0.8rem;
   min-height: 40px;
   max-width: 110px;
}
