/* ============================================
   PROJECTS PAGE STYLES
   ============================================ */

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

/* Project Image */
.project-image {
  width: 100%;
  height: 250px;
  background: linear-gradient(
    135deg,
    var(--primary-light),
    var(--secondary-light)
  );
  position: relative;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.project-status {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: rgba(255, 255, 255, 0.95);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-status.completed {
  color: var(--success-color);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success-color);
}

.project-status.ongoing {
  color: var(--warning-color);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning-color);
}

/* Project Content */
.project-content {
  padding: var(--space-2xl);
}

.project-meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.project-type {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  color: var(--primary-color);
  font-weight: 500;
}

.project-location {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.project-content h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.project-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

.view-details-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.875rem;
  transition: gap var(--transition-fast);
}

.view-details-btn:hover {
  gap: var(--space-md);
}

/* ============================================
   PROJECT DETAIL MODAL
   ============================================ */

.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.project-modal.active {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: var(--space-2xl);
}

.modal-content {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.modal-header {
  position: relative;
  height: 400px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  overflow: hidden;
}

.modal-header-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.modal-close-btn {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.modal-close-btn:hover {
  background: white;
  transform: rotate(90deg);
}

.modal-header-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-3xl);
  color: white;
}

.modal-project-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  width: fit-content;
}

.modal-project-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal-project-meta {
  display: flex;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1rem;
}

/* Modal Body */
.modal-body {
  padding: var(--space-4xl) var(--space-3xl);
}

.project-details-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4xl);
}

/* Main Content */
.project-main-content h2 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--primary-color);
}

.project-description-full {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--space-3xl);
}

.features-section h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.features-list {
  list-style: none;
  display: grid;
  gap: var(--space-md);
}

.features-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary-color);
}

.features-list li i {
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Sidebar */
.project-sidebar {
  position: sticky;
  top: var(--space-2xl);
}

.sidebar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

.sidebar-card h4 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-card a {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  white-space: nowrap;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  color: var(--text-primary);
  font-weight: 600;
}

.cta-sidebar {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  text-align: center;
}

.cta-sidebar h4 {
  color: white;
  margin-bottom: var(--space-md);
}

.cta-sidebar p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-xl);
}

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

  .project-sidebar {
    position: static;
  }

  .modal-project-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .modal-container {
    padding: 0;
  }

  .modal-content {
    border-radius: 0;
    min-height: 100vh;
  }

  .modal-header {
    height: 300px;
  }

  .modal-project-title {
    font-size: 2rem;
  }

  .modal-body {
    padding: var(--space-2xl) var(--space-lg);
  }
}

/* ============================================
   PROJECT IMAGE GALLERY
   ============================================ */

.modal-image-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.gallery-navigation {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  transform: translateY(-50%);
  pointer-events: none;
}

.gallery-nav-btn {
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  pointer-events: all;
  box-shadow: var(--shadow-lg);
}

.gallery-nav-btn:hover {
  background: white;
  transform: scale(1.1);
}

.gallery-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-nav-btn:disabled:hover {
  transform: scale(1);
}

.gallery-thumbnails {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-sm);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
}

.gallery-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  opacity: 0.6;
}

.gallery-thumbnail:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.gallery-thumbnail.active {
  border-color: white;
  opacity: 1;
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-counter {
  position: absolute;
  top: var(--space-xl);
  left: var(--space-xl);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gallery-thumbnails {
    bottom: var(--space-md);
    padding: var(--space-sm);
    gap: var(--space-xs);
  }

  .gallery-thumbnail {
    width: 50px;
    height: 50px;
  }

  .gallery-navigation {
    padding: 0 var(--space-md);
  }

  .gallery-nav-btn {
    width: 2.5rem;
    height: 2.5rem;
  }
}
