/* ============================================================
   portfolio.css — Custom portfolio styles
   Adds About & Projects sections with card layout and modals,
   styled after the hluebbering.github.io reference portfolio.
   ============================================================ */

/* ---------- CSS custom properties ---------- */
:root {
  --pf-font: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --pf-bg: #f5f6fa;
  --pf-card: #ffffff;
  --pf-border: #e4e7ef;
  --pf-text: #1a1d2e;
  --pf-muted: #6b7280;
  --pf-accent: #4e65fd;
  --pf-accent-dark: #3a51e0;
  --pf-radius: 12px;
  --pf-radius-sm: 8px;
  --pf-shadow: 0 2px 16px rgba(0,0,0,0.07);
  --pf-shadow-hover: 0 8px 32px rgba(0,0,0,0.14);
  --pf-transition: 0.25s ease;
}

/* ---------- Section Tab Navigation ---------- */
.section-nav {
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: var(--pf-radius-sm);
  text-decoration: none;
  color: var(--pf-muted);
  font-family: var(--pf-font);
  font-size: 0.88em;
  font-weight: 500;
  transition: var(--pf-transition);
  border: none;
  cursor: pointer;
  background: transparent;
}

.nav-tab:hover {
  color: var(--pf-accent);
  background: rgba(78, 101, 253, 0.07);
  text-decoration: none;
}

.nav-tab.active {
  color: var(--pf-accent);
  background: rgba(78, 101, 253, 0.1);
  font-weight: 600;
}

.nav-tab i {
  font-size: 0.9em;
  width: 14px;
  text-align: center;
}

/* ---------- Portfolio Sections ---------- */
.portfolio-section {
  display: none;
  animation: pf-fade-in 0.3s ease;
}

.portfolio-section.active-section {
  display: block;
}

@keyframes pf-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Section Card Wrapper ---------- */
.section-card {
  background: var(--pf-card);
  border-radius: var(--pf-radius);
  padding: 28px 30px 32px;
  box-shadow: var(--pf-shadow);
  margin-top: 10px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--pf-border);
}

.section-header h2 {
  margin: 0;
  font-family: var(--pf-font);
  font-size: 1.35em;
  font-weight: 700;
  color: var(--pf-text);
}

.section-icon {
  color: var(--pf-accent);
  font-size: 1.1em;
}

/* ---------- Education Section ---------- */
.education-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.education-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.education-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(78, 101, 253, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pf-accent);
  font-size: 1em;
  margin-top: 2px;
}

.education-body {
  flex: 1;
  border-left: 2px solid var(--pf-border);
  padding-left: 16px;
}

.education-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.education-degree {
  font-family: var(--pf-font);
  font-size: 0.95em;
  font-weight: 700;
  color: var(--pf-text);
  margin: 0 0 3px;
  line-height: 1.4;
}

.education-institution {
  font-family: var(--pf-font);
  font-size: 0.83em;
  color: var(--pf-accent);
  font-weight: 500;
}

.education-years {
  font-family: var(--pf-font);
  font-size: 0.78em;
  color: var(--pf-muted);
  font-weight: 500;
  white-space: nowrap;
  background: var(--pf-bg);
  border: 1px solid var(--pf-border);
  border-radius: 20px;
  padding: 2px 10px;
  margin-top: 2px;
}

.education-description {
  font-family: var(--pf-font);
  font-size: 0.85em;
  color: var(--pf-muted);
  line-height: 1.65;
  margin: 6px 0 8px;
}

.education-details {
  margin: 6px 0 0;
  padding-left: 18px;
}

.education-details li {
  font-family: var(--pf-font);
  font-size: 0.82em;
  color: var(--pf-muted);
  line-height: 1.7;
  margin-bottom: 2px;
}

/* ---------- About Section ---------- */
.about-content {
  font-family: var(--pf-font);
  font-size: 0.93em;
  line-height: 1.75;
  color: var(--pf-text);
}

.about-content h3 {
  color: var(--pf-text);
  font-size: 1em;
  font-weight: 600;
  margin: 20px 0 8px;
}

