/* OpenAI-Style Clean Animations */

/* Fade-in animation for photos on scroll */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Base state for animated elements */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

/* Photo grid container */
.photo-decoration {
  position: relative;
  pointer-events: none;
}

.floating-photo {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.floating-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-photo:hover img {
  transform: scale(1.05);
}

.floating-photo.visible {
  opacity: 1;
  animation: floatGentle 6s ease-in-out infinite;
}

/* Decorative photo sections */
.content-with-photos {
  position: relative;
  padding: 40px 0;
}

.side-photo {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.side-photo.left {
  left: -250px;
  transform: translateX(-30px);
}

.side-photo.right {
  right: -250px;
  transform: translateX(30px);
}

.side-photo.visible {
  opacity: 0.9;
  transform: translateX(0);
}

.side-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-photo:hover {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.side-photo:hover img {
  transform: scale(1.08);
}

/* Inline photo gallery */
.inline-photo-gallery {
  display: flex;
  gap: 20px;
  margin: 40px 0;
  overflow-x: auto;
  padding: 20px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.inline-photo-gallery::-webkit-scrollbar {
  height: 6px;
}

.inline-photo-gallery::-webkit-scrollbar-track {
  background: transparent;
}

.inline-photo-gallery::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.inline-photo-gallery::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.gallery-photo {
  flex: 0 0 280px;
  height: 280px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-photo.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-photo:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.gallery-photo:hover img {
  transform: scale(1.06);
}

/* Stagger animation delays */
.gallery-photo:nth-child(1) { transition-delay: 0.1s; }
.gallery-photo:nth-child(2) { transition-delay: 0.2s; }
.gallery-photo:nth-child(3) { transition-delay: 0.3s; }
.gallery-photo:nth-child(4) { transition-delay: 0.4s; }
.gallery-photo:nth-child(5) { transition-delay: 0.5s; }
.gallery-photo:nth-child(6) { transition-delay: 0.6s; }
.gallery-photo:nth-child(7) { transition-delay: 0.7s; }
.gallery-photo:nth-child(8) { transition-delay: 0.8s; }

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .side-photo {
    display: none;
  }
}

@media (max-width: 768px) {
  .gallery-photo {
    flex: 0 0 220px;
    height: 220px;
  }
  
  .inline-photo-gallery {
    gap: 15px;
  }
  
  /* Better mobile table styling */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    width: 100% !important;
    font-size: 14px;
  }
  
  table td, table th {
    padding: 8px 6px !important;
    font-size: 13px;
    line-height: 1.4;
    vertical-align: top;
  }
  
  table th {
    background-color: #f5f5f5;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  /* Work Experience table specific - stack on mobile */
  table tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
  }
  
  table td, table th {
    display: block;
    width: 100% !important;
    text-align: left !important;
    border: none;
    border-bottom: 1px solid #eee;
  }
  
  table td:last-child, table th:last-child {
    border-bottom: none;
  }
  
  table thead {
    display: none;
  }
  
  /* Add labels for mobile */
  table td:before {
    content: attr(data-label);
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: #333;
  }
  
  table ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
  }
  
  table ul li {
    margin-bottom: 8px;
    font-size: 13px;
  }
  
  h1 {
    font-size: 28px !important;
  }
  
  h2 {
    font-size: 22px !important;
  }
  
  /* Photo Gallery mobile optimization */
  section[style*="Photo Gallery"] {
    margin: 0 auto !important;
    padding: 15px !important;
  }
  
  /* Ensure no extra space from animations */
  .content-with-photos {
    padding: 0 !important;
  }
}

/* Subtle parallax effect for hero section */
.parallax-photo {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Grid mosaic layout for photo section */
.photo-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 40px 0;
  padding: 20px 0;
}

.mosaic-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.mosaic-item.visible {
  opacity: 1;
  transform: scale(1);
}

.mosaic-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.mosaic-item:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.mosaic-item:hover img {
  transform: scale(1.05);
}

/* Stagger mosaic animations */
.mosaic-item:nth-child(1) { transition-delay: 0.05s; }
.mosaic-item:nth-child(2) { transition-delay: 0.1s; }
.mosaic-item:nth-child(3) { transition-delay: 0.15s; }
.mosaic-item:nth-child(4) { transition-delay: 0.2s; }
.mosaic-item:nth-child(5) { transition-delay: 0.25s; }
.mosaic-item:nth-child(6) { transition-delay: 0.3s; }
.mosaic-item:nth-child(7) { transition-delay: 0.35s; }
.mosaic-item:nth-child(8) { transition-delay: 0.4s; }
