/* =============================================
   TOONFOLIO - Portfolio Page Styles
   ============================================= */

/* ===== PAGE BASE ===== */
.pf-page { background: var(--slate-50); }

/* ===== HERO ===== */
.pf-hero {
  padding: 120px 0 60px;
  background: linear-gradient(160deg, var(--slate-900) 0%, #1e2d5a 60%, var(--slate-800) 100%);
  position: relative;
  overflow: hidden;
}
.pf-hero-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 50px 50px;
}
.pf-hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.pf-hero-text { color: var(--white); }
.pf-hero-text .section-badge {
  background: rgba(96,165,250,0.15);
  border-color: rgba(96,165,250,0.3);
  color: var(--blue-200);
  margin-bottom: 16px;
}
.pf-hero-text h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--white);
}
.pf-hero-text p {
  font-size: 16px;
  color: rgba(255,255,255,0.65);
  line-height: 1.8;
}
.pf-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===== ACTIVE NAV LINK ===== */
.nav-links a.active-link {
  color: var(--blue-600) !important;
  background: var(--blue-50) !important;
}

/* ===== FILTER BAR ===== */
.pf-filter-section {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  padding: 20px 0;
  position: sticky;
  top: 68px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.pf-filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.pf-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 260px;
  flex: 1;
  max-width: 360px;
}
.pf-search-wrap .fas.fa-search {
  position: absolute;
  left: 14px;
  color: var(--slate-400);
  font-size: 14px;
  pointer-events: none;
}
.pf-search-wrap input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--slate-800);
  background: var(--slate-50);
  outline: none;
  transition: var(--transition);
  font-family: var(--font-ko);
}
.pf-search-wrap input:focus {
  border-color: var(--blue-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.pf-clear-btn {
  position: absolute; right: 12px;
  color: var(--slate-400); font-size: 13px;
  cursor: pointer; padding: 4px;
  transition: var(--transition);
}
.pf-clear-btn:hover { color: var(--slate-700); }

.pf-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.pf-chip {
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--slate-200);
  color: var(--slate-600);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.pf-chip:hover { border-color: var(--blue-300); color: var(--blue-600); }
.pf-chip.active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: var(--white);
}

.pf-filter-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pf-select {
  padding: 9px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--slate-700);
  background: var(--white);
  outline: none;
  cursor: pointer;
  font-family: var(--font-ko);
  transition: var(--transition);
}
.pf-select:focus { border-color: var(--blue-400); }
.pf-view-toggle { display: flex; gap: 4px; }
.pf-view-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  color: var(--slate-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: var(--transition);
  cursor: pointer;
}
.pf-view-btn:hover { border-color: var(--blue-300); color: var(--blue-600); }
.pf-view-btn.active { background: var(--blue-600); border-color: var(--blue-600); color: var(--white); }

.pf-result-count {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 12px;
}

/* ===== GALLERY ===== */
.pf-gallery-section { padding: 40px 0 80px; }

.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  transition: var(--transition);
}
.pf-grid.list-view {
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ===== PORTFOLIO CARD ===== */
.pf-card {
  background: var(--white);
  border: 1.5px solid var(--slate-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  animation: fadeInUp 0.4s ease forwards;
}
.pf-card:hover {
  border-color: var(--blue-200);
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}
.pf-card-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, var(--slate-200), var(--slate-100));
}
.pf-card-thumb-placeholder {
  width: 100%; height: 220px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, var(--blue-50), var(--slate-100));
  color: var(--blue-300);
}
.pf-card-available {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(34,197,94,0.9);
  color: white;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.pf-card-available.unavailable {
  background: rgba(100,116,139,0.8);
}
.pf-card-body { padding: 20px; }
.pf-card-genre {
  display: inline-block;
  background: var(--blue-50);
  color: var(--blue-600);
  border: 1px solid var(--blue-200);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.pf-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-card-author {
  font-size: 14px;
  color: var(--slate-500);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pf-card-author .fas { color: var(--blue-400); font-size: 12px; }
.pf-card-desc {
  font-size: 13px;
  color: var(--slate-500);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.pf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--slate-100);
}
.pf-card-career {
  font-size: 12px;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  gap: 4px;
}
.pf-card-career .fas { color: var(--slate-400); }
.pf-card-views {
  font-size: 12px;
  color: var(--slate-400);
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-en);
}
.pf-card-skills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pf-skill-tag {
  background: var(--slate-100);
  color: var(--slate-600);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
}

/* List View Card */
.pf-grid.list-view .pf-card {
  display: flex;
  flex-direction: row;
}
.pf-grid.list-view .pf-card-thumb,
.pf-grid.list-view .pf-card-thumb-placeholder {
  width: 140px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 0;
}
.pf-grid.list-view .pf-card-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
}
.pf-grid.list-view .pf-card-desc { display: none; }
.pf-grid.list-view .pf-card-available {
  top: 10px; right: 10px;
}

