/* Modern Portfolio Styles */

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Modern Portfolio Grid */
.portfolio-section {
  min-height: 100vh;
  padding-bottom: var(--space-8);
}

/* Estilo das opções dentro do select */
#sort-select option {
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 10px; /* Alguns navegadores ignoram isso */
  padding: 0.5rem;
}

/* DEPRECATED: selectors archived — these rules are not referenced by HTML/JS
   Keep here for review or restore if needed. Remove to shrink CSS in production.

   #sort-select option
   .sort-select:focus
   .portfolio-stats
   .portfolio-stats i
   .stats-count

*/

/* archived: start */
/*
#sort-select option {
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 10px; /* Alguns navegadores ignoram isso */
  padding: 0.5rem;
}

.sort-select:focus {
  outline: none;
  border-color: rebeccapurple;
  box-shadow: 0 0 0 2px rgba(102, 51, 153, 0.5);
}

.portfolio-stats {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-light);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.3);
  padding: var(--space-2) var(--space-3);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  font-weight: 500;
}

.portfolio-stats i {
  color: var(--color-primary-light);
  font-size: 1rem;
}

.stats-count {
  color: var(--color-primary-light);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}
*/
/* archived: end */

/* Modern Grid Layout */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.portfolio-item {
  background: var(--color-dark-700);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
}

.portfolio-item:hover {
  transform: translateY(-8px);
}

.portfolio-img {
  position: relative;
  height: 390px;
  overflow: hidden;
}

.portfolio-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s ease;
}

.portfolio-item:hover .portfolio-img img {
  transform: scale(1.1);
}

