/* ================= GLOBAL ================= */

* { 
  font-family: 'Poppins', sans-serif;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

a { text-decoration: none; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  scroll-behavior: auto !important;
  height: 100%;
}

body {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f6f9fc 40%, #eef3f9 100%),
              url("https://www.transparenttextures.com/patterns/transparent-square-tiles.png");
  background-blend-mode: multiply;
  min-height: 100dvh;
}

/* Sections */

section:not(#contact section) {
  height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

section:not(#contact section).active {
  opacity: 1;
  visibility: visible;
}

.section-title {
  display: none;
}

.section-scroll-buffer {
  overflow-y: auto;
  width: 100%;
  padding: 5px 5px 10px 0;
  margin-right: -5px;
}

/* Content */

.container {
  max-width: 1500px;
  padding-left: 20px;
  padding-right: 20px;
}

.card {
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.card:hover {
  scale: calc(1.01);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
  cursor: pointer;
}

.badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border: none;
  font-weight: 500;
}

h1, h2 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

h3 {
  background: #bb6dca;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}


/* ================= NAVBAR ================= */

.navbar {
  background: rgba(240, 245, 252, 0.9) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.nav-link {
  color: #4b5563 !important;
  transition: color 0.3s ease;
  font-weight: 500;
  padding: 8px 16px !important;
}

.nav-link:hover {
  color: #3b82f6 !important;
}

.nav-link.active {
  font-weight: 600;
  color: #3b82f6 !important;
  position: relative;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 16px;
  right: 16px;
  height: 3px;
  background: linear-gradient(to right, #3b82f6, #8b5cf6);
  border-radius: 3px;
  animation: navSlide 0.3s ease;
}

@keyframes navSlide {
  from {
    width: 0;
    left: 50%;
  }
  to {
    width: calc(100% - 32px);
    left: 16px;
  }
}

#navbarBrand {
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 1s ease;
}

#navbarBrand.visible {
  opacity: 1;
  visibility: visible;
}

#navbarBrand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  border: 2px solid #3b82f6;
}

::-webkit-scrollbar {
  display: none;
}


/* ================= ABOUT SECTION ================= */

.photo-container {
  position: relative;
  display: inline-block;
  transition: transform 0.3s ease;
  width: clamp(200px, 100%, 300px);
  height: clamp(200px, auto, 300px);
}

#aboutPhoto {
  transition: all 0.5s ease;
  position: relative;
  width: clamp(200px, 100%, 300px);
  height: clamp(200px, auto, 300px);
  border-radius: 50%;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  display: block;
  object-fit: cover;
  border: 8px solid white;
}

/* Outer border */
.photo-border {
  position: absolute;
  top: -25px;
  left: -25px;
  right: -25px;
  bottom: -25px;
  border-radius: 50%;
  pointer-events: none;
  border: 3px solid transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, 
    rgba(91, 143, 249, 0.1) 0%, 
    rgba(183, 148, 244, 0.1) 50%, 
    rgba(244, 114, 114, 0.1) 100%
  );
  box-shadow: 
    0 0 30px rgba(59, 130, 246, 0.15),
    0 0 60px rgba(139, 92, 246, 0.1),
    inset 0 0 20px rgba(59, 130, 246, 0.05);
  animation: soothingPulse 4s infinite ease-in-out;
}

/* Inner border */
.inner-border {
  position: absolute;
  top: -15px;
  left: -15px;
  right: -15px;
  bottom: -15px;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(45deg, 
    rgba(74, 222, 128, 0.1) 0%, 
    rgba(251, 191, 36, 0.1) 50%, 
    rgba(34, 211, 238, 0.1) 100%
  );
  box-shadow: 
    0 0 25px rgba(45, 212, 191, 0.15),
    inset 0 0 15px rgba(45, 212, 191, 0.1);
  animation: soothingInnerPulse 6s infinite ease-in-out;
}

/* Hover effects */
.photo-container:hover .photo-border {
  border: 2px solid rgba(59, 130, 246, 0.3);
  box-shadow: 
    0 0 30px rgba(59, 130, 246, 0.15),
    0 0 60px rgba(139, 92, 246, 0.1),
    inset 0 0 20px rgba(59, 130, 246, 0.05);
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.15) 0%, 
    rgba(139, 92, 246, 0.15) 100%
  );
  animation: soothingPulse 4s infinite ease-in-out;
}

