/* Portfolio Styles */
.portfolio-section {
  padding: 6rem 2rem 2rem !important; /* 상단에 헤더 공간 확보 */
  max-width: 1400px !important;
  margin: 0 auto !important;
  min-height: 100vh !important;
  height: auto !important;
  display: block !important;
}



.portfolio-header {
  margin-bottom: 3rem;
  text-align: center;
}

.portfolio-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.portfolio-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

#portfolio-search {
  min-width: 300px;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(15, 26, 47, 0.8);
  color: #f1f5f9;
  font-size: 1rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

#portfolio-search::placeholder {
  color: #94a3b8;
}

#portfolio-search:focus {
  outline: none;
  border-color: #7cc6ff;
  background: rgba(15, 26, 47, 0.9);
  box-shadow: 0 0 0 3px rgba(124, 198, 255, 0.1);
}

#portfolio-reset {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #e6edff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#portfolio-reset:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

#portfolio-reset:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 198, 255, 0.3);
}

/* === 보강: 카드 수평 그리드 강제 + 섹션 최대 폭 유지 === */
/* 기본 그리드 */
.portfolio-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap:20px;
}

/* 데스크톱에서 확실히 다단 보장 */
@media (min-width: 900px){
  .portfolio-grid{ grid-template-columns: repeat(2, 1fr) !important; }
}
@media (min-width: 1200px){
  .portfolio-grid{ grid-template-columns: repeat(3, 1fr) !important; }
}

/* 섹션 최대 폭 유지(가로폭 확보) */
.portfolio-section{
  max-width:1400px !important; margin:0 auto !important;
}

.card {
  background: rgba(15, 26, 47, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.25);
}

.card:focus-within {
  outline: 2px solid #7cc6ff;
  outline-offset: 2px;
}

.card-link {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #7cc6ff;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 10;
}

.card-link:hover {
  background: rgba(0, 0, 0, 0.9);
  color: #8dd1ff;
  transform: scale(1.1);
}

.thumb {
  height: 120px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
}

.thumb::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.card-meta {
  margin-bottom: 0.75rem;
}

.company {
  font-size: 1rem;
  font-weight: 600;
  color: #7cc6ff;
  margin-bottom: 0.25rem;
}

.period {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 500;
}

.role {
  font-size: 0.95rem;
  color: #e6edff;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e6edff;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.tag:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.tag.active {
  background: rgba(124, 198, 255, 0.2);
  border-color: #7cc6ff;
  color: #7cc6ff;
}

.tag:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 198, 255, 0.5);
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #94a3b8;
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1199px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 899px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }
  
  .portfolio-header h2 {
    font-size: 2rem;
  }
  
  #portfolio-search {
    min-width: 250px;
  }
}

@media (max-width: 599px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 0.5rem;
  }
  
  .portfolio-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  #portfolio-search {
    min-width: auto;
    width: 100%;
  }
  
  .portfolio-header h2 {
    font-size: 1.75rem;
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  .card-title {
    font-size: 1.1rem;
  }
}

/* Focus styles for accessibility */
.card:focus-visible {
  outline: 2px solid #7cc6ff;
  outline-offset: 2px;
}

.tag:focus-visible {
  outline: 2px solid #7cc6ff;
  outline-offset: 2px;
}

/* Loading state */
.portfolio-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animation for cards */
.card {
  animation: fadeInUp 0.6s ease-out;
}

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

/* Stagger animation for multiple cards */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }
.card:nth-child(9) { animation-delay: 0.9s; }
.card:nth-child(10) { animation-delay: 1.0s; }

/* ===== 수평 카드 그리드 강제 ===== */
/* 기본 그리드 */
.portfolio-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
  gap: 20px; 
}

/* 데스크톱에서 확실히 다단 보장 */
@media (min-width: 900px) { 
  .portfolio-grid { 
    grid-template-columns: repeat(2, 1fr) !important; 
  } 
}

@media (min-width: 1200px) { 
  .portfolio-grid { 
    grid-template-columns: repeat(3, 1fr) !important; 
  } 
}

/* 섹션 최대 폭 고정 */
.portfolio-section { 
  max-width: 1400px; 
  margin: 0 auto; 
}
