/* Triangle Home Repair Portfolio - Final UI Polish */

/* Main Wrapper */
.thr-portfolio-wrapper {
  font-family: "Inter", sans-serif !important;
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 20px;
  overflow: visible;
}

/* ============================================
   FILTER TABS - Clean horizontal scroll
   ============================================ */
.thr-hidden {
  display: none !important;
}

.thr-filter-container {
  margin-bottom: 40px;
  text-align: center;
}

.thr-filter-tabs {
  display: flex !important;
  gap: 12px !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 10px !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.thr-filter-tabs::-webkit-scrollbar {
  display: none;
}

.thr-tab {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 24px !important;
  background: #f5f3ff !important;
  color: #2a10f6 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.thr-tab svg {
  stroke: #2a10f6 !important;
  width: 18px !important;
  height: 18px !important;
}

.thr-tab:hover {
  background: #ede9fe !important;
}

.thr-tab.active {
  background: #fff1f2 !important;
  color: #d40006 !important;
}

.thr-tab.active svg {
  stroke: #d40006 !important;
}

/* ============================================
   GALLERY GRID - Modern Grid
   ============================================ */
.thr-gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 20px !important;
}

.thr-gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #eee;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.thr-gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.thr-project-image {
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.5s ease !important;
}

.thr-gallery-item:hover .thr-project-image {
  transform: scale(1.08);
}

/* ============================================
   BEFORE/AFTER SLIDER - Gallery Preview
   ============================================ */
.thr-before-after-preview {
  position: relative;
  width: 100%;
  cursor: pointer;
}

.thr-before-after-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  user-select: none;
}

.thr-before-image,
.thr-after-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.thr-before-image {
  clip-path: inset(0 50% 0 0);
}

.thr-slider-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}

.thr-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.2s ease;
}

.thr-slider-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.thr-slider-arrows {
  display: flex;
  gap: 2px;
  font-size: 20px;
  font-weight: bold;
  color: #2a10f6;
}

.thr-comparison-labels {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}

.thr-label-before,
.thr-label-after {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(5px);
}

/* ============================================
   LIGHTBOX - Modern Glassmorphism Redesign
   ============================================ */
.thr-lightbox-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9999999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.thr-lightbox-modal.active {
  display: flex !important;
  animation: thrFadeIn 0.3s ease-out;
}

.thr-lightbox-modal.closing {
  animation: thrFadeOut 0.25s ease-in forwards;
}

@keyframes thrFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes thrFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.thr-lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: center;
}

.thr-lb-image {
  width: 800px !important;
  max-width: 100% !important;
  height: 600px !important;
  max-height: 70vh !important;
  object-fit: contain !important;
  border-radius: 10px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  background: transparent !important;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Lightbox Before/After Comparison */
.thr-lb-comparison {
  width: 900px;
  max-width: 100%;
}

.thr-lb-before-after-container {
  position: relative;
  width: 100%;
  height: 600px;
  max-height: 70vh;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  user-select: none;
}

.thr-lb-before-image,
.thr-lb-after-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.thr-lb-before-image {
  clip-path: inset(0 50% 0 0);
}

.thr-lb-slider-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: white;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}

.thr-lb-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.2s ease;
}

.thr-lb-slider-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.thr-lb-slider-arrows {
  display: flex;
  gap: 3px;
  font-size: 24px;
  font-weight: bold;
  color: #2a10f6;
}

.thr-lb-comparison-labels {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}

.thr-lb-label-before,
.thr-lb-label-after {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

/* Close button - Top Right */
.thr-lb-close {
  position: absolute !important;
  top: -60px !important;
  right: 0 !important;
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  z-index: 1000 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.thr-lb-close:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: scale(1.1) !important;
}

/* Footer Navigation - Centered together */
.thr-lb-footer {
  margin-top: 25px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 15px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  padding: 6px 12px !important;
  border-radius: 40px !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.thr-lb-nav {
  background: transparent !important;
  border: none !important;
  color: white !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}

.thr-lb-nav:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

.thr-lb-counter {
  color: white !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  min-width: 50px !important;
  text-align: center !important;
}

.thr-lb-close svg,
.thr-lb-nav svg {
  width: 20px !important;
  height: 20px !important;
  stroke: white !important;
  stroke-width: 2 !important;
  display: block !important;
}

/* ============================================
   RESPONSIVE FIXES
   ============================================ */
@media (max-width: 1024px) {
  .thr-lb-image {
    width: 90vw !important;
    height: auto !important;
    aspect-ratio: 4 / 3 !important;
  }

  .thr-lb-comparison {
    width: 90vw;
  }

  .thr-lb-before-after-container {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .thr-lb-close {
    top: -45px !important;
    right: 0 !important;
    width: 36px !important;
    height: 36px !important;
  }

  .thr-lb-footer {
    margin-top: 15px !important;
    padding: 4px 10px !important;
    gap: 10px !important;
  }
}

@media (max-width: 768px) {
  .thr-filter-tabs {
    justify-content: flex-start !important;
  }

  .thr-tab {
    padding: 8px 16px !important;
    font-size: 13px !important;
  }

  .thr-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  }

  .thr-hide-mobile {
    display: none !important;
  }

  .thr-slider-handle {
    width: 40px;
    height: 40px;
  }

  .thr-lb-slider-handle {
    width: 50px;
    height: 50px;
  }
}