.photo-container:hover .inner-border {
  border: 1px solid rgba(45, 212, 191, 0.3);
  box-shadow: 
    0 0 25px rgba(45, 212, 191, 0.15),
    inset 0 0 15px rgba(45, 212, 191, 0.1);
  background: linear-gradient(45deg, 
    rgba(45, 212, 191, 0.1) 0%, 
    rgba(59, 130, 246, 0.1) 100%
  );
  animation: soothingInnerPulse 6s infinite ease-in-out;
}

@keyframes soothingPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 45px rgba(59, 130, 246, 0.25);
    opacity: 1;
  }
}

@keyframes soothingInnerPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.15);
    transform: rotate(0deg);
  }
  50% {
    box-shadow: 0 0 35px rgba(45, 212, 191, 0.25);
    transform: rotate(2deg);
  }
}

.photo-container:hover #aboutPhoto {
  border: 8px solid white;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.social-container {
  display: flex;
  gap: 20px;
  padding: 20px;
  justify-content: center;
  margin-top: 30px;
}

.social-icon {
  width: 45px;
  height: 45px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: #333;
  position: relative;
}

.social-icon:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.social-icon i {
  font-size: 18px;
}

.social-icon.github:hover {
  background: #333;
  color: white;
}

.social-icon.linkedin:hover {
  background: #0077b5;
  color: white;
}

.social-icon.gmail:hover {
  background: #e43f30;
  color: white;
}

.social-icon.whatsapp:hover {
  background: #25d366;
  color: white;
}

