/* ===========================
   RESET & BASE STYLES
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
  background: #0f172a; /* Dark base background */
}

.container {
  max-width: 1200px;
  width: 100%;
}

section {
  min-height: 100vh;
  padding: 6rem 5% 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: #ffffff;
  text-align: center;
}

/* ===========================
     ANIMATED BACKGROUND
     =========================== */
section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(139, 92, 246, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 20%,
      rgba(59, 130, 246, 0.1) 0%,
      transparent 50%
    );
  animation: backgroundShift 15s ease-in-out infinite;
  z-index: 0;
}

@keyframes backgroundShift {
  0%,
  100% {
    opacity: 1;
    transform: scale(1) translate(0, 0);
  }
  33% {
    opacity: 0.8;
    transform: scale(1.1) translate(5%, -5%);
  }
  66% {
    opacity: 0.9;
    transform: scale(1.05) translate(-5%, 5%);
  }
}

/* Ensure content is above background */
.container {
  position: relative;
  z-index: 1;
}

/* ===========================
     LOGO
     =========================== */

/* Logo in top left */
.logo-container {
  position: fixed;
  top: 1.5rem;
  left: 2rem;
  z-index: 1001;
}

.site-logo {
  height: 50px;
  width: auto;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.site-logo:hover {
  transform: scale(1.05);
}

/* ===========================
     NAVIGATION - SMALLER PILL STYLE
     =========================== */
nav {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 0;
}

.nav-pill-container {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.4rem;
  border-radius: 100px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-pill {
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-pill.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.nav-pill-cta {
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  text-decoration: none;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  margin-left: 0.3rem;
}

.nav-pill-cta:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* ===========================
     HERO SECTION
     =========================== */
.hero {
  background: transparent;
  color: white;
  text-align: center;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.particles::before,
.particles::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  animation: float 6s infinite ease-in-out;
}

.particles::before {
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.particles::after {
  bottom: -100px;
  right: -100px;
  animation-delay: 3s;
  width: 400px;
  height: 400px;
  background: rgba(139, 92, 246, 0.15);
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(50px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-50px, 50px) scale(0.9);
  }
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out;
}

.hero .subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  animation: fadeInUp 1s ease-out 0.2s backwards;
}

/* ===========================
   CTA BUTTON - PULSE ANIMATION
   =========================== */

.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: white;
  color: #667eea;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeInUp 1s ease-out 0.4s backwards,
    buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
  }
}

.cta-button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
  animation: none; /* Stops pulse on hover */
}

/* ===========================
   LOOPING TYPING ANIMATION - NO CURSOR
   =========================== */

.typing-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: typing-loop 6s infinite;
}

@keyframes typing-loop {
  0% {
    width: 0;
  }
  20% {
    width: 0;
  }
  40% {
    width: 17ch; /* Fully typed "Saving the World." */
  }
  70% {
    width: 17ch; /* Hold */
  }
  90% {
    width: 0; /* Delete */
  }
  100% {
    width: 0;
  }
}

/* ===========================
     ABOUT SECTION
     =========================== */
.about {
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.about h2 {
  color: #ffffff;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.skill-tag {
  background: rgba(99, 102, 241, 0.3);
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(99, 102, 241, 0.5);
}

.about-image {
  width: 100%;
  height: 600px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 15px;
}

/* ===========================
     EXPERIENCE SECTION
     =========================== */

#experience {
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#experience h2 {
  color: #ffffff;
}

/* Timeline Container */
.timeline {
  position: relative;
  max-width: 1000px;
  margin: 3rem auto 0;
  padding: 2rem 0;
}

/* Vertical Line */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(99, 102, 241, 0.5),
    rgba(139, 92, 246, 0.5)
  );
  border-radius: 2px;
}