.about-content ul {
  padding-left: 20px;
  margin: 4px 0 12px;
}

.about-content ul li {
  margin-bottom: 3px;
}

.about-content p:first-child {
  margin-top: 0;
}

/* ---------- Filter Menu ---------- */
.filter-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.f_btn label {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--pf-font);
  font-size: 0.8em;
  font-weight: 500;
  background: var(--pf-bg);
  color: var(--pf-muted);
  border: 1.5px solid var(--pf-border);
  transition: var(--pf-transition);
  user-select: none;
}

.f_btn label:hover {
  background: rgba(78, 101, 253, 0.07);
  border-color: var(--pf-accent);
  color: var(--pf-accent);
}

.f_btn input[type="radio"] {
  display: none;
}

.f_btn.active label {
  background: var(--pf-accent);
  border-color: var(--pf-accent);
  color: #fff;
}

/* ---------- Projects Grid ---------- */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* ---------- Project Card ---------- */
.my-item {
  cursor: pointer;
  outline: none;
}

.my-item.hidden {
  display: none;
}

.my-item:focus-visible .box-item-card {
  box-shadow: 0 0 0 3px var(--pf-accent);
}

.box-item-card {
  border-radius: var(--pf-radius);
  overflow: hidden;
  background: var(--pf-card);
  box-shadow: var(--pf-shadow);
  transition: transform var(--pf-transition), box-shadow var(--pf-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.my-item:hover .box-item-card {
  box-shadow: var(--pf-shadow-hover);
  transform: translateY(-3px);
}

.cases__preview {
  width: 100%;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1px;
  box-shadow: inset 0px -4px 2px rgba(243,245,246,0.35);
  position: relative;
}

.cases__pic {
  max-height: 100%;
  max-width: 100%;
  padding: 10px;
  object-fit: contain;
  position: absolute;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.cases__pic.active {
  opacity: 1;
  position: relative;
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 18px;
  z-index: 10;
  transition: background 0.3s ease;
  border-radius: 3px;
}

.slide-nav:hover {
  background: rgba(0, 0, 0, 0.7);
}

.slide-nav.prev {
  left: 5px;
}

.slide-nav.next {
  right: 5px;
}

.card-body {
  padding: 15px 16px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 0.7em;
  font-weight: 700;
  color: #fff;
  margin-bottom: 9px;
  font-family: var(--pf-font);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.proj-title {
  font-family: var(--pf-font);
  font-size: 0.9em;
  font-weight: 600;
  color: var(--pf-text);
  margin: 0 0 7px;
  line-height: 1.4;
}

.about-project {
  font-family: var(--pf-font);
  font-size: 0.8em;
  color: var(--pf-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 10px;
}

.card-details {
  font-size: 0.78em;
  color: var(--pf-muted);
  font-family: var(--pf-font);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-details i {
  font-size: 0.9em;
}

/* ---------- Project Detail Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 28, 0.65);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.modal-overlay.open {
  display: flex;
  animation: pf-fade-in 0.2s ease;
}

.modal-container {
  background: #fff;
  border-radius: var(--pf-radius);
  max-width: 580px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  animation: modal-slide-up 0.28s ease;
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255,255,255,0.85);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.1em;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--pf-transition);
  line-height: 1;
  color: var(--pf-text);
}

.modal-close:hover {
  background: rgba(255,255,255,1);
}

.modal-preview {
  height: 190px;
  border-radius: var(--pf-radius) var(--pf-radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-preview img {
  max-height: 100%;
  max-width: 85%;
  object-fit: contain;
  padding: 16px;
}

.modal-body {
  padding: 22px 26px 26px;
}

.modal-category {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.72em;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  font-family: var(--pf-font);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.modal-title {
  font-family: var(--pf-font);
  font-size: 1.2em;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--pf-text);
  line-height: 1.35;
}

.modal-description {
  font-family: var(--pf-font);
  font-size: 0.88em;
  line-height: 1.72;
  color: var(--pf-text);
  margin-bottom: 14px;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.modal-gallery img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  background: var(--pf-bg);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  padding: 8px;
  box-shadow: var(--pf-shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-gallery img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Lightbox styles */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10001;
  transition: opacity 0.3s ease;
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 15px 20px;
  cursor: pointer;
  font-size: 24px;
  z-index: 10001;
  transition: background 0.3s ease;
  border-radius: 5px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.prev {
  left: 30px;
}

.lightbox-nav.next {
  right: 30px;
}

.modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.tech-tag {
  padding: 3px 11px;
  background: var(--pf-bg);
  border: 1px solid var(--pf-border);
  border-radius: 6px;
  font-size: 0.78em;
  color: var(--pf-text);
  font-family: var(--pf-font);
  font-weight: 500;
}

.modal-details-list {
  padding-left: 18px;
  margin: 0 0 20px;
}

.modal-details-list li {
  font-family: var(--pf-font);
  font-size: 0.84em;
  color: var(--pf-muted);
  line-height: 1.7;
  margin-bottom: 2px;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: var(--pf-accent);
  color: #fff !important;
  border-radius: var(--pf-radius-sm);
  text-decoration: none !important;
  font-family: var(--pf-font);
  font-size: 0.88em;
  font-weight: 600;
  transition: background var(--pf-transition), transform var(--pf-transition);
}

.modal-link:hover {
  background: var(--pf-accent-dark);
  transform: translateY(-1px);
}

.modal-link.secondary {
  background: #6b7280;
}

.modal-link.secondary:hover {
  background: #4b5563;
}

/* ---------- Experience Section ---------- */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.experience-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.experience-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(78, 101, 253, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pf-accent);
  font-size: 1em;
  margin-top: 2px;
}

.experience-body {
  flex: 1;
  border-left: 2px solid var(--pf-border);
  padding-left: 16px;
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.experience-title {
  font-family: var(--pf-font);
  font-size: 0.95em;
  font-weight: 700;
  color: var(--pf-text);
  margin: 0 0 3px;
  line-height: 1.4;
}

.experience-company {
  font-family: var(--pf-font);
  font-size: 0.83em;
  color: var(--pf-accent);
  font-weight: 500;
}

.experience-dates {
  font-family: var(--pf-font);
  font-size: 0.78em;
  color: var(--pf-muted);
  font-weight: 500;
  white-space: nowrap;
  background: var(--pf-bg);
  border: 1px solid var(--pf-border);
  border-radius: 20px;
  padding: 2px 10px;
  margin-top: 2px;
}

.experience-details {
  margin: 6px 0 0;
  padding-left: 18px;
}

.experience-details li {
  font-family: var(--pf-font);
  font-size: 0.82em;
  color: var(--pf-muted);
  line-height: 1.7;
  margin-bottom: 2px;
}

.experience-details li a {
  color: var(--pf-accent);
  text-decoration: none;
}

.experience-details li a:hover {
  text-decoration: underline;
}

/* ---------- Skills Section ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.skill-group-card {
  border-radius: var(--pf-radius-sm);
  overflow: hidden;
  box-shadow: var(--pf-shadow);
  background: var(--pf-card);
  border: 1px solid var(--pf-border);
  transition: transform var(--pf-transition), box-shadow var(--pf-transition);
}

.skill-group-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pf-shadow-hover);
}

.skill-group-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--pf-font);
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.skill-group-header i {
  font-size: 1em;
  opacity: 0.92;
  flex-shrink: 0;
}

.skill-group-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px 14px;
}

.skill-tag {
  padding: 3px 11px;
  background: var(--pf-bg);
  border: 1px solid var(--pf-border);
  border-radius: 6px;
  font-size: 0.78em;
  color: var(--pf-text);
  font-family: var(--pf-font);
  font-weight: 500;
}

/* ---------- Profile photo override ---------- */
header img.profile-photo {
  border-radius: 50%;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border: 3px solid var(--pf-accent);
  display: block;
  margin: 8px 0 12px;
}

/* ---------- Job Titles Styling ---------- */
.job-titles {
  font-size: 0.85em;
  color: var(--pf-accent);
  font-weight: 600;
  line-height: 1.6;
  margin: 0;
  text-align: left;
  word-break: break-word;
}

/* ---------- Social Icons Styling ---------- */
.social-icons {
  display: flex;
  gap: 15px;
  margin: 8px 0;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pf-accent);
  color: #fff;
  text-decoration: none;
  font-size: 1.2em;
  transition: all var(--pf-transition);
}

.social-icons a:hover {
  background: var(--pf-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--pf-shadow);
}

/* ---------- Back to Top Button ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--pf-accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2em;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--pf-shadow-hover);
  transition: all var(--pf-transition);
  z-index: 1000;
}

.back-to-top:hover {
  background: var(--pf-accent-dark);
  transform: translateY(-3px);
}

.back-to-top.visible {
  display: flex;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 900px) {
  .section-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-tab {
    flex: 1;
    min-width: calc(33.33% - 4px);
    justify-content: center;
  }
  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 600px) {
  /* Prevent horizontal overflow */
  body, .wrapper {
    overflow-x: hidden;
  }

  .section-card {
    padding: 18px 14px 22px;
  }

  .section-header h2 {
    font-size: 1.15em;
  }

  .cards-container {
    grid-template-columns: 1fr;
  }

  /* Nav tabs: 3-per-row on medium-small screens */
  .section-nav {
    gap: 3px;
  }

  .nav-tab {
    min-width: calc(33.33% - 3px);
    font-size: 0.8em;
    padding: 8px 6px;
    gap: 5px;
  }

  /* Modal responsiveness */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-container {
    max-height: 90vh;
    border-radius: var(--pf-radius) var(--pf-radius) 0 0;
  }

  .modal-preview {
    height: 150px;
  }

  .modal-body {
    padding: 16px 14px 20px;
  }

  .modal-title {
    font-size: 1.05em;
  }

  .modal-links {
    flex-direction: column;
    gap: 8px;
  }

  .modal-link {
    justify-content: center;
    text-align: center;
  }

  /* Skills grid single column */
  .skills-grid {
    grid-template-columns: 1fr;
  }

  /* Education and experience layout */
  .education-item,
  .experience-item {
    gap: 10px;
  }

  .education-header,
  .experience-header {
    flex-direction: column;
    gap: 4px;
  }

  .education-years,
  .experience-dates {
    white-space: normal;
    align-self: flex-start;
  }

  /* Gallery single column on mobile */
  .modal-gallery {
    grid-template-columns: 1fr;
  }

  /* Back to top button position */
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 1em;
  }

  /* Profile photo sizing on mobile */
  header img.profile-photo {
    width: 90px;
    height: 90px;
    margin: 6px 0 10px;
  }

  /* Social icons on mobile */
  .social-icons {
    gap: 10px;
  }

  .social-icons a {
    width: 36px;
    height: 36px;
    font-size: 1.05em;
  }
}

@media (max-width: 400px) {
  /* Nav tabs: icon + very short text, 2 per row on tiny screens */
  .nav-tab {
    min-width: calc(50% - 3px);
    font-size: 0.76em;
    padding: 7px 4px;
  }

  .nav-tab i {
    font-size: 0.95em;
  }

  .section-card {
    padding: 14px 10px 18px;
  }

  .modal-overlay {
    padding: 6px;
  }
}

/* ---------- Make sidebar scroll with the page ---------- */
/* Override the minimal theme's fixed positioning so both
   the left sidebar and right content scroll together.     */
@media screen and (min-width: 961px) {
  div.wrapper > header {
    position: relative;
    float: left;
  }

  div.wrapper > footer {
    position: relative;
    bottom: auto;
  }
}

/* ---------- Mobile header alignment ---------- */
@media screen and (max-width: 960px) {
  div.wrapper > header {
    text-align: center;
  }

  header img.profile-photo {
    margin: 6px auto 10px;
  }

  .job-titles {
    text-align: center;
  }

  .social-icons {
    justify-content: center;
  }

  .section-nav {
    margin-top: 14px;
  }
}