.tooltip {
  position: absolute;
  top: -45px;
  font-size: 14px;
  background: #ffffff;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 5px;
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* The little arrow under the tooltip */
.tooltip::before {
  position: absolute;
  content: "";
  height: 8px;
  width: 8px;
  background: inherit;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
}

.social-icon:hover .tooltip {
  top: -40px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.social-icon.linkedin:hover .tooltip { background: #0077b5; }
.social-icon.github:hover .tooltip { background: #333; }
.social-icon.gmail:hover .tooltip { background: #e43f30; }
.social-icon.whatsapp:hover .tooltip { background: #25d366; }

.waving-hand-img {
  height: 1em; 
  width: auto;
  vertical-align: middle; 
  display: inline-block;
  cursor: none;
  transform-origin: 75% 75%; 
  transition: transform 0.2s ease-in-out;
}

@keyframes wave-hand {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(5deg); }
  100% { transform: rotate(0deg); }
}

.waving-hand-img:hover {
  animation: wave-hand 1s ease-in-out infinite;
}

.shine-text {
  position: relative;
  display: inline-block;
  color: #000;
  overflow: hidden;
}

/* Light sweep: left-bottom → right-top */
.shine-text::after {
  content: "";
  position: absolute;
  bottom: -50%;
  left: -120%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    -120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 100%
  );
  transform: skewX(20deg);
  animation: shine 8s ease-in-out infinite;
}

@keyframes shine {
  0% {
    left: -120%;
  }
  50% {
    left: 120%;
  }
  100% {
    left: 120%;
  }
}

#about .badge {
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 50px;
  transition: all 0.3s ease;
  cursor: default;
}

#about .badge:hover {
  transform: translateY(-3px);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 1. Blue Theme (Python/JS) */
.skill-js {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #d97706 !important;
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}
.skill-js:hover { background: #d97706 !important; }

/* 2. Purple Theme (WebGIS) */
.skill-webgis {
  background: rgba(139, 92, 246, 0.1) !important;
  color: #7c3aed !important;
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}
.skill-webgis:hover { background: #7c3aed !important; }

/* 3. Green Theme (Leaflet/QGIS) */
.skill-server, .skill-leaflet, .skill-qgis {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.skill-server:hover, .skill-leaflet:hover, .skill-qgis:hover { background: #059669 !important; }

/* 4. Indigo Theme (Databases/PostGIS) */
.skill-database {
  background: rgba(79, 70, 229, 0.1) !important;
  color: #4f46e5 !important;
  border: 1px solid rgba(79, 70, 229, 0.2);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}
.skill-database:hover { background: #4f46e5 !important; }

/* 5. Orange/Amber Theme (GeoServer/ArcGIS) */
.skill-python, .skill-arcgis {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #2563eb !important;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.skill-python:hover, .skill-arcgis:hover { background: #2563eb !important; }

.btn-resume {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-size: 0.88rem;
  color: #3b82f6;
  font-weight: 600;
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-resume:hover {
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
}

.btn-resume i {
  font-size: 0.95rem;
  transition: transform 0.3s ease;
}


/* ================= EXPERIENCE TIMELINE ================= */

.experience-timeline {
  position: relative;
  padding: 0 0 0 50px;
  margin-top: 0;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  width: 2px;
  background: linear-gradient(to bottom, #3b82f6, #8b5cf6, #ec4899);
}

/* Individual timeline items */
.timeline-item {
  position: relative;
  margin-bottom: 30px;
  display: flex;
  align-items: flex-start;
  min-height: 70px;
  transition: all 0.3s ease;
}

.timeline-item:first-child {
  padding-top: 0;
}

.timeline-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Timeline dots - centered on the vertical line */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -36.5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border: 3px solid white;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4);
  top: 11px;
  transition: all 0.3s ease;
}

/* Current position styling */
.timeline-item.current::before {
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4);
  animation: pulse 2s infinite;
}

/* Timeline left section - Date, Title, Company */
.timeline-left {
  flex: 0 0 auto;
  width: 220px;
  min-width: 220px;
  padding-right: 40px;
  padding-top: 5px;
  min-height: 70px;
  position: relative;
}

.timeline-date {
  font-size: 0.85rem;
  color: #6b7280;
  background: rgba(59, 130, 246, 0.1);
  padding: 3px 12px;
  border-radius: 5px;
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 500;
  border: 1px solid rgba(59, 130, 246, 0.2);
  white-space: nowrap;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 6px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.timeline-company {
  color: #3b82f6;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  word-break: break-word;
}

.timeline-place {
  font-size: 0.95rem;
  margin-bottom: 0;
  line-height: 1.3;
  display: flex;
  align-items: center;
  word-break: break-word;
}

.timeline-company::before {
  content: "";
}

/* Timeline-right container */
.timeline-right {
  flex: 1;
  min-width: 0;
  padding-top: 5px;
  padding-bottom: 5px;
  position: relative;
  border-left: 3px solid rgba(59, 130, 246, 0.2); 
  padding-left: 20px;
  transition: border-color 0.3s ease;
}

.timeline-description {
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
  padding-left: 0; 
  text-align: justify;
}

.timeline-skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); 
  gap: 5px;
  align-items: center;
  width: 100%;
}

.timeline-skills .badge {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 8px 5px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  text-align: center;
  white-space: normal;
}

/* Category 1: Python & Backend (Blue) */
.timeline-skills .skill-py { 
  background: rgba(59, 130, 246, 0.1) !important; 
  color: #2563eb; 
  border: 1px solid rgba(59, 130, 246, 0.2); 
}

/* Category 2: GIS Software & Hydro Tools (Green) */
.timeline-skills .skill-gis { 
  background: rgba(16, 185, 129, 0.1) !important; 
  color: #059669; 
  border: 1px solid rgba(16, 185, 129, 0.2); 
}

/* Category 3: WebGIS & Mapping (Purple) */
.timeline-skills .skill-web { 
  background: rgba(139, 92, 246, 0.1) !important; 
  color: #7c3aed; 
  border: 1px solid rgba(139, 92, 246, 0.2); 
}

/* Category 4: Databases & Project Management (Orange) */
.timeline-skills .skill-db { 
  background: rgba(245, 158, 11, 0.1) !important; 
  color: #d97706; 
  border: 1px solid rgba(245, 158, 11, 0.2); 
}

.timeline-skills .badge:hover {
  filter: brightness(0.2);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.timeline-item:hover::before {
  transform: scale(1.1);
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.6);
}

.timeline-item:hover .timeline-date {
  background: rgba(59, 130, 246, 0.15);
}

.timeline-item:hover .timeline-right {
  border-left-color: rgba(59, 130, 246, 0.6);
}

.timeline-item.current:hover::before {
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.6);
}

/* Pulse animation for current position */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}


/* ================= PROJECTS SECTION ================= */

#projects .container-fluid {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  height: 100%;
}

#projects .row {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

/* Grid container - JS will set grid-template-columns */
.projects-grid-container {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 10px;
  justify-content: center;
  align-content: center;
}

/* Card containers - JS will set width/height */
#projects .col-sm-6.col-lg-4 {
  margin: 0;
  padding: 0;
  display: flex;
  transition: all 0.3s ease;
}

#projects .card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(to right, #3b82f6, #8b5cf6) border-box;
}

/* Image takes 50% height */
.project-img {
  width: 100%;
  height: 50%;
  object-fit: cover;
  flex-shrink: 0;
  transition: all 0.4s ease;
}

/* Card body */
#projects .card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-top: 1px solid rgba(203, 213, 225, 0.6);
  background: linear-gradient(to bottom, #ffffff, #f5f9ff);
}

/* Card content wrapper - this will expand upward */
#projects .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Title stays at top */
.card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
  flex-shrink: 0;
}

#projects h5 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bolder;
}