/* Timeline Item */
.timeline-item {
  position: relative;
  margin-bottom: 4rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* Timeline Date Badge */
.timeline-date {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(99, 102, 241, 0.9);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  border: 3px solid rgba(15, 23, 42, 1);
}

/* Timeline Content */
.timeline-content {
  width: calc(50% - 50px);
  position: relative;
}

/* Alternating sides */
.timeline-item:nth-child(odd) .timeline-content {
  margin-left: auto;
  padding-left: 50px;
}

.timeline-item:nth-child(even) .timeline-content {
  margin-right: auto;
  padding-right: 50px;
}

/* Timeline Dot */
.timeline-content::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  background: rgba(99, 102, 241, 0.9);
  border: 4px solid rgba(15, 23, 42, 1);
  border-radius: 50%;
  transform: translateY(-50%);
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.timeline-item:nth-child(odd) .timeline-content::before {
  left: -10px;
}

.timeline-item:nth-child(even) .timeline-content::before {
  right: -10px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  border-color: rgba(99, 102, 241, 0.5);
}

.service-card h3 {
  color: #818cf8;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.service-card p {
  color: rgba(255, 255, 255, 0.8);
}

.company-logo {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.company-logo img {
  max-width: 150px;
  max-height: 80px;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.company-logo img:hover {
  opacity: 1;
}

/* ===========================
   TERMINAL ANIMATION
   =========================== */

.terminal {
  background: rgba(20, 20, 20, 0.9);
  border-radius: 8px;
  padding: 0;
  margin: 0 auto 2rem;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out;
}

.terminal-header {
  background: rgba(40, 40, 40, 0.9);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-buttons {
  display: flex;
  gap: 0.5rem;
}

.terminal-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-button.red {
  background: #ff5f56;
}

.terminal-button.yellow {
  background: #ffbd2e;
}

.terminal-button.green {
  background: #27c93f;
}

.terminal-title {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-left: auto;
}

.terminal-body {
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: #00ff00;
  min-height: 60px;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-prompt {
  color: #00ff00;
  font-weight: bold;
}

.terminal-text {
  color: #00ff00;
}

.terminal-cursor {
  color: #00ff00;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  from,
  to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .terminal {
    max-width: 100%;
    font-size: 0.9rem;
  }

  .terminal-body {
    padding: 1rem;
    font-size: 0.85rem;
  }
}

/* ===========================
     PROJECTS SECTION
     =========================== */

#projects {
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#projects h2 {
  color: #ffffff;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin-top: 3rem;
}

/* Mobile: 1 column */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card:hover {
  transform: scale(1.03);
  border-color: rgba(99, 102, 241, 0.5);
}

.project-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.3) 0%,
    rgba(118, 75, 162, 0.3) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  color: #ffffff;
  margin-bottom: 0.8rem;
}

.project-content p {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
}

.project-video {
  width: 100%;
  height: 350px;
  background: #0f172a;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===========================
     PDF MODAL
     =========================== */

.pdf-thumbnail {
  position: relative;
  overflow: hidden;
}

.pdf-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
  background: #0f172a;
}

.pdf-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pdf-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.pdf-thumbnail:hover .pdf-hover-overlay {
  opacity: 1;
}

.pdf-thumbnail:hover img {
  transform: scale(1.05);
}

.view-pdf-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(10px);
}

.pdf-thumbnail:hover .view-pdf-btn {
  transform: translateY(0);
}

.view-pdf-btn:hover {
  background: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.pdf-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.3s;
}

.pdf-modal-content {
  position: relative;
  margin: 2% auto;
  width: 90%;
  height: 90%;
  max-width: 1200px;
  animation: slideIn 0.3s;
}

.pdf-modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 10px;
  background: white;
}

.close-pdf-modal {
  position: absolute;
  top: -50px;
  right: 10px;
  color: white;
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
  transition: color 0.3s;
}

.close-pdf-modal:hover {
  color: #ccc;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .pdf-modal-content {
    width: 95%;
    height: 85%;
    margin: 5% auto;
  }

  .close-pdf-modal {
    top: -40px;
    font-size: 35px;
  }

  .view-pdf-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Disable hover overlay on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
  /* Hide the hover overlay completely on mobile */
  .pdf-hover-overlay {
    display: none !important;
  }

  /* Remove hover effects */
  .pdf-thumbnail:hover img,
  .pdf-thumbnail:hover video {
    transform: none;
  }
}

