/* ==========================================================================
   作品集頁面樣式 - 純粹黑白極簡風 (Pure Monochrome Portfolio)
   ========================================================================== */

.portfolio-header {
  margin-bottom: 32px;
}

.portfolio-header h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
}

.portfolio-header p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* 控制列：分類標籤與搜尋框 */
.portfolio-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.tab-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  font-weight: 600;
}

.tab-count {
  font-size: 0.75rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}

.tab-btn.active .tab-count {
  background: rgba(0, 0, 0, 0.18);
  color: #000000;
}

.search-bar-wrap {
  position: relative;
  max-width: 480px;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 40px 11px 38px;
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  display: none;
}

.search-clear:hover {
  color: #ffffff;
}

/* 作品網格佈局 */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

/* 作品卡片 */
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.project-thumb-wrap {
  width: 100%;
  height: 190px;
  background: #181818;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
}

.project-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-thumb {
  transform: scale(1.04);
}

.project-thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
}

.project-thumb-placeholder i {
  font-size: 2.8rem;
  color: rgba(255, 255, 255, 0.2);
  transition: color 0.3s ease;
}

.project-card:hover .project-thumb-placeholder i {
  color: rgba(255, 255, 255, 0.5);
}

.project-badge-featured {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #0a0a0a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.project-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.project-category-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-date {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.project-card-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  line-height: 1.4;
  font-family: 'Space Grotesk', 'Noto Sans TC', sans-serif;
}

.project-card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 14px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 18px 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.project-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.76rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.project-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.btn-card {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-card-primary {
  background: #ffffff;
  color: #0a0a0a;
  border: 1px solid #ffffff;
}

.btn-card-primary:hover {
  background: #e2e2e2;
  color: #000000;
}

.btn-card-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-card-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

/* 空狀態 */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--text-faint);
}

/* 詳情彈窗 (Modal) */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.project-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content-card {
  background: #141414;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.25s ease;
}

.project-modal.active .modal-content-card {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: 32px;
}

.modal-category-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
  padding-right: 40px;
  font-family: 'Space Grotesk', 'Noto Sans TC', sans-serif;
}

.modal-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.modal-hero-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--border-subtle);
}

.modal-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  margin: 20px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 20px;
  white-space: pre-line;
}

.modal-features-list {
  margin: 0 0 24px 0;
  padding-left: 20px;
  color: var(--text-secondary);
}

.modal-features-list li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.modal-footer-actions {
  display: flex;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* 響應式微調 */
@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .modal-body {
    padding: 24px 18px;
  }
  .modal-title {
    font-size: 1.35rem;
  }
}