/* Text expands upward */
.card-text {
  color: #4b5563;
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 7px !important;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Skills container stays fixed at bottom of card-body */
#projects .card-skill {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-top: 1px solid rgba(203, 213, 225, 0.6);
}

/* Hover State: Expand only the text area */
#projects .card:hover .card-body {
  height: 65%;
}

#projects .card:hover .card-text {
  -webkit-line-clamp: unset !important;
  display: block !important;
  overflow-y: auto !important;
}

#projects .card:hover .project-img {
  filter: blur(2px);
  transform: scale(1.05);
  filter: brightness(0.8);
}

#projects .card::before {
  content: "Click For Details";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  opacity: 0;
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

#projects .card:hover::before {
  opacity: 1;
  top: calc((100% - var(--final-body-height, 50%)) / 2);
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Badge styling */
#projects .badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  white-space: nowrap;
}

#projects .card-skill .badge {
  background: rgba(240, 247, 255, 0.9) !important;
  color: #2563eb;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

#projects .card-skill .badge:nth-child(odd) {
  background: rgba(240, 253, 250, 0.9) !important;
  color: #059669;
}

#projects .card-skill .badge:nth-child(even) {
  background: rgba(245, 243, 255, 0.9) !important;
  color: #7c3aed;
}

/* Scrollable container for many cards */
.projects-grid-container {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar */
.projects-grid-container::-webkit-scrollbar {
  width: 6px;
}

.projects-grid-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.projects-grid-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.projects-grid-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}


/* ================= PROJECT POPUP MODAL ================= */

.project-modal {
  position: fixed;
  width: 100%;
  max-width: 1500px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #ffffff;
  z-index: 1;
  display: none; 
  opacity: 0;
  box-shadow: 0 -15px 50px rgba(0,0,0,0.15);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.project-modal.active {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-container-inner {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Sidebar Styling */

.project-sidebar {
  width: 300px;
  background: #f1f5f9;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.project-sidebar {
  overflow-y: auto;
  height: 100%;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar-header {
  border: 5px solid rgba(255, 255, 255, 1);
  border-radius: 15px 0 0 0;
  position: relative;
}

.btn-return {
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, #fff1f2, #fde8e8);
  color: #7f1d1d;
  border: 1px solid rgba(244, 63, 94, 0.25);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  border-radius: 12px 0 0 0;
  font-weight: 500;
  cursor: pointer;
}

.btn-return:hover {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.18);
}

.btn-return i {
  display: inline-block;
}

.btn-return:hover i {
  animation: backWave 2s ease-in-out infinite;
}

@keyframes backWave {
  0%  { transform: translateX(-3px); }
  30%  { transform: translateX(-6px); }
  60%   { transform: translateX(-9px); }
  100% { transform: translateX(0); }
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
}

.sidebar-item {
  padding: 15px 20px;
  cursor: pointer;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.2s;
  font-weight: 500;
  color: #475569;
}

.sidebar-item:hover { background: #e2e8f0; }
.sidebar-item.active {
  background: #fff;
  color: #2563eb;
  border-left: 4px solid #2563eb;
}

/* Content Area Styling */

.project-display-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 40px;
  background: #fff;
}

/* Disable body scroll when modal is open */
body.modal-open {
  overflow: hidden !important;
}


/* ================= CONTACT ================= */

#contact .container {
  max-height: 600px !important;
}

#map-container {
  position: relative;
  height: 100%;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

#contactMap {
  height: 100%;
  width: 100%;
}

#locationOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(1px);
}

