/* Portfolio: each link in its own box */
.portfolio-link-group {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  padding: 10px 16px;
  margin: 8px 0 0 0;
  max-width: 260px;
  display: inline-block;
}
/* Education section: group and box layout */
.education-boxes {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.education-group {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  max-width: 520px;
  width: 100%;
  margin-left: 0;
  margin-right: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.education-institution {
  font-size: 1.08em;
  font-weight: bold;
}
.education-degree {
  font-size: 1em;
}
.education-date {
  font-size: 0.98em;
  color: #666;
}
/* Portfolio section: group and box layout */
.portfolio-boxes {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.portfolio-group {
  display: flex;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  max-width: 700px;
  width: 100%;
  margin-left: 0;
  margin-right: auto;
  overflow: hidden;
}
.portfolio-img {
  flex: 0 0 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  min-height: 120px;
  max-height: 120px;
  min-width: 120px;
  max-width: 120px;
}
.portfolio-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.portfolio-content {
  flex: 1 1 auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.portfolio-title {
  font-size: 1em;
  font-weight: bold;
  margin-bottom: 6px;
}
.portfolio-desc {
  font-size: 1em;
}
.portfolio-note {
  margin-top: 18px;
  font-size: 0.98em;
}
/* Experience section: group and box layout */
.experience-boxes {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.experience-group {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 18px 20px;
  font-size: 1em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  max-width: 720px;
  width: 100%;
  margin-left: 0;
  margin-right: auto;
}
.experience-heading {
  font-size: 1.08em;
  margin-bottom: 6px;
}
.experience-list {
  margin-left: 1.5em;
  margin-bottom: 0;
}
/* Shrink skill-group horizontally and center */
.skills-boxes {
  flex-direction: column;
}
.skill-group {
  max-width: 720px;
  width: 100%;
  margin-left: 0;
  margin-right: auto;
}
/* Skills section: group and tag layout */
.skill-group {
  margin-bottom: 22px;
}
.skill-heading {
  font-size: 1.08em;
  margin-bottom: 6px;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.skill-tag {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 1em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  display: inline-block;
  margin-bottom: 2px;
}
/* Skills section: individual skill boxes */
.skills-boxes {
  display: flex;
  flex-wrap: wrap;
}
.skill-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 18px 20px;
  font-size: 1em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  flex: 1 1 320px;
  min-width: 260px;
  max-width: 100%;
}
/* Make the Home section thinner and centered */
.main-content .section1.p-30#Home {
  max-width: 900px;
  margin-left: 0;
  margin-right: auto;
}
/* Add right margin to the main page container */
.container {
  margin-right: 30px;
}
/* General text container width for main content sections */
.main-content .text {
  width: 100%;
}
/* Home section contact info alignment */
.pr-list .pr-item {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}
.pr-list .pr-item:last-child {
  margin-bottom: 0;
}
.pr-list .pr-item i {
  min-width: 20px;
}
.pr-list .pr-item span {
  margin-left: 10px;
}
/* Shrink the copyright text in the left footer to match the email size */
.left-footer .copy-rights {
  font-size: 14px;
}
/* Shrink the email text in the left footer to prevent clipping */
.foot-contact ul li {
  font-size: 14px;
}
/* Add left padding to only the email in the left-footer */
.foot-contact ul {
  padding-left: 32px !important;
}
/* Remove left padding from .pro-details so section headers are not indented */
.user-profile .pro-details {
  padding-left: 0 !important;
}

/* Modal Overlay and Popup Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Download panels for CG Texture Upscaler modal */
.download-panels {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  margin: 18px 0 12px;
  flex-wrap: wrap;
}

.download-panel {
  background: #222; /* dark background */
  color: #f5f5f5;   /* light text */
  width: 320px;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.download-panel .panel-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin-bottom: 12px;
}

.download-panel .panel-heading {
  font-size: 1.15rem;
  line-height: 1.1;
  margin-bottom: 8px;
  color: #fff;
}

.download-panel .panel-heading strong {
  font-weight: 300; /* light weight */
  font-size: 1.25rem; /* make <strong> look like a heading */
  display: block;
}

.download-panel .panel-sub {
  font-weight: 400;
  font-size: 0.95rem;
  color: #dcdcdc;
}

.download-panel .panel-details {
  font-size: 0.95rem;
  color: #ddd;
  margin: 12px 0 16px;
}

.btn-download {
  display: inline-block;
  background: #ff7a18;
  color: #111;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

.btn-download:hover {
  filter: brightness(0.95);
}

.imagemagick-note {
  margin-top: 12px;
  font-size: 0.95rem;
}

@media (max-width: 700px) {
  .download-panels {
    flex-direction: column;
    align-items: center;
  }
  .download-panel {
    width: 100%;
    max-width: 480px;
  }
}

.modal-content {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  margin: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9f9f9;
  border-radius: 8px 8px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3em;
  font-weight: bold;
  color: #222;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.close-btn:hover {
  background-color: #f0f0f0;
  color: #000;
}

.modal-body {
  padding: 24px;
  line-height: 1.6;
}

/* Small inline external link icon used next to outbound links */
.external-link-icon {
  display: inline-block;
  vertical-align: text-bottom;
  margin-left: 6px;
  color: inherit;
}

/* Bottom-centered scroll-to-top arrow inside modals */
.modal-scroll-top {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1200;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* Section toggle link (semantic anchor styled as a link) */
.section-toggle-link {
  display: inline-block;
  margin-top: 14px;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.section-toggle-wrap {
  /* left-aligned by default; remove inline styles from HTML */
  text-align: left;
  margin-top: 8px;
}

.section-toggle-link[aria-expanded="true"] {
  /* when expanded, optionally emphasize the 'See less' state */
  text-decoration: none;
}
.modal-scroll-top:hover { transform: translateX(-50%) scale(1.05); }
.modal-scroll-top svg { width: 18px; height: 18px; }

/* Hide when modal content is short (no scroll) — JS will toggle 'hidden' class */
.modal-scroll-top.hidden { opacity: 0; pointer-events: none; }

/* Overlay-anchored scroll-to-top button (sits at bottom center of modal overlay) */
.overlay-scroll-top {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2000; /* above modal-overlay (1000) */
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.overlay-scroll-top svg { width: 20px; height: 20px; }

/* Image comparison slider styles */
.img-compare {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 12px 0 18px 0;
  user-select: none;
  touch-action: none;
}
.img-compare {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 12px 0 18px 0;
  user-select: none;
  touch-action: none;
  display: block;
}
/* bottom image (after) defines layout */
.img-compare .compare-after {
  display: block;
  width: 100%;
  height: auto;
}
/* top image (before) sits absolutely on top, same size as after, but is clipped using clip-path */
.img-compare .compare-before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  pointer-events: none; /* clicks go to container */
  clip-path: inset(0 50% 0 0); /* start clipped to 50% */
}
.img-compare .compare-handle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: 4px;
  background: rgba(255,255,255,0.8);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  cursor: ew-resize;
}
.img-compare .compare-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-compare .compare-handle:focus {
  outline: 2px solid #4d90fe;
}

/* Small screens: stack images responsively and increase handle width for touch */
@media (max-width: 480px) {
  .img-compare .compare-handle {
    width: 12px;
  }
}

/* Carousel component (reusable) */
.carousel {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 12px 0 18px 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}
.carousel-track {
  display: flex;
  transition: transform 250ms ease;
  will-change: transform;
}
.carousel-slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.carousel-slide img {
  max-width: 100%;
  height: auto;
  object-fit: contain; /* fit to carousel */
  display: block;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.08);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-btn:focus { outline: 2px solid #4d90fe; }
.carousel-caption {
  padding: 8px 12px;
  font-size: 0.95em;
  color: #333;
  background: rgba(255,255,255,0.9);
  border-top: 1px solid #eee;
}

.modal-body h3 {
  font-size: 1.1em;
  font-weight: bold;
  margin: 20px 0 10px 0;
  color: #222;
}

.modal-body p {
  margin-bottom: 16px;
}

.modal-body ul {
  margin: 16px 0;
  padding-left: 24px;
}

.modal-body li {
  margin-bottom: 8px;
}

.modal-body hr {
  border: none;
  height: 1px;
  background-color: #e0e0e0;
  margin: 24px 0;
}

.modal-image {
  max-width: 100%;
  height: auto;
  margin: 16px 0;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

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

.modal-links a {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 16px;
  text-decoration: none;
  color: #333;
  font-size: 0.9em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.modal-links a:hover {
  background: #f5f5f5;
  border-color: #ccc;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.youtube-embed {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  text-align: center;
  border: none;
}

.youtube-embed iframe {
  width: 560px;
  height: 315px;
  border: none;
}

/* Button styling for See More buttons */
.see-more-btn {
  background: #fff;
  border: none !important;
  border-radius: 8px;
  padding: 0px;
  font-size: 1em;
  color: #333;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 0.2s;
  text-decoration: none;
}

.see-more-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 10px;
  }
  
  .modal-content {
    max-width: 100%;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .youtube-embed iframe {
    height: 200px;
  }
}