/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e0e0e0;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  color: #fff;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 2rem); }
h4 { font-size: clamp(1rem, 2.5vw, 1.5rem); }

p { font-size: clamp(0.9rem, 2vw, 1.1rem); }

/* Header and Navigation */
.site-header {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-logo {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: #9b59b6;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 1px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.5rem;
  color: #e0e0e0;
}

.menu-icon {
  display: block;
  width: 20px;
  height: 20px;
  position: relative;
  font-size: 1.5rem;
}

.menu-icon::before,
.menu-icon::after,
.menu-icon span {
  content: '.';
  position: absolute;
  left: 0;
  font-size: 1.5rem;
  color: #e0e0e0;
  line-height: 1;
}

.menu-icon span {
  top: 0;
}

.menu-icon::before {
  top: 6px;
}

.menu-icon::after {
  top: 12px;
}

.menu-toggle[aria-expanded="true"] .menu-icon::before,
.menu-toggle[aria-expanded="true"] .menu-icon span,
.menu-toggle[aria-expanded="true"] .menu-icon::after {
  color: #9b59b6;
}

.nav-links {
  display: flex;
  list-style: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-links li {
  margin-left: 2rem;
}

.nav-links a {
  color: #e0e0e0;
  text-decoration: none;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: #9b59b6;
  transform: scale(1.05);
}

/* Hero Section */
.hero-section {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-content-wrapper {
  position: relative;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  padding: clamp(1rem, 2vw, 2rem);
  border-radius: 10px;
  max-width: 800px;
  width: 90%;
}

.hero-content {
  max-width: 800px;
  width: 100%;
}

.hero-content p, .hero-content h1, .hero-content h2 {
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.avatar img {
  width: clamp(100px, 20vw, 150px);
  height: clamp(100px, 20vw, 150px);
  border-radius: 50%;
  border: 3px solid #9b59b6;
  margin-bottom: 1rem;
  object-fit: cover;
  aspect-ratio: 1/1;
}

.greeting { font-size: clamp(1rem, 2.5vw, 1.5rem); }
.tagline-small { font-size: clamp(0.9rem, 2vw, 1.2rem); color: #e0e0e0; }
.tagline-subtext { margin-top: 0.5rem; }
.typed-text { margin: 0.5rem 0; }
.typed-text-caret { position: relative; }
.typed-caret {
  color: #9b59b6;
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.subtext a, .highlight-purple-link {
  color: #9b59b6;
  text-decoration: none;
}

.subtext a:hover, .highlight-purple-link:hover {
  text-decoration: underline;
}

.description-text { margin-top: 0.5rem; }
.cv-btn { margin-top: 1rem; }

.highlight-purple { color: #9b59b6; }
.underline { border-bottom: 2px solid #9b59b6; }

/* Slideshow */
.slideshow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.slideshow {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slideshow-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slideshow-image.active {
  opacity: 0.4;
}

/* Work Experience, Projects, Achievements, Patents, Contact, About */
.work-experience, .featured-projects, .patents-publications, .achievements-gallery, .contact-section, .about-section {
  padding: clamp(1rem, 5vw, 4rem) clamp(1rem, 5vw, 2rem);
  max-width: 1200px;
  margin: 0 auto;
  width: 90%;
}

.section-title {
  text-align: center;
  margin-bottom: clamp(1rem, 3vw, 3rem);
}

.experience-cards, .project-cards, .patent-cards, .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(1rem, 2vw, 2rem);
}

.exp-card, .patent-card, .gallery-item {
  background: rgba(255, 255, 255, 0.05);
  padding: clamp(1rem, 2vw, 1.5rem);
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: pointer;
}

.exp-card:hover, .patent-card:hover, .gallery-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 6px 15px rgba(155, 89, 182, 0.3);
  background: rgba(155, 89, 182, 0.1);
}

.exp-card img,
.project-image img,
.gallery-item img,
.tech-icons img {
  transition: transform 0.3s ease;
}

.exp-card img:hover,
.project-image img:hover,
.gallery-item img:hover,
.tech-icons img:hover {
  transform: scale(1.05);
}

.exp-card img {
  width: 80px;
  height: 80px;
  max-width: 100%;
  max-height: 100%;
  margin-bottom: 0.5rem;
  object-fit: contain;
  aspect-ratio: 1/1;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.exp-card h4, .patent-card h4, .gallery-caption h4 { margin-bottom: 0.5rem; }
.exp-card p, .patent-card p, .gallery-caption p { color: #b0b0b0; }

/* Buttons */
.btn {
  padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(1rem, 2vw, 1.5rem);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: clamp(0.9rem, 2vw, 1rem);
  transition: background 0.3s ease, transform 0.3s ease;
}

.btn-primary {
  background: #9b59b6;
  color: #fff;
}

.btn-primary:hover {
  background: #8e44ad;
  transform: scale(1.05);
}

.btn-secondary {
  background: transparent;
  border: 2px solid #9b59b6;
  color: #9b59b6;
}

.btn-secondary:hover {
  background: #9b59b6;
  color: #fff;
  transform: scale(1.05);
}

/* Cross-functional Section */
.cross-functional {
  text-align: center;
  padding: clamp(1rem, 5vw, 3rem) clamp(1rem, 5vw, 2rem);
}

.cross-functional-text { font-size: clamp(1.2rem, 3vw, 1.5rem); margin-bottom: 1rem; }
.tech-icons {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 1vw, 1rem);
  flex-wrap: wrap;
}

.tech-icons img {
  width: clamp(24px, 6vw, 36px);
  height: clamp(24px, 6vw, 36px);
  object-fit: contain;
  aspect-ratio: 1/1;
}

/* Animated Logo */
.animated-logo-container {
  margin-top: 1rem;
  background-color: rgba(255, 255, 255, 0.1);
}

.animated-logo {
  width: clamp(80px, 15vw, 120px);
  height: clamp(80px, 15vw, 120px);
  object-fit: contain;
  aspect-ratio: 1/1;
  transition: transform 0.3s ease;
}

.animated-logo:hover {
  transform: scale(1.1);
}

/* Social Icons */
.social-icons {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.social-link {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: #e0e0e0;
  text-decoration: none;
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.25rem;
  border-radius: 50%;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.social-link img {
  width: clamp(24px, 6vw, 36px);
  height: clamp(24px, 6vw, 36px);
  object-fit: contain;
  aspect-ratio: 1/1;
  transition: transform 0.3s ease;
}

.social-link:hover {
  background-color: rgba(155, 89, 182, 0.2);
  transform: scale(1.1);
}

.social-link img:hover {
  transform: scale(1.1);
}

/* Project Cards */
.project-card {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  background: rgba(255, 255, 255, 0.05);
  padding: clamp(1rem, 2vw, 1.5rem);
  border-radius: 10px;
  margin-bottom: clamp(1rem, 2vw, 2rem);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.project-card.reversed { flex-direction: row-reverse; }

.project-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 6px 15px rgba(155, 89, 182, 0.5);
  background: rgba(155, 89, 182, 0.1);
}

.project-description { flex: 1; }
.project-image {
  flex: 1;
  max-width: 100%;
}
.project-image img {
  width: 100%;
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: 4/3;
  display: block;
  margin: 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Achievements Gallery */
.achievements-gallery .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(1rem, 2vw, 2rem);
}

.gallery-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.gallery-item img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  aspect-ratio: 4/3;
  display: block;
  margin: 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption {
  padding: clamp(1rem, 2vw, 1.5rem);
}

/* Contact Section */
.contact-snippet, .contact-section {
  text-align: center;
}

.email-contact {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: #9b59b6;
  margin: 0.5rem 0;
}

/* File Viewer */
.file-viewer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.file-viewer.active {
  display: flex;
}

.close-viewer {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.3s ease, color 0.3s ease;
}

.close-icon {
  display: block;
  width: 20px;
  height: 20px;
  position: relative;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
}

.close-icon::before,
.close-icon::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 12px;
  background: #e0e0e0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: background 0.3s ease;
}

.close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close-viewer:hover .close-icon::before,
.close-viewer:hover .close-icon::after {
  background: #9b59b6;
}

.viewer-content {
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  width: 100%;
  height: 100%;
}

#pdf-viewer,
#image-viewer {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}

.zoom-controls {
  position: absolute;
  bottom: 1rem;
  display: flex;
  gap: 0.5rem;
}

.zoom-btn {
  background: #9b59b6;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.zoom-btn:hover {
  background: #8e44ad;
  transform: scale(1.05);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: clamp(1rem, 2vw, 2rem);
  background: rgba(0, 0, 0, 0.5);
}

.site-footer p { font-size: clamp(0.8rem, 1.5vw, 0.9rem); color: #b0b0b0; }

/* Responsive Design */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    padding: 1rem;
    text-align: center;
    transform: translateX(-100%);
    opacity: 0;
  }

  .nav-links.active {
    display: flex;
    transform: translateX(0);
    opacity: 1;
  }

  .nav-links li {
    margin: 0.5rem 0;
  }

  .project-card { flex-direction: column; }
  .project-card.reversed { flex-direction: column; }
  .tech-icons { gap: 0.5rem; }
  .tech-icons img { 
    width: 24px; 
    height: 24px; 
  }
  .social-link img {
    width: clamp(20px, 6vw, 24px);
    height: clamp(20px, 6vw, 24px);
  }
  .animated-logo {
    width: clamp(60px, 15vw, 80px);
    height: clamp(60px, 15vw, 80px);
  }
  .slideshow-image {
    width: 100%;
    height: auto;
    max-height: 100vh;
    object-fit: cover;
  }
  .hero-content-wrapper {
    padding: clamp(0.5rem, 1.5vw, 1rem);
  }
  .viewer-content {
    max-width: 100%;
    max-height: 80vh;
    width: 100%;
    height: auto;
  }
  #pdf-viewer,
  #image-viewer {
    width: 100%;
    height: auto;
    max-height: 80vh;
  }
  .zoom-controls {
    bottom: 0.5rem;
  }
  .exp-card img {
    width: 60px;
    height: 60px;
  }
  .project-image img {
    max-height: 200px;
  }
  .gallery-item img {
    max-height: 150px;
  }
}