#locationOverlay h1 {
  background: black;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.distance-info-box {
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  color: #333;
  border-left: 5px solid #007bff;
  margin-bottom: 10px;
  margin-left: 10px;
  backdrop-filter: blur(4px);
  animation: slideIn 0.5s ease-out;
}

.distance-info-box b {
    color: #3b82f6;
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Rainbow Line Animation */
.rainbow-line {
    stroke-dasharray: 10, 10;
    animation: dashmove 2s linear infinite, rainbow-glow 5s linear infinite;
    cursor: auto;
}

@keyframes dashmove { to { stroke-dashoffset: -20; } }
@keyframes rainbow-glow {
    0% { stroke: #ff0000; }
    33% { stroke: #00ff00; }
    66% { stroke: #0000ff; }
    100% { stroke: #ff0000; }
}

.leaflet-control-layers-list {
  top: 0 !important;
  text-align: start;
}


.contact-info-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  padding: 2.5rem !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.iconbox {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  color: #3b82f6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
  transition: all 0.3s ease;
}

.contact-item:hover .iconbox {
  background: #3b82f6;
  color: #ffffff;
}

.contact-info {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 2px;
}

.contact-title {
  color: #3b82f6;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0;
  flex: 1;
  align-content: center;
}

.contact-info a { flex: 1; }

.contact-link, 
.contact-info address {
  color: #1e293b;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
  line-height: 1.4;
  margin: 0;
  font-style: normal;
}

/* Divider line inside the card */
.contact-divider {
  border: 0;
  height: 1px;
  background: black;
  margin: 39px 0 26px 0;
}

/* Container for the row */
.contact-social-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 5px;
}

/* Wrapper for icon + name */
.contact-social-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.contact-social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f8fafc;
  color: #64748b;
  font-size: 18px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0,0,0,0.03);
}

/* Name below icon */
.contact-social-name {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 8px;
  letter-spacing: 0.03em;
  transition: color 0.3s ease;
}

/* Hover Effects */
.contact-social-wrapper:hover .contact-social-icon {
  transform: translateY(-3px);
  color: #fff;
}

.contact-social-wrapper:hover .contact-social-name {
  color: #1e293b;
}

/* Brand Colors on Hover */
.contact-social-wrapper:hover .conact-linkedin { background-color: #0077b5 !important; box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3); }
.contact-social-wrapper:hover .conact-github   { background-color: #333 !important;    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.contact-social-wrapper:hover .conact-telegram { background-color: #0088cc !important; box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3); }
.contact-social-wrapper:hover .conact-whatsapp { background-color: #25d366 !important; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3); }


/* ================= Core Breakpoints ================= */

/* Mobile */
@media (max-width: 461px) {
  .nav-item {
    font-size: 10px;
  }
}

/* Mobile (Landscape) */
@media (max-width: 767px) {
  #navbarBrand {
    display: none;
  }
  #mainNavbar {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  #mainNavbar .navbar-nav {
    margin-left: 0 !important;
    justify-content: center;
  }

  html, body {
    overflow-y: auto !important;
    height: auto !important;
  }

  section:not(#contact section) {
    position: relative !important;
    height: auto !important; 
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    transform: none !important;
    margin-bottom: 50px;
  }
  .section-title {
    display: block;
    margin-top: 20px;
    text-align: center;
  }

  .photo-container, 
  #aboutPhoto {
    max-width: 60dvw !important;
    max-height: 60dvw !important;
  }
  #about {
    padding-top: 60px;
  }
  .social-container {
    display: none;
  }
  .about-intro {
    display: none !important;
  }
  h1 {
    font-size: 2em;
  }
  h5 {
    font-size: 1.2em;
  }
  .lead {
    font-size: 1em;
  }

  .timeline-item {
    flex-direction: column;
  }
  .timeline-left {
    flex-basis: fit-content !important;
    margin-bottom: 20px;
  }

  #contact {
    position: relative !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }

  .contact-div {
    margin-top: 0 !important;
  }

  #contact .container {
    max-height: none !important;
    height: auto !important;
  }

  #map-container {
    height: 400px !important;
    margin-bottom: 30px;
  }

  .contact-info-card {
    height: auto !important;
    padding: 1em !important;
    margin-bottom: 20px;
  }

  #locationOverlay h1 {
    font-size: 1em !important;
    padding: 0 10px;
    text-align: center;
  }

  #askLocationBtn {
    font-size: 0.8em !important;
    margin-left: 20px;
    margin-right: 20px;
  }
  .distance-info-box {
    font-size: 0.8em;
    padding: 5px;
  }

  html.mobile-scroll-locked,
  body.mobile-scroll-locked {
    overflow-y: hidden !important;
    height: 100% !important;
    touch-action: none;
  }

  .main-blur {
    filter: blur(10px);
    transition: filter 0.3s ease;
    pointer-events: none;
  }

  .project-sidebar {
    display: none;
  }
  .project-display-area {
    padding: 10px !important;
  }
  .project-modal {
    width: calc(100% - 40px);
  }

  /* Style for the new button created by JS */
  .mobile-close-btn {
    position: fixed;
    top: 0px;
    right: 0px;
    width: 20px;
    height: 20px;
    border-radius: 0 60% 0 0;
    background: #fed1d1;
    border: 1px solid #9b1e1e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mobile-close-btn i {
    color: #991b1b;
  }
}


