/* Project Details Page Styles */
:root {
  --header-height: 60vh;
  --header-min-height: 520px;
  --content-spacing: 30px;
  --border-radius: 15px;
  --transition-speed: 0.5s;
  --primary-color: #007bff;
  --secondary-color: #2d3748;
  --white: #ffffff;
  --text-color: #4a5568;
  --light-bg: #f8f9fa;
  --primary-color-rgb: 0, 123, 255;
}

/* Header Styles */
.page-header {
  height: var(--header-height);
  min-height: var(--header-min-height);
  position: relative;
  overflow: hidden;
  margin-bottom: 50px;
}

.page-header-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.page-header .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.8)
  );
}

.page-header-content {
  position: relative;
  z-index: 2;
  padding-top: 150px;
  text-align: center;
  color: var(--white);
}

.page-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-description {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

/* Breadcrumb Styles */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 25px;
  border-radius: 30px;
  backdrop-filter: blur(5px);
}

.breadcrumb-item {
  color: rgba(255, 255, 255, 0.8);
}

.breadcrumb-item a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
  color: var(--primary-color);
}

/* Perfect Image Comparison Styles */
.image-comparison-container {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: var(--content-spacing);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px;
}

.comparison-tabs {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: var(--light-bg);
  border-radius: 10px;
  font-weight: 500;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-speed) ease;
  cursor: pointer;
}

.tab-btn i {
  font-size: 1.1rem;
}

.tab-btn.active {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.3);
}

.tab-btn:hover:not(.active) {
  background: #e9ecef;
  transform: translateY(-1px);
}

.image-comparison {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 500px;
  background: var(--light-bg);
  width: 100%;
  user-select: none;
  cursor: crosshair;
  touch-action: none;
}

.image-comparison.resizing {
  cursor: col-resize;
}

.before-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.after-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
  transition: all 0.3s ease-out;
}

.before-image img,
.after-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  pointer-events: none;
  border-radius: 0;
}

.image-label {
  position: absolute;
  top: 20px;
  padding: 8px 20px;
  border-radius: 30px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--white);
  font-weight: 500;
  font-size: 0.9rem;
  z-index: 3;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.before-image .image-label {
  left: 20px;
}

.after-image .image-label {
  right: 20px;
}

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
  transform: translateX(-50%);
  transition: opacity 0.3s ease;
  touch-action: none;
}

.slider-handle:hover .slider-button {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.slider-line {
  position: absolute;
  width: 4px;
  height: 100%;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.slider-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  border: 4px solid var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  cursor: col-resize;
  touch-action: none;
}

.slider-button i {
  font-size: 18px;
  pointer-events: none;
}

.slider-button:hover {
  background: var(--secondary-color);
}

.slider-button:active {
  transform: translate(-50%, -50%) scale(0.95);
}

/* Project Content Styles */
.project-content {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.content-block {
  padding: 30px;
}

.section-title {
  font-size: 1.8rem;
  color: var(--secondary-color);
  margin-bottom: 25px;
  padding-bottom: 15px;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
}

/* Project Meta */
.project-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 25px 0;
  padding: 25px;
  background: var(--light-bg);
  border-radius: 12px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.meta-item i {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--primary-color);
  border-radius: 10px;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.meta-info {
  display: flex;
  flex-direction: column;
}

.meta-info .label {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
}

.meta-info .value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--secondary-color);
}

/* Sidebar Widget Styles */
.sidebar-widget {
  background: var(--white);
  border-radius: var(--border-radius);
  margin-bottom: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Gallery Widget Styles */
.gallery-widget {
  padding: var(--content-spacing);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  max-height: 700px;
  overflow-y: auto;
  padding-right: 10px;
}

/* Custom scrollbar */
.gallery-grid::-webkit-scrollbar {
  width: 6px;
}

.gallery-grid::-webkit-scrollbar-track {
  background: var(--light-bg);
  border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Gallery Item Styles */
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--light-bg);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* Project Stats Widget */
.stats-widget {
  padding: var(--content-spacing);
}

.widget-title {
  font-size: 1.4rem;
  color: var(--secondary-color);
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light-bg);
  font-weight: 600;
}

.stats-grid {
  display: grid;
  gap: 15px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--light-bg);
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 10px;
  font-size: 1.2rem;
}

.stat-content .label {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
}

.stat-content .value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--secondary-color);
}

/* Contact Widget Styles */
.contact-widget {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  padding: var(--content-spacing);
  color: var(--white);
  text-align: center;
}