/* ===== EMPTY / LOADING ===== */
.pf-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 0;
  color: var(--slate-400);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.pf-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 0;
  color: var(--slate-400);
}
.pf-empty .fas { font-size: 48px; margin-bottom: 16px; opacity: 0.3; display: block; }
.pf-empty p { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--slate-500); }
.pf-empty span { font-size: 14px; color: var(--slate-400); }

/* ===== PAGINATION ===== */
.pf-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}
.pf-page-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  color: var(--slate-600);
  font-size: 14px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}
.pf-page-btn:hover { border-color: var(--blue-300); color: var(--blue-600); }
.pf-page-btn.active { background: var(--blue-600); border-color: var(--blue-600); color: var(--white); }
.pf-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== INDEX PREVIEW ===== */
.portfolio-preview-section {
  padding: 100px 0;
  background: var(--slate-50);
}
.pf-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}
.pf-preview-more {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== REGISTER SECTION ===== */
.pf-register-section {
  padding: 100px 0;
  background: var(--white);
}
.pf-reg-wrap {
  max-width: 760px;
  margin: 0 auto;
}
.pf-reg-form {
  background: var(--white);
  border: 1.5px solid var(--slate-100);
  border-radius: var(--radius-xl);
  padding: 44px 48px;
  box-shadow: var(--shadow-lg);
}
.pf-reg-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-700);
  padding: 10px 14px;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid var(--blue-500);
}
.pf-reg-section-title:first-child { margin-top: 0; }
.pf-reg-section-title .fas { color: var(--blue-500); }

.pf-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.pf-form-group { margin-bottom: 20px; }
.pf-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 8px;
}
.req { color: #ef4444; }
.pf-hint { font-size: 11px; color: var(--slate-400); font-weight: 400; margin-left: 4px; }
.pf-form-group input,
.pf-form-group select,
.pf-form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--slate-800);
  transition: var(--transition);
  outline: none;
  font-family: var(--font-ko);
}
.pf-form-group input:focus,
.pf-form-group select:focus,
.pf-form-group textarea:focus {
  border-color: var(--blue-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.pf-form-group textarea { resize: vertical; min-height: 120px; }
.pf-char-count { text-align: right; font-size: 12px; color: var(--slate-400); margin-top: 4px; }

.pf-pw-wrap { position: relative; display: flex; align-items: center; }
.pf-pw-wrap input { padding-right: 44px; }
.pf-pw-eye {
  position: absolute; right: 12px;
  color: var(--slate-400); font-size: 14px;
  cursor: pointer; padding: 4px;
  transition: var(--transition);
}
.pf-pw-eye:hover { color: var(--slate-700); }

.pf-img-preview {
  margin-top: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 120px;
}
.pf-img-preview img { width: 100%; height: 120px; object-fit: cover; display: block; }

/* Toggle Switch */
.pf-toggle-label {
  display: flex !important;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 500 !important;
}
.pf-toggle-label input[type="checkbox"] { display: none; }
.pf-toggle-switch {
  width: 44px; height: 24px;
  background: var(--slate-300);
  border-radius: 100px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}
.pf-toggle-switch::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: var(--white);
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.pf-toggle-label input:checked + .pf-toggle-switch {
  background: var(--blue-600);
}
.pf-toggle-label input:checked + .pf-toggle-switch::after {
  left: 23px;
}
.pf-toggle-text { font-size: 14px; color: var(--slate-700); }
.pf-available-group { margin-top: 4px; }
.pf-form-actions { margin-top: 8px; }

/* ===== PORTFOLIO DETAIL MODAL ===== */
.pf-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.pf-modal-overlay.open { opacity: 1; pointer-events: all; }
.pf-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.2);
  position: relative;
  transform: translateY(24px) scale(0.97);
  transition: var(--transition);
}
.pf-modal-overlay.open .pf-modal { transform: translateY(0) scale(1); }
.pf-modal-sm { max-width: 440px; }
.pf-modal-lg { max-width: 680px; }