/* Scroll view */
@media screen and (min-width: 768px) and (max-width: 1499px),
       screen and (min-width: 1500px) and (max-height: 849px) {
  html, body {
    overflow-y: auto !important;
    height: auto !important;
  }
  section:not(#contact section) {
    position: relative !important;
    height: auto !important; 
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    transform: none !important;
    margin-bottom: 50px;
  }
  .section-title {
    display: block;
    margin-top: 20px;
    text-align: center;
  }
  #about {
    padding-top: 60px;
  }
  html.mobile-scroll-locked,
  body.mobile-scroll-locked {
    overflow-y: hidden !important;
    height: 100% !important;
    touch-action: none;
  }
  .main-blur {
    filter: blur(10px);
    transition: filter 0.3s ease;
    pointer-events: none;
  }
  .project-modal {
    width: calc(100% - 40px);
  }
}

/* Contact Section */
@media screen and (min-width: 992px) and (max-width: 1109px) {
  .contact-div {
    width: 100%;
  }
}
@media screen and (min-width: 768px) and (max-width: 1109px) {
  .contact-div {
    margin-top: 0 !important;
  }
  #contact .container {
    max-height: none !important;
    height: auto !important;
  }
  #map-container {
    height: 400px !important;
    margin-bottom: 30px;
  }
}


/* Make vertical */
@media screen and (min-width: 768px) and (max-width: 1079px) {
  #about .row {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #about .col-md-8 {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .lead {
    text-align: center;
  }
  #about .col-md-8 .d-flex.flex-wrap {
    justify-content: center !important;
  }
  .timeline-item {
    flex-direction: column;
  }
  .timeline-left {
    flex-basis: fit-content !important;
    margin-bottom: 20px;
  }
}

@media screen and (min-width: 1080px) and (max-width: 1174px) {
  /* Photo Section */
  #about .col-md-4 {
    padding: 0 40px;
  }
  /* Desc Section */
  #about .col-md-8 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 0 !important;
  }
}

@media screen and (max-width: 1079px) and (max-height: 559px) {
  .photo-container, #aboutPhoto {
    max-width: 200px !important;
    max-height: 200px !important;
  }
  .social-container {
    display: none;
  }
  .about-intro {
    display: none !important;
  }
  #about .col-md-4 {
    margin-bottom: 1.5rem !important;
  }
}

@media screen and (min-width: 1175px) and (max-height: 559px) {
  .social-container {
    display: none;
  }
  #about {
    padding-bottom: 30px;
  }
}

@media screen and (min-width: 768px) and (max-width: 939px) {
  .project-sidebar {
    display: none;
  }
  /* Style for the new button created by JS */
  .mobile-close-btn {
    position: fixed;
    top: 0px;
    right: 0px;
    width: 20px;
    height: 20px;
    border-radius: 0 60% 0 0;
    background: #fed1d1;
    border: 1px solid #9b1e1e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .mobile-close-btn i {
    color: #991b1b;
  }
}
