/* Portfolio Gallery Custom Styles */

/* Override any global constraints for portfolio pages */
body:has(.portfolio-main) {
  max-width: none !important;
  overflow-x: hidden;
}

body:has(.portfolio-main) main {
  max-width: none !important;
  margin: 0 !important;
  width: 100% !important;
}

.portfolio-main {
  padding-bottom: 4rem; /* Extra space for footer */
  max-width: none !important; /* Remove any max-width constraints */
  margin: 0 !important; /* Remove auto centering margins */
  width: 100% !important; /* Use full width */
  padding-left: 1rem; /* Reduced padding for better alignment */
  padding-right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align everything to the left */
}

.portfolio-header {
  width: 100%;
  display: flex;
  align-items: center; /* Align logo and text vertically */
  gap: 1rem; /* Space between logo and text */
  text-align: left; /* Align header text to the left */
  margin-bottom: 0.5rem; /* Reduced further from 1rem */
}

.portfolio-header-content {
  display: flex;
  flex-direction: column;
}

.portfolio-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0; /* Prevent logo from shrinking */
}

.portfolio-name,
.portfolio-type {
  margin: 0;
  text-align: left;
  /* Visual styles moved to inline for easy editing */
}

.portfolio-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 0rem 0; /* Reduced from 2rem to move gallery up */
  max-width: none !important; /* Remove any max-width constraints */
  width: 100vw; /* Use full viewport width */
  margin-left: calc(-50vw + 50%); /* Break out of container to full width */
  margin-right: calc(-50vw + 50%);
  padding-left: 2rem; /* Add padding for content spacing */
  padding-right: 2rem;
  justify-content: start; /* Back to left alignment for proper scaling */
  border: none !important; /* Remove default section borders */
}
.portfolio-item {
  background: transparent;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  pointer-events: auto;
}

.portfolio-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.portfolio-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  opacity: 1; /* Override global opacity to show images at full brightness */
}

.portfolio-video {
  cursor: pointer;
  opacity: 1; /* Override global opacity for videos */
}

.portfolio-video:hover {
  opacity: 1; /* Keep full opacity on hover */
}

/* Ensure video thumbnails load properly */
.portfolio-video[poster] {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* For videos with generated thumbnails */
.portfolio-video {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #222; /* Fallback color while loading */
}

.portfolio-item:hover .portfolio-thumb {
  transform: scale(1.05);
}

.portfolio-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  color: white;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover .portfolio-overlay {
  transform: translateY(0);
}

.portfolio-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}
/* Popup styles - Modern dark design */
.portfolio-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center; /* Center vertically */
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(12px);
  animation: fadeIn 0.2s ease-out;
  padding: 2vh 0; /* Add equal padding top and bottom */
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.portfolio-popup-content {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 20px;
  max-width: 62vw; /* 65% of previous 95vw size */
  width: 62%;
  max-height: 85vh; /* Increased for dynamic sizing */
  min-height: 40vh; /* Minimum height */
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.portfolio-popup-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.portfolio-popup-close:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
  transform: scale(1.05);
}

.portfolio-popup-media {
  width: 100%;
  height: auto;
  max-height: 65vh; /* More reasonable media size within larger popup */
  object-fit: contain;
  display: block;
  background: #111;
  flex-shrink: 0;
}

.portfolio-popup-media video {
  width: 100%;
  height: auto;
  max-height: 55vh; /* Further reduced to give controls more space */
  object-fit: contain;
  display: block;
  cursor: default; /* No zoom cursor for videos */
  position: relative; /* Ensure controls positioning */
}

.portfolio-popup-media img {
  width: 100%;
  height: auto;
  max-height: 65vh;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.portfolio-popup-media img.zoomed {
  cursor: zoom-out;
  object-fit: none;
  max-height: none !important;
  max-width: none !important;
  width: auto;
  height: auto;
  transform-origin: center;
  position: relative;
}

.portfolio-popup-media-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  min-height: 200px;
  max-height: 65vh; /* Match media max-height for proper container sizing */
  position: relative;
  margin-top: 1rem; /* Add top margin to move frames down */
  margin-bottom: 0.5rem; /* Add bottom margin for balance */
}

.portfolio-popup-media-container.scrollable {
  overflow: auto;
  cursor: grab;
  align-items: flex-start;
  justify-content: flex-start;
}

.portfolio-popup-media-container.scrollable:active {
  cursor: grabbing;
}

/* About Section */
.about-section {
  margin: 0 0 1.5rem 0; /* Remove top margin completely */
  max-width: 800px;
  border: none !important; /* Remove default section borders */
  padding: 2rem 0 !important; /* Override default section padding */
  position: relative; /* For pseudo-element positioning */
  margin-bottom: 2rem; /* Add space after about section */
}

