/* ----------------------------------------- BASE SECTION ------------------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
  max-width: 100%;
  overflow-wrap: break-word;
}

html {
  scroll-behavior: smooth; 
}

:root {
  --bg-color: #0f0f1a;
  --text-color: #ffffff;
  --primary-color: #00bfff;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

section,
.project {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 1rem;
  margin: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; 
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 191, 255, 0.15);
  border-color: rgba(0, 191, 255, 0.3);
}

/* ------------------------------------ NAVBAR ------------------------------------ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  background: rgba(15, 15, 26, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--glass-border);
  transition: transform 0.3s ease-in-out; 
}

.navbar-hidden {
  transform: translateY(-100%);
}

.navbar .logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  letter-spacing: 1px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* ------------------------------------ HERO SECTION ------------------------------------ */
#hero {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("./Images/background1.jpg") no-repeat center center / cover;
  padding: 8rem 2rem 6rem; 
  margin-top: 0;
  border-radius: 0 0 12px 12px;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.hero-image img {
  max-width: 380px;
  width: 100%;
  border-radius: 0.5rem;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.2);
}

.hero-text h2 { font-size: 3.5rem; font-weight: 700; margin: 0; }
.hero-text p { font-size: 1.2rem; margin: 1rem 0; }
.hero-desc { color: #cccccc; max-width: 500px; margin-bottom: 2rem; }

.intro-tag {
  background: #ffffff;
  color: #000000;
  padding: 0.4rem 1.2rem;
  font-weight: bold;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.visitor-count {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(5, 10, 25, 0.95);
  color: #f4f7ff;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(45, 120, 255, 0.25);
}

.visitor-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(45, 120, 255, 0.15);
  color: #65b0ff;
  border-radius: 50%;
  font-size: 1rem;
}

.visitor-count strong {
  color: #65b0ff;
  font-size: 1rem;
}

.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.btn-primary, .btn-secondary {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.btn-primary { 
  background: #ffffff; 
  color: #000000; 
  border: none; 
  font-weight: bold;
}
.btn-primary:hover { 
  background: #dddddd; 
  transform: translateY(-2px);
}

.btn-secondary { 
  background: transparent; 
  border: 2px solid #ffffff; 
  color: #ffffff;
}
.btn-secondary:hover { 
  background: #ffffff;
  color: #000000;
  transform: translateY(-2px); 
}

.highlight-container span {
  animation: highlight 1s forwards;
  animation-delay: var(--delay);
  opacity: 0.5;
}
@keyframes highlight {
  0% { background-color: var(--primary-color); opacity: 1; }
  100% { background-color: inherit; opacity: 1; }
}

/* ------------------------------------ 3-COLUMN PROJECTS LAYOUT ------------------------------------ */
section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.video-description-container {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  padding: 0;
  align-items: center;
  width: 100%;
}

.video-wrapper {
  flex: 1 1 25%; 
  min-width: 0;
}

.project-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.project-description-box {
  flex: 1 1 50%; 
  min-width: 0;
}

.project-description-box h2 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.project-description-box p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.image-scroller {
  flex: 1 1 25%; 
  min-width: 0;
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  
  /* We removed scroll-behavior: smooth; here to fix mobile swiping issues */
  -webkit-overflow-scrolling: touch; /* Ensures smooth momentum swiping on iOS */
  
  scrollbar-width: none; 
  -ms-overflow-style: none;
}
.image-scroller::-webkit-scrollbar {
  display: none; 
}

.scroller-img {
  height: 160px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
  background-color: rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.scroller-img:hover {
  transform: scale(1.05);
}

/* General Project Text / Buttons */
.tech {
  display: inline-block;
  background-color: rgba(0, 191, 255, 0.1); 
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: 20px; 
  padding: 4px 12px;
  margin: 4px 4px 4px 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.button-group { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.project-button {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05); 
  color: var(--text-color);
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.project-button:hover { 
  background-color: var(--primary-color); 
  color: #000; 
  border-color: var(--primary-color); 
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 191, 255, 0.4);
}

.disabled-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: #888;
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: not-allowed;
}

/* ------------------------------------ CERTIFICATES 3x3 GRID ------------------------------------ */
#certificates-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 1rem;
}

#certificates-container .project {
  margin: 0; 
  width: auto;
}

#certificates-container h3 a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.3s;
}

#certificates-container h3 a:hover {
  color: var(--primary-color);
}

/* --------------------------------- MODAL (POPUP IMAGE) -------------------------------------------- */
.modal {
  display: none; 
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}
.modal-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 10px;
}
.close {
  position: absolute;
  top: 20px;
  right: 30px;
  background-color: red;
  color: white;
  font-size: 30px;
  border: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  border-radius: 50%;
}

/* --------------------------------- FLOATING BUTTONS -------------------------------------------- */
.floating-socials {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
  transform: translateY(20px);
}
.floating-socials.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.float-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}
.float-btn:hover {
  transform: scale(1.1);
  color: white;
}
.float-wa {
  background-color: #25d366; 
}
.float-email {
  background-color: var(--primary-color); 
}

/* --------------------------------- FOOTER -------------------------------------------- */
footer {
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  padding: 2rem 1rem;
  margin-top: 3rem;
  text-align: center;
  color: var(--text-color);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-content p {
  opacity: 0.7;
  font-size: 0.95rem;
}

.footer-socials {
  display: flex;
  gap: 1.5rem;
  font-size: 1.5rem;
}

.footer-socials a {
  color: var(--text-color);
  transition: color 0.3s, transform 0.3s;
}

.footer-socials a:hover {
  color: var(--primary-color);
  transform: translateY(-3px);
}

/* --------------------------------- RESPONSIVE QUERIES -------------------------------------------- */
@media (max-width: 1024px) {
  .hero-content { flex-direction: column; text-align: center; }
  .hero-image { order: -1; margin-bottom: 2rem; max-width: 320px; }
  .hero-buttons { justify-content: center; }
  
  .video-description-container { flex-direction: column; align-items: stretch; }
  .video-wrapper, .project-description-box, .image-scroller { flex: 1 1 auto; width: 100%; }
  .image-scroller { padding-top: 1rem; }
  
  #certificates-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar { flex-direction: column; padding: 1rem; gap: 1rem; }
  .nav-links { gap: 1rem; flex-wrap: wrap; justify-content: center; }
  #hero { padding-top: 11rem; }
  #certificates-container { grid-template-columns: 1fr; }
  
  .floating-socials { bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
  .hero-text h2 { font-size: 2.2rem; }
  .scroller-img { height: 140px; } 
}