.pf-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--slate-100);
  color: var(--slate-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  z-index: 1;
  transition: var(--transition);
}
.pf-modal-close:hover { background: var(--slate-200); color: var(--slate-900); }

/* Detail Modal Body */
.pf-modal-body { padding: 36px; }
.pf-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pf-modal-title .fas { color: var(--blue-500); }
.pf-modal-sub { font-size: 14px; color: var(--slate-500); margin-bottom: 24px; line-height: 1.6; }

.pf-detail-header {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--slate-100);
}
.pf-detail-thumb {
  width: 160px;
  height: 200px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-50), var(--slate-100));
}
.pf-detail-thumb-placeholder {
  width: 160px; height: 200px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue-50), var(--slate-100));
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  color: var(--blue-300);
  flex-shrink: 0;
}
.pf-detail-info { flex: 1; }
.pf-detail-genre {
  display: inline-block;
  background: var(--blue-50); color: var(--blue-600);
  border: 1px solid var(--blue-200);
  padding: 4px 12px; border-radius: 100px;
  font-size: 12px; font-weight: 600; margin-bottom: 12px;
}
.pf-detail-title { font-size: 26px; font-weight: 800; color: var(--slate-900); margin-bottom: 6px; }
.pf-detail-author {
  font-size: 15px; color: var(--slate-600); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.pf-detail-author .fas { color: var(--blue-400); }
.pf-detail-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.pf-detail-meta-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--slate-600);
}
.pf-detail-meta-item .fas { color: var(--slate-400); font-size: 12px; }
.pf-detail-available {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,197,94,0.1); color: #16a34a;
  border: 1px solid rgba(34,197,94,0.25);
  padding: 6px 14px; border-radius: 100px;
  font-size: 13px; font-weight: 600;
}
.pf-detail-available.off {
  background: var(--slate-100); color: var(--slate-500);
  border-color: var(--slate-200);
}
.pf-detail-section { margin-bottom: 24px; }
.pf-detail-section h4 {
  font-size: 14px; font-weight: 700; color: var(--slate-700);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.pf-detail-section h4 .fas { color: var(--blue-500); font-size: 12px; }
.pf-detail-desc { font-size: 15px; color: var(--slate-600); line-height: 1.8; }
.pf-detail-actions {
  display: flex; gap: 12px; margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--slate-100);
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
}

/* Modal input */
.pf-modal-input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--slate-800);
  background: var(--slate-50);
  outline: none;
  transition: var(--transition);
  font-family: var(--font-ko);
}
.pf-modal-input:focus {
  border-color: var(--blue-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.pf-modal-err {
  font-size: 13px; color: #ef4444;
  margin-bottom: 12px; min-height: 20px;
  display: flex; align-items: center; gap: 6px;
}
.pf-delete-icon {
  width: 56px; height: 56px;
  background: rgba(239,68,68,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #ef4444;
  margin: 0 auto 16px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 30px; right: 30px;
  background: var(--slate-900); color: var(--white);
  padding: 14px 22px;
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(80px); opacity: 0;
  transition: var(--transition);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast .fa-check-circle { color: #22c55e; font-size: 18px; }
.toast .fa-exclamation-circle { color: #f59e0b; font-size: 18px; }
.toast .fa-times-circle { color: #ef4444; font-size: 18px; }

/* ===== SCROLL TOP ===== */
.scroll-top {
  position: fixed; bottom: 30px; right: 30px;
  width: 46px; height: 46px;
  background: var(--blue-600); color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
  transition: var(--transition);
  opacity: 0; pointer-events: none; z-index: 500;
}
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { transform: translateY(-3px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
  .pf-preview-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .pf-filter-bar { flex-direction: column; align-items: stretch; }
  .pf-search-wrap { max-width: 100%; }
  .pf-filter-chips { justify-content: flex-start; }
  .pf-filter-right { justify-content: flex-end; }
  .pf-grid, .pf-preview-grid { grid-template-columns: 1fr; }
  .pf-grid.list-view .pf-card { flex-direction: column; }
  .pf-grid.list-view .pf-card-thumb,
  .pf-grid.list-view .pf-card-thumb-placeholder { width: 100%; height: 180px; }
  .pf-reg-form { padding: 28px 24px; }
  .pf-form-row { grid-template-columns: 1fr; }
  .pf-hero-inner { flex-direction: column; }
  .pf-detail-header { flex-direction: column; }
  .pf-detail-thumb, .pf-detail-thumb-placeholder { width: 100%; height: 200px; }
  .pf-detail-actions { flex-direction: column; }
}