.portfolio-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: all 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-info {
  justify-items: center;
  align-items: center;
  color: var(--color-light);
  transform: translateY(20px);
  transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-info {
  transform: translateY(0);
}

.portfolio-info h3 {
  font-size: 1.4rem;
  margin-bottom: var(--space-1);
  font-weight: 700;
}

.portfolio-info p {
  font-size: 0.9rem;
  margin-bottom: var(--space-3);
  opacity: 0.9;
}


.portfolio-link {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.portfolio-link:hover {
  background: var(--color-light);
  color: var(--color-primary);
  transform: scale(1.1);
}

/* Loading Animation */
.portfolio-loading {
  display: none;
  text-align: center;
  padding: var(--space-6);
  color: var(--color-gray);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-dark-600);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-2);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.portfolio-empty {
  display: none;
  text-align: center;
  padding: var(--space-8);
  color: var(--color-gray);
}

.portfolio-empty i {
  font-size: 4rem;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.portfolio-empty h3 {
  color: var(--color-light);
  margin-bottom: var(--space-2);
}

/* Gallery Modal - Enhanced */
.gallery-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(5px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.gallery-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  width: 98%;
  max-width: 1200px;
  max-height: 95vh;
  background-color: transparent;
  border-radius: 0;
  overflow: visible;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.close-modal {
  position: absolute;
  top: -20px;
  z-index: 10001;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.8);
  color: var(--color-light);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.close-modal:hover {
  background-color: var(--color-primary);
}

.gallery-container {
  padding: 0;
  height: 100%;
 
  flex-direction: column;
  gap: 0.9rem; /* ou até 0.25rem para bem próximo */
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-radius: 8px;
  flex-shrink: 0;
}

.gallery-header h3 {
  font-size: 1.5rem;
  color: var(--color-light);
  margin: 0;
}

.gallery-counter {
  font-size: 1rem;
  color: var(--color-gray);
  font-weight: 500;
}

.gallery-content {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 0;
}

.gallery-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70vh;
  max-height: 70vh;
  background-color: transparent;
  position: relative;
  touch-action: pan-y;
  cursor: grab;
}

.gallery-main:active {
  cursor: grabbing;
}

.gallery-main img {
  max-width: calc(100% - 120px);
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, opacity 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.gallery-main iframe {
  width: calc(100% - 120px);
  height: 100%;
  max-height: 500px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.gallery-main video {
  width: calc(100% - 120px);
  height: 100%;
  max-height: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background-color: #000;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.8);
  color: var(--color-light);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.gallery-nav:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

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

.gallery-nav:disabled:hover {
  background-color: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Swipe Indicator for Mobile */
.swipe-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: var(--color-light, #fff); /* valor padrão se a variável não existir */
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 15;
  animation: swipeHint 2s infinite, fadeOut 1s ease-in-out 4s forwards;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.swipe-indicator i {
  animation: swipeArrow 1.5s infinite;
}

@keyframes swipeHint {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes swipeArrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

.gallery-thumbnails {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  padding: var(--space-3) var(--space-4);
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.gallery-thumbnails::-webkit-scrollbar {
  height: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
  background: var(--color-dark-600);
  border-radius: 2px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 2px;
}

.thumbnail {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  position: relative;
}

.thumbnail.active {
  border-color: var(--color-primary);
}

.thumbnail:hover {
  transform: scale(1.05);
}

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

.thumbnail.video::after,
.thumbnail.youtube::after {
  content: '\f04b';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-light);
  font-size: 1rem;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* Mobile Responsive Design */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-3);
  }
  
  /* archived: portfolio-controls & filter groups - not used by current HTML/JS
  .portfolio-controls {
    padding: var(--space-4);
    gap: var(--space-4);
  }
  
  .filter-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
  }
  
  .filter-group {
    min-width: 200px;
  }

  .portfolio-stats {
    margin: 0 auto;
    justify-content: center;
  }
  */
}


@media (max-width: 768px) {

  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-3);
  }

  /* archived: portfolio-controls and filter UI for smaller screens
  .portfolio-controls {
    padding: var(--space-3);
    gap: var(--space-3);
  }

  .filter-row {
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }
  
  .filter-buttons {
    justify-content: center;
    padding: var(--space-);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .filter-buttons::-webkit-scrollbar {
    display: none;
  }
  .filter-btn {
    padding: var(--space-2) var(--space-2);
    font-size: 0.85rem;
    flex: 0 0 auto;
    text-align: center;
    min-width: 100px;
    white-space: nowrap;
  }

  .sort-select {
    width: 100%;
    min-width: auto;
    text-align: center;
    padding: var(--space-2) var(--space-4);
    font-size: 1rem;
  }

  .portfolio-stats {
    justify-content: center;
    margin: 0;
    padding: var(--space-2) var(--space-4);
    font-size: 0.9rem;
    text-align: center;
  }
  */

  .modal-content {
    width: 100%;
    max-height: 100vh;
  }

  .gallery-container {
    padding: 0;
  }

  .gallery-container {
    gap: 3rem;
  }
  
  /* Hide navigation arrows on mobile */
  .gallery-nav {
    display: none !important;
  }
  
  /* Show swipe indicator on mobile */
  .swipe-indicator {
    display: flex !important;
  }
  
  /* Full screen content on mobile */
  .gallery-main {
    height: 75vh;
    max-height: 75vh;
    touch-action: pan-x;
  }
  
  .gallery-main img {
    max-width: 95%;
    max-height: 95%;
  }
  
  .gallery-main iframe {
    width: 95%;
    max-height: 70vh;
  }
  
  .gallery-main video {
    width: 95%;
    max-height: 70vh;
  }
  
  /* Adjust close button for mobile */
  .close-modal {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  /* Adjust header for mobile */
  .gallery-header {
    padding: var(--space-2) var(--space-3);
    margin-top: 20px;
  }
  
  .gallery-header h3 {
    font-size: 1.5rem;
  }
  
  .gallery-counter {
    font-size: 1rem;
  }
  
  /* Adjust thumbnails for mobile */
  .gallery-thumbnails {
    justify-content: flex-start;
    padding: var(--space-2) var(--space-3);
  }
  
  .thumbnail {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  /* archived: small-screen filter UI
  .portfolio-controls {
    padding: var(--space-2);
    gap: var(--space-2);
  }

  .filter-buttons {
    gap: var(--space-1);
    padding: 4px;
  }

  .filter-btn {
    padding: 10px 5px;
    font-size: 0.8rem;
    min-width: 50px;
    border-radius: 8px;
  }

  .filter-row{
    margin: 10px 10px
  }

  .filter-label {
    font-size: 0.80rem;
    margin-bottom: 4px;
    
  }

  .sort-select {
    font-size: 0.9rem;
  }

  .portfolio-stats {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .portfolio-stats span {
    display: inline-block;
  }
  */

  .gallery-container {
    height: 100vh;
    max-height: 80vh;
  }

  .gallery-main img {
    max-width: 95%;
    max-height: 95%;
    margin-bottom: -70px;
  }

  .gallery-header {
    margin-bottom: -75px;
    margin-top: 10px;
  }
  
  .gallery-main {
    height: 70vh;
    max-height: 70vh;
  }
  
  .gallery-header h3 {
    font-size: 1.2rem;
  }
  
  .gallery-counter {
    font-size: 1rem;
  }
  
  .thumbnail {
    width: 45px;
    height: 45px;
  }
  
  .swipe-indicator {
    bottom: 2px;
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .portfolio-item {
    margin: 0 var(--space-2);
  }

  .gallery-main {
    height: 75vh;
    max-height: 75vh;
  }

  .swipe-indicator {
    bottom: 10px;
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}

@media (max-width: 360px) {
  .filter-btn {
    min-width: 10px;
  }

  .close-modal{
    right: 20px;
  }
  .gallery-container {
    height: 100vh;
    max-height: 85vh;
  }

  .gallery-main img {
    max-width: 95%;
    max-height: 95%;
    margin-bottom: -90px;
  }

   .gallery-header {
    margin-bottom: -65px;
    margin-top: 10px;
  }

  .gallery-thumbnails {
    margin-top: 30px;
  }
}

/* Animation for portfolio items */
.portfolio-item {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }
.portfolio-item:nth-child(3) { animation-delay: 0.3s; }
.portfolio-item:nth-child(4) { animation-delay: 0.4s; }
.portfolio-item:nth-child(5) { animation-delay: 0.5s; }
.portfolio-item:nth-child(6) { animation-delay: 0.6s; }
.portfolio-item:nth-child(7) { animation-delay: 0.7s; }
.portfolio-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Filter Animation */
.portfolio-item.filtering {
  transition: all 0.4s ease;
}

.portfolio-item.hide {
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  pointer-events: none;
}

.portfolio-item.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* Swipe Animation States */
.gallery-main.swiping img {
  transition: none;
}

.gallery-main img.swipe-left {
  transform: translateX(-20px);
  opacity: 0.7;
}

.gallery-main img.swipe-right {
  transform: translateX(20px);
  opacity: 0.7;
}