.contact-widget .widget-title {
  color: var(--white);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.contact-widget p {
  margin: 20px 0;
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
}

.contact-buttons {
  display: grid;
  gap: 15px;
  margin-top: 25px;
}

.contact-buttons .btn {
  padding: 12px 25px;
  border-radius: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--white);
  color: var(--primary-color);
}

.btn-outline-primary {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.contact-buttons .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Media Filter and Gallery Additional Styles */
.media-count {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: normal;
}

.media-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.filter-btn {
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.video-gallery-item {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  z-index: 1;
}

.video-placeholder {
  height: 120px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  border-radius: 8px;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.video-gallery-item:hover .video-overlay {
  opacity: 1;
}

.video-overlay i {
  color: white;
  font-size: 2rem;
  margin-bottom: 8px;
}

.video-overlay .duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
}

.media-type-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: white;
}

.media-type-indicator.video {
  background: #dc3545;
}

.media-type-indicator.image {
  background: #28a745;
}

.gallery-item.hidden {
  display: none;
}

.image-gallery-item {
  display: block;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

/* Mobile Gallery Styles */
.mobile-gallery-widget {
  background: var(--light-bg);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid #dee2e6;
}

.mobile-gallery-widget .widget-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

.mobile-gallery-widget .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
  max-height: 500px;
}

/* Modal styles */
.modal-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--white);
  border: none;
}

.modal-nav-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.modal-nav-btn i {
  font-size: 1.2rem;
  color: var(--text-color);
}

/* Animation Classes */
.animate-fade-down {
  opacity: 0;
  transform: translateY(-30px);
  animation: fadeDown 0.8s ease forwards;
}

.animate-fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease forwards;
}

.animate-fade-up.in-view,
.animate-fade-down.in-view {
  animation-play-state: running;
}

@keyframes fadeDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state for image comparison */
.image-comparison.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 2s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Utility classes */
.text-success {
  color: #28a745 !important;
}

.text-warning {
  color: #ffc107 !important;
}

/* Responsive Styles */
@media (max-width: 1199.98px) {
  .image-comparison {
    height: 400px;
  }

  .gallery-grid {
    max-height: 600px;
  }
}

@media (max-width: 991.98px) {
  .page-header {
    height: 50vh;
  }

  .page-title {
    font-size: 2.8rem;
  }

  .header-description {
    font-size: 1.1rem;
    padding: 0 20px;
  }

  .gallery-grid {
    max-height: 500px;
  }
  
  .image-comparison {
    height: 350px;
  }
  
  .slider-button {
    width: 45px;
    height: 45px;
  }
  
  .slider-button i {
    font-size: 16px;
  }
}

@media (max-width: 767.98px) {
  .page-header {
    height: 40vh;
    min-height: 400px;
  }

  .page-title {
    font-size: 2.2rem;
  }

  .header-description {
    font-size: 1rem;
  }

  .image-comparison {
    height: 300px;
  }

  .comparison-tabs {
    flex-wrap: wrap;
    gap: 10px;
  }

  .project-meta {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 20px;
  }

  .content-block {
    padding: 20px;
  }

  .gallery-widget,
  .stats-widget,
  .contact-widget {
    padding: 20px;
  }

  .gallery-grid {
    gap: 12px;
    max-height: 450px;
  }

  .widget-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }
  
  .mobile-gallery-widget .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .tab-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
  
  .slider-button {
    width: 40px;
    height: 40px;
  }
  
  .slider-button i {
    font-size: 14px;
  }
  
  .slider-line {
    width: 3px;
  }
  
  .image-label {
    font-size: 0.8rem;
    padding: 6px 15px;
    top: 15px;
  }
  
  .before-image .image-label {
    left: 15px;
  }
  
  .after-image .image-label {
    right: 15px;
  }
  
  .modal-nav-btn {
    width: 35px;
    height: 35px;
  }
  
  .modal-nav-btn i {
    font-size: 1rem;
  }
}

@media (max-width: 575.98px) {
  .page-header {
    min-height: 350px;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .image-comparison {
    height: 250px;
  }

  .comparison-tabs {
    gap: 8px;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .gallery-grid {
    max-height: 400px;
    gap: 10px;
  }

  .meta-item i {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .slider-button {
    width: 35px;
    height: 35px;
    border-width: 3px;
  }
  
  .slider-button i {
    font-size: 12px;
  }
  
  .slider-line {
    width: 2px;
  }
  
  .image-label {
    font-size: 0.75rem;
    padding: 5px 12px;
    top: 12px;
  }
  
  .before-image .image-label {
    left: 12px;
  }
  
  .after-image .image-label {
    right: 12px;
  }

  .content-block,
  .gallery-widget,
  .stats-widget,
  .contact-widget {
    padding: 15px;
  }
}