/* Portefólio Section Styling */
#portfolio {
  background-color: #212529; /* Dark background */
  padding-top: 120px;
  padding-bottom: 120px;
  overflow: hidden;
}

/* Small tag above the title */
.tagline {
  display: inline-block;
  padding: 0.35em 0.75em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #212529;
  background-color: #fff;
  border-radius: 50rem;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
}

/* Carousel Image Styling */
#portfolio .carousel-item img {
  border-radius: 0.5rem;
  border: 4px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease;
  object-fit: cover;
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Main large image sizing */
#portfolioCarousel .carousel-item .col-lg-8 img {
  height: 400px;
  max-height: 400px;
}

/* Smaller side images sizing */
#portfolioCarousel .carousel-item .col-lg-4 img {
  height: 190px;
  max-height: 190px;
}

#portfolio .carousel-item img:hover {
  transform: scale(1.02); /* Slight zoom on hover */
}

/* Custom Button Styling */
.btn-ver-mais {
  padding: 0.8rem 2.5rem;
  font-weight: 700;
  margin-top: 30px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 0.5rem;
  background-color: #db3545;
  border-color: #db3545;
  transition: background-color 0.3s, border-color 0.3s;
}

.btn-ver-mais:hover {
  background-color: #db3545;
  border-color: #db3545;
}

/* Carousel controls styling */
#portfolio .carousel-control-prev,
#portfolio .carousel-control-next {
  width: 5%;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  z-index: 5;
}

#portfolio .carousel-control-prev:hover,
#portfolio .carousel-control-next:hover,
#portfolio .carousel-control-prev:focus,
#portfolio .carousel-control-next:focus {
  opacity: 1;
}

#portfolio .carousel-control-prev-icon,
#portfolio .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

#portfolio .carousel-control-prev-icon:hover,
#portfolio .carousel-control-next-icon:hover {
  background-color: rgba(0, 0, 0, 0.6);
  transform: scale(1.1);
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
  #portfolio .carousel-control-prev,
  #portfolio .carousel-control-next {
    opacity: 0.9;
    width: 15%;
  }

  #portfolio .carousel-control-prev-icon,
  #portfolio .carousel-control-next-icon {
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
}

/* Carousel indicators styling */
#portfolio .carousel-indicators {
  bottom: -50px;
  margin-bottom: 0;
}

#portfolio .carousel-indicators [data-bs-target] {
  width: 30px;
  height: 4px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.4);
  border: none;
  transition: all 0.3s ease;
  margin: 0 4px;
}

#portfolio .carousel-indicators [data-bs-target].active {
  background-color: #dc3545;
  width: 40px;
}