/* Mobile-only button styling */
.view-pdf-btn.mobile-btn {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .view-pdf-btn.mobile-btn {
    display: inline-block;
    position: static;
    margin-top: 1rem;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===========================
     CONTACT SECTION
     =========================== */
.contact {
  background: transparent;
  color: white;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact h2 {
  color: white;
}

.contact-info {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.1rem;
}

.contact-item a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s;
}

.contact-item a:hover {
  opacity: 0.8;
}

/* ===========================
     ANIMATIONS
     =========================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
     RESPONSIVE STYLES
     =========================== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 1rem;
  }

  section {
    padding: 5rem 5% 3rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero .subtitle {
    font-size: 1.2rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
  }

  h2 {
    font-size: 2rem;
  }

  .project-image {
    height: 150px;
    font-size: 2rem;
  }

  .logo-container {
    top: 1rem;
    left: 1rem;
  }

  .site-logo {
    height: 40px; /* Smaller logo on mobile */
  }

  nav {
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%; /* Make nav narrower on mobile */
  }

  .nav-pill-container {
    padding: 0.3rem;
    gap: 0.2rem;
  }

  .nav-pill {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem; /* Smaller text */
  }

  .nav-pill-cta {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    margin-left: 0.2rem;
  }

  /* Hide video controls on mobile */
  .project-video video::-webkit-media-controls {
    display: none !important;
  }

  .project-video video::-webkit-media-controls-enclosure {
    display: none !important;
  }

  .project-video video::-webkit-media-controls-panel {
    display: none !important;
  }

  .project-video video {
    pointer-events: none; /* Prevent interaction with video controls */
  }

  /* Fix timeline on mobile */
  .timeline::before {
    left: 20px;
  }

  .timeline-date {
    position: relative;
    left: 0;
    transform: none;
    margin-bottom: 1rem;
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
  }

  .timeline-content {
    width: 100%;
    padding-left: 50px !important;
    padding-right: 0 !important;
  }

  .timeline-content::before {
    left: 10px !important;
    right: auto !important;
  }

  .timeline-item {
    margin-bottom: 3rem;
  }

  /* Fix hero section spacing on mobile */
  .hero h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

  .hero .subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }

  .cta-button {
    padding: 0.8rem 2rem;
    font-size: 0.9rem;
  }

  /* Fix about section on mobile */
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-image {
    height: 400px; /* Shorter on mobile */
  }

  /* Fix terminal on mobile */
  .terminal {
    max-width: 100%;
    margin: 0 0 1.5rem 0;
  }

  .terminal-body {
    padding: 1rem;
    font-size: 0.85rem;
    min-height: 50px;
  }

  /* Fix project cards on mobile */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-video {
    height: 250px; /* Smaller video height on mobile */
  }

  /* Fix contact section on mobile */
  .contact-info {
    flex-direction: column;
    gap: 1rem;
  }

  .contact-item {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  /* Extra small phones */
  .nav-pill-container {
    padding: 0.25rem;
  }

  .nav-pill,
  .nav-pill-cta {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .timeline-date {
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
  }

  .service-card {
    padding: 1.5rem;
  }

  .service-card h3 {
    font-size: 1.2rem;
  }

  .project-video {
    height: 200px;
  }

  h2 {
    font-size: 1.8rem;
  }
}

/* Hide ALL video controls globally */
video::-webkit-media-controls {
  display: none !important;
}

video::-webkit-media-controls-enclosure {
  display: none !important;
}

video::-webkit-media-controls-panel {
  display: none !important;
}

video::-webkit-media-controls-play-button {
  display: none !important;
}

video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

/* Firefox */
video::-moz-media-controls {
  display: none !important;
}

/* For all browsers - add this attribute to your videos */
video {
  pointer-events: none; /* Prevents clicking play button */
}

/* Re-enable pointer events for PDF thumbnails hover overlay */
.pdf-hover-overlay {
  pointer-events: auto;
}