/* Make about section borders stretch full width */
.about-section::after {
  content: '';
  position: absolute;
  left: calc(-50vw + 50%);
  right: calc(-50vw + 50%);
  height: var(--border-width);
  background: var(--border);
  bottom: 0;
}

/* About bio styles moved to inline for easy editing */

/* Skills Popup */
.skills-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.skills-popup-content {
  background: #1a1a1a; /* Black background */
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  animation: slideUp 0.3s ease-out;
  border: 1px solid #333; /* Dark border */
  color: white; /* White text */
}

.skills-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: color 0.2s ease;
}

.skills-popup-close:hover {
  color: white;
}

.skills-popup h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: white; /* White text */
}

.popup-description {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #e0e0e0;
  font-size: 0.95rem;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
}

/* Custom scrollbar for popup descriptions */
.popup-description::-webkit-scrollbar {
  width: 8px;
}

.popup-description::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.popup-description::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-description::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.skill-item {
  background: rgba(255, 255, 255, 0.1); /* Dark theme */
  border: 1px solid #333;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: white; /* White text */
}

.details-section {
  border-top: 1px solid #333; /* Dark border */
  padding-top: 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #2a2a2a; /* Dark border */
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row strong {
  color: white; /* White text */
  font-weight: 600;
}

.detail-row span {
  color: #e0e0e0; /* Light gray text */
}

/* Reviews Section */
.tutoring-section {
  margin: 2rem 0;
  overflow: hidden;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  position: relative;
  padding: 2rem 0;
}

/* Add dividers above and below reviews section */
.tutoring-section::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: var(--border-width);
  background: var(--border);
  top: 0;
}

.tutoring-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: var(--border-width);
  background: var(--border);
  bottom: 0;
}

.tutoring-title {
  /* Basic structural styles only - visual styles moved to inline */
  text-align: center; /* Changed back to center */
  margin-bottom: 2rem;
  margin-top: 3rem;
}

.tutoring-scroll-container {
  width: 100%;
  overflow: hidden;
  background: #222; /* Black background like companies */
  border-radius: 0;
  padding: 1rem 0;
}

.tutoring-track {
  display: flex;
  gap: 2rem;
  animation: scrollReverse 35s linear infinite; /* Opposite direction, different speed */
  width: fit-content;
  will-change: transform;
}

@keyframes scrollReverse {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.review-item {
  background: rgba(255, 255, 255, 0.1); /* Subtle white overlay on black */
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(255,255,255,0.08); /* White shadow for dark background */
  cursor: default;
  min-width: 300px;
  max-width: 300px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2); /* White border */
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.review-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: white; /* White text for dark background */
}

.review-rating {
  display: flex;
  gap: 0.25rem;
}

.star {
  color: #ffd700;
  font-size: 1rem;
}

.review-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8); /* Slightly transparent white */
  margin: 0 0 0.75rem 0;
  font-style: italic;
}

.review-text-container {
  margin-bottom: 0.75rem;
}

.show-more-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.show-more-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.review-subject {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-color, #007bff);
  background: rgba(0, 123, 255, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

/* Pause reviews animation on hover */
.tutoring-track:hover {
  animation-play-state: paused;
}

/* Scrollbar styling removed - now handled globally in head.ejs */

.portfolio-popup-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 1.5rem 2rem 0.75rem 2rem;
  color: #ffffff;
  line-height: 1.3;
  flex-shrink: 0;
}

.portfolio-popup-desc {
  font-size: 1rem;
  color: #cccccc;
  margin: 0 2rem 2rem 2rem;
  line-height: 1.6;
  font-weight: 400;
  overflow-y: auto;
  max-height: 20vh; /* Increased limit before scrolling */
  white-space: pre-wrap; /* Preserve line breaks and spacing */
}

/* Custom scrollbar for portfolio popup descriptions */
.portfolio-popup-desc::-webkit-scrollbar {
  width: 8px;
}

.portfolio-popup-desc::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.portfolio-popup-desc::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.portfolio-popup-desc::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Scrollbar styling for Firefox */
.portfolio-popup-desc {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.portfolio-popup-text-content {
  flex-shrink: 0;
  overflow: hidden; /* Remove scrolling from text container */
  max-height: 30vh; /* Increased for dynamic sizing */
  min-height: auto; /* Allow content to shrink when empty */
}

/* Hide default scrollbars in text content area */
.portfolio-popup-text-content::-webkit-scrollbar {
  display: none;
}

.portfolio-popup-text-content {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