/* Mobile-first responsive adjustments */
@media (max-width: 991.98px) {
  #portfolio {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  #portfolio .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #portfolio h2 {
    font-size: 2.5rem !important;
    line-height: 1.2;
    margin-bottom: 1.5rem !important;
  }

  #portfolio p.lead {
    font-size: 1.1rem;
    margin-bottom: 3rem !important;
  }

  /* Carousel mobile optimization */
  #portfolioCarousel {
    margin-bottom: 40px;
    max-width: 100%;
    overflow: hidden;
  }

  #portfolioCarousel .carousel-item .container-fluid {
    padding: 0 0.5rem;
    max-width: 100%;
    overflow: hidden;
  }

  #portfolioCarousel .carousel-item .row {
    margin: 0;
  }

  #portfolioCarousel .carousel-item .col-12 {
    padding: 0.25rem;
  }

  #portfolioCarousel .carousel-item .col-md-8 {
    margin-bottom: 1rem;
  }

  /* Mobile image sizing - melhorada */
  #portfolioCarousel .carousel-item .col-md-8 img {
    height: 300px;
    max-height: 300px;
    border-radius: 0.75rem;
  }

  #portfolioCarousel .carousel-item .col-md-4 .row {
    margin: 0;
  }

  #portfolioCarousel .carousel-item .col-md-4 .col-6 {
    padding: 0.25rem;
  }

  #portfolioCarousel .carousel-item .col-md-4 img {
    height: 140px;
    max-height: 140px;
    border-radius: 0.5rem;
  }

  #portfolio .carousel-item img {
    border: 3px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  /* Mobile carousel controls - melhorados */
  #portfolio .carousel-control-prev,
  #portfolio .carousel-control-next {
    width: 10%;
    opacity: 0.8;
  }

  #portfolio .carousel-control-prev-icon,
  #portfolio .carousel-control-next-icon {
    padding: 1.25rem;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
  }

  /* Mobile indicators */
  #portfolio .carousel-indicators {
    bottom: -40px;
  }

  #portfolio .carousel-indicators [data-bs-target] {
    width: 25px;
    height: 3px;
    margin: 0 3px;
  }

  #portfolio .carousel-indicators [data-bs-target].active {
    width: 35px;
  }

  .btn-ver-mais {
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    min-width: 240px;
    border-radius: 2rem;
  }
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
  #portfolio {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  #portfolio h2 {
    font-size: 1.8rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.3;
  }

  #portfolio p.lead {
    font-size: 1rem;
    margin-bottom: 2.5rem !important;
    padding: 0 1rem;
  }

  .tagline {
    font-size: 0.7em;
    padding: 0.3em 0.6em;
  }

  /* Extra small mobile carousel adjustments */
  #portfolioCarousel {
    margin-bottom: 30px;
  }

  #portfolioCarousel .carousel-item .container-fluid {
    padding: 0;
  }

  /* Extra small mobile image sizing - otimizada */
  #portfolioCarousel .carousel-item .col-md-8 img {
    height: 250px;
    max-height: 250px;
    border-radius: 1rem;
  }

  #portfolioCarousel .carousel-item .col-md-4 .row {
    margin-top: 1rem;
  }

  #portfolioCarousel .carousel-item .col-md-4 .col-6 {
    padding: 0.125rem;
  }

  #portfolioCarousel .carousel-item .col-md-4 img {
    height: 110px;
    max-height: 110px;
    border-radius: 0.75rem;
  }

  #portfolio .carousel-item img {
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

  /* Touch-friendly controls */
  #portfolio .carousel-control-prev,
  #portfolio .carousel-control-next {
    width: 12%;
    height: 100%;
    opacity: 0.9;
  }

  #portfolio .carousel-control-prev-icon,
  #portfolio .carousel-control-next-icon {
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
  }

  /* Mobile indicators - mais visíveis */
  #portfolio .carousel-indicators {
    bottom: -50px;
  }

  #portfolio .carousel-indicators [data-bs-target] {
    width: 20px;
    height: 3px;
    margin: 0 3px;
  }

  #portfolio .carousel-indicators [data-bs-target].active {
    width: 30px;
  }

  .btn-ver-mais {
    padding: 0.75rem 1.75rem;
    font-size: 0.85rem;
    width: 90%;
    max-width: 300px;
    border-radius: 2rem;
    margin: 0 auto;
    display: block;
    min-height: 48px; /* Touch target minimum size */
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Enhanced touch targets for mobile */
@media (max-width: 767.98px) {
  #portfolio .carousel-indicators [data-bs-target] {
    min-width: 44px;
    min-height: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  #portfolio .carousel-indicators [data-bs-target]::before {
    width: 20px;
    height: 3px;
    border-radius: 2px;
    background-color: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
  }

  #portfolio .carousel-indicators [data-bs-target].active::before {
    background-color: #dc3545;
    width: 30px;
  }
}

/* Swipe gestures enhancement */
#portfolioCarousel {
  touch-action: pan-y pinch-zoom;
}

#portfolioCarousel .carousel-inner {
  overflow: hidden;
}

/* Performance optimizations for mobile */
@media (max-width: 991.98px) {
  #portfolio .carousel-item img {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  #portfolioCarousel .carousel-item {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
}

/* Portfolio Modal - Premium Gallery Design */
#portfolioModal .modal-content {
  background: #000;
  height: 90vh;
  border-radius: 0;
  max-width: 100vw;
  overflow-x: hidden;
}

#portfolioModal .modal-body {
  height: 100%;
  overflow: hidden;
}

#portfolioModal .carousel {
  height: 100%;
}

#portfolioModal .carousel-inner {
  height: 100%;
}

#portfolioModal .carousel-item {
  height: 100%;
  position: relative;
}

#portfolioModal .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Navigation Arrows */
#portfolioModal .nav-arrow {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
}

#portfolioModal .nav-arrow:hover {
  background: rgba(220, 53, 69, 0.8);
  border-color: rgba(220, 53, 69, 1);
  transform: scale(1.1);
}

#portfolioModal .nav-arrow i {
  color: white;
  font-size: 20px;
}

#portfolioModal .carousel-control-prev,
#portfolioModal .carousel-control-next {
  width: auto;
  padding: 0 30px;
  opacity: 1;
  z-index: 12;
  margin-top: 100px;
}

#portfolioModal .carousel-control-prev {
  left: 0;
}

#portfolioModal .carousel-control-next {
  right: 0;
}

/* Image Counter */
#portfolioModal .image-counter {
  position: absolute;
  top: 30px;
  left: 30px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 0.5rem;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  z-index: 10;
}

/* Thumbnails */
#portfolioModal .thumbnails-container {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 10;
}

#portfolioModal .thumbnail {
  width: 80px;
  height: 60px;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  opacity: 0.6;
}

#portfolioModal .thumbnail.active {
  border-color: #dc3545;
  opacity: 1;
  transform: scale(1.1);
}

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

#portfolioModal .thumbnail:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Project Info Overlay */
#portfolioModal .project-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  padding: 60px 40px 20px;
  z-index: 15;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

#portfolioModal .project-overlay.show {
  transform: translateY(0);
}

#portfolioModal .project-info-card {
  max-width: 800px;
  text-align: center;
}

#portfolioModal .project-header {
  margin-bottom: 20px;
}

#portfolioModal .project-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: white;
}

#portfolioModal .project-tag {
  background: #dc3545;
  color: white;
  padding: 8px 20px;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#portfolioModal .project-description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
}

#portfolioModal .project-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

#portfolioModal .btn-primary-action {
  background: linear-gradient(45deg, #dc3545, #c82333);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  cursor: pointer;
  flex: 1;
  min-width: 200px;
}

#portfolioModal .btn-primary-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(220, 53, 69, 0.4);
}

#portfolioModal .btn-secondary-action {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 15px 30px;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  cursor: pointer;
  backdrop-filter: blur(10px);
  flex: 1;
  min-width: 200px;
}

#portfolioModal .btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

/* Close Button */
#portfolioModal .btn-close {
  font-weight: bold;
  width: 30px;
  height: 30px;
  background: rgb(0 0 0);
  border: 2px solid rgb(255 255 255);
  border-radius: 50%;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 25px;
}

#portfolioModal .btn-close:hover {
  background: rgba(220, 53, 69, 0.8);
  border-color: #dc3545;
  transform: scale(1.1);
  color: white;
}

#portfolioModal .btn-close:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
}

/* Info Toggle Button */
#portfolioModal .info-toggle {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 20;
}

#portfolioModal .info-toggle:hover {
  background: rgba(220, 53, 69, 0.8);
  border-color: #dc3545;
  transform: scale(1.1);
}

/* Responsive */
@media (max-width: 991px) {
  #portfolioModal .modal-content {
    height: 100vh;
    border-radius: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }

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

  #portfolioModal .thumbnails-container {
    bottom: 140px;
    gap: 10px;
  }

  #portfolioModal .thumbnail {
    width: 60px;
    height: 45px;
  }

  #portfolioModal .image-counter {
    top: 20px;
    left: 20px;
    padding: 8px 15px;
    font-size: 12px;
  }

  #portfolioModal .nav-arrow {
    width: 50px;
    height: 50px;
    bottom: 100px;
    position: relative;
  }

  #portfolioModal .nav-arrow i {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  #portfolioModal .project-overlay {
    padding: 40px 20px 70px;
  }

  #portfolioModal .project-title {
    font-size: 1.5rem;
  }

  #portfolioModal .project-description {
    font-size: 1rem;
  }

  #portfolioModal .thumbnails-container {
    display: none;
  }

  #portfolioModal .info-toggle {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }

  #portfolioModal .project-actions {
    flex-direction: column;
    gap: 10px;
  }

  #portfolioModal .btn-primary-action,
  #portfolioModal .btn-secondary-action {
    min-width: auto;
    width: 100%;
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#portfolioModal.show .project-info-card > * {
  animation: fadeInUp 0.6s ease forwards;
}

#portfolioModal.show .project-title {
  animation-delay: 0.1s;
}

#portfolioModal.show .project-tag {
  animation-delay: 0.2s;
}

#portfolioModal.show .project-description {
  animation-delay: 0.3s;
}

#portfolioModal.show .btn-contact {
  animation-delay: 0.4s;
}

/* Added when creating portfolio_final */
.more-images-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 2rem;
  opacity: 1;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.col-6:hover .more-images-overlay {
  background-color: rgba(0, 0, 0, 0.7);
}

.thumbnails-carousel-container {
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.thumbnail-control-prev,
.thumbnail-control-next {
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 50%;
  margin: 0 10px;
}

.thumbnail-control-prev {
  position: relative;
  right: 240px;
  top: 35px;
}

.thumbnail-control-next {
  position: relative;
  left: 240px;
  top: 35px;
}

.thumbnails-container {
  display: flex;
  gap: 10px;
  overflow: hidden;
  justify-content: center;
}

.thumbnail {
  width: 60px;
  height: 40px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.thumbnail.active {
  border-color: #fff;
}

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