/* layout.css -*/

/* ================================
HEADER
================================ */

header{

  position:fixed;
  top:0;
  left:0;
  width:100%;
  z-index:1000;
  height:var(--header-height);
  background:rgba(243, 245, 249, 0.9);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border);

}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px; /* Add side padding for mobile safety */
  width: 100%;
  max-width: 100%; /* Break out of any parent container limits */
}

.nav-links{
  display:flex;
  align-items:center;

  gap:25px;

  flex:1;

  justify-content:center; 
  gap:clamp(12px, 1.5vw, 24px);

  min-width:0;


  gap:clamp(12px, 1.5vw, 24px);
  flex-shrink:1;
  
  white-space:nowrap;

}

/* 1. Base nav-item styling */
.nav-links .nav-item {
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    transition: color 0.3s ease;
    padding-bottom: 5px; /* Creates space for the line */
}

.nav-links .nav-item:hover {
    color: var(--primary);
}

/* 2. The Line (Hidden by default) */
.nav-links .nav-item::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.4s ease-out;
}

/* 3. Targeted Active State */
/* We specifically target the active class to trigger the animation */
.nav-links .nav-item.active {
    color: var(--primary) !important;
}

.nav-links .nav-item.active::after {
    width: 100% !important;
    
}
/*=================*/



/* --- Hamburger Icon Styling --- */
.menu-toggle {
  display: none; /* CHANGED: Hide by default on desktop */
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 3020; /* Ensure it appears above the search input when expanded */
}

.menu-toggle .bar {
  width: 25px;
  height: 3px;
  background-color: var(--text-main);
  transition: 0.3s ease;
}

/* Transform hamburger to X when active */
.menu-toggle.active .bar:nth-child(1) { 
  transform: translateY(8px) rotate(45deg); 
}
.menu-toggle.active .bar:nth-child(2) {
  opacity: 0; 
}
.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg); 
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--text-main);
  border-radius: 10px;
  transition: all 0.3s linear;
}

.menu-close {
  display: none;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: var(--text-main);
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
}


/* ========================
Show hamburger on mobile 
============================*/
@media  (max-width: 1230px), (max-height: 600px) and (orientation: portrait),
  (max-width: 992px) and (max-height: 700px), (orientation: portrait) and (max-height: 700px),
  (max-width: 992px) and (orientation: portrait), (max-width: 768px) and (orientation: portrait),
  (max-width: 992px) and (max-height: 700px) and (orientation: portrait),
  (max-width: 768px) and (max-height: 700px) and (orientation: portrait),
  (max-width: 992px) and (orientation: portrait) and (max-height: 700px),
  (max-width: 768px) and (orientation: portrait) and (max-height: 700px) ,
  (min-height: 500px) and (orientation: portrait) ,
  (min-height: 500px) and (orientation: portrait) and (max-width: 992px),
  (min-height: 500px) and (orientation: portrait) and (max-width: 768px) ,
  (min-height: 500px) and (orientation: portrait) and (max-width: 992px) and (max-height: 700px),
  (min-height: 500px) and (orientation: portrait) and (max-width: 768px) and (max-height: 700px) ,
  (min-height: 500px) and (orientation: portrait) and (max-width: 992px) and (orientation: portrait) and (max-height: 700px),
  (min-height: 500px) and (orientation: portrait) and (max-width: 768px) and (orientation: portrait) and (max-height: 700px),
  (max-width: 992px) and (orientation: portrait) and (max-height: 700px) and (min-height: 500px),
  (max-width: 768px) and (orientation: portrait) and (max-height: 700px) and (min-height: 500px) {
  
    .nav-links{
    display:none;
  }

  .menu-toggle {
    display: flex !important; /* Show it on mobile */
    position: relative;
    z-index: 4000; /* Higher than search components */
  }

   /* When the toggle script adds the 'active' class to nav-links */
  .nav-links.active {
    display: flex !important; /* Show the menu */
    flex-direction: column;   /* Stack items vertically */
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    z-index: 6000; /* Ensure it appears above the header and search input */
  }

}

/* =========================
   HEADER SEARCH
========================= */
.nav-search input {
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  outline: none;
  min-width: 160px;
  transition: 0.2s ease;
}

.nav-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.nav-search{
  flex-shrink:0;
}

/* =========================
   NAV DROPDOWN (ABOUT)
========================= */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: -40px;
  transform: translateX(-50%);
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  min-width: 180px;
  display: none;
  flex-direction: column;
  padding: 8px 0;
  z-index: 1000;
}

.dropdown-menu a {
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: #f1f5f9;
  color: var(--primary);
}

/* Show on hover */
.dropdown:hover .dropdown-menu {
   position: absolute;
  display: flex;
}

/* Dropdown Exclusion */
/* Ensure the dropdown menu items don't inherit the main link underline logic */
.dropdown-menu .nav-item.active::after {
    display: none !important;
}
/* =============
Home PAGE HERO
================ */
.home-icon{
  width:22px;
  height:22px;
  cursor:pointer;
  vertical-align:middle;
  transition:transform 0.2s ease;
}

.home-icon:hover{
  transform:scale(1.15);
}



/* =================================
GITHUB STYLE ICONS
================================ */
.github-icon {
  width: 22px;
  height: 22px;
  margin-right: 8px;
  vertical-align: middle;
  transition: transform 0.2s ease;
 
}
.github-icon:hover {
  transform: scale(1.1);
}


.linkedin-icon {
  width: 22px;
  height: 22px;
  margin-right: 8px;
  vertical-align: middle;
  transition: transform 0.2s ease;
 
}
.linkedin-icon:hover {
  transform: scale(1.1);
}

.linkedin-text {
  font-size: 2vw; /* scales with viewport width */
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.5px;
}

@media (max-width: 480px) {
  .linkedin-text {
    font-size: 16px;
  }
}
/* =========================
   HEADER ROWS
========================= */

.nav-row {
  width: 100%;
  display: flex;
  align-items: center;
  border-color: red;
}

/* ROW 1 */
.nav-top{
  display:flex;
  align-items:center;
  width:100%;
  gap:20px;
  border-color: red;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:12px;

  margin-left:auto;
  flex-shrink:0;

  position:relative;
  z-index:3000;
}

/* Ensure nav-links align right */
.nav-bottom .nav-links {
  width: auto;
  justify-content: flex-end;
}

 

/* Always show icon, hide input by default on small screens */
.nav-search {
  position: relative;
}



/* =========================
   HEADER SEARCH
========================= */
/* Update these sections in layout.css */

.nav-search-container {
  position: relative;
  width: 42px;          /* collapsed width = icon only */
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  overflow: visible;
}

/* SEARCH INPUT (collapsed by default) */
#siteSearch {
  position: absolute;
  top: 0;
  right: 42px;          /* always expand LEFT of icon */
  height: var(--header-height);
  width: 0;
  opacity: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: white;
  font-size: 0.9rem;
  pointer-events: none;
  transition: 
    width 0.28s ease, 
    opacity 0.2s ease, 
    padding 0.28s ease;
  z-index: 3000;
}

/* VISIBLE STATE */
/* EXPANDED STATE */
#siteSearch.show {
  width: 800px; /* Expand to full width of container */
  opacity: 1;
  padding: 0 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  z-index: 5000 !important; /* Ensure it appears above the hamburger and other elements */

  transform: translateY(-19.5%); /* Perfectly center it vertically */
  position: absolute;      /* Ensure it respects the top/transform logic */
}


/* SEARCH ICON BUTTON */
.search-icon-btn,
#searchToggle {
  position: absolute;
  right: 0;
  top: 0;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4000;        /* always above input */
}


.search-icon-btn img {
  width: 28px;
  height: 28px;
  pointer-events: none;
}



/* ================================
MEDIA SCREEN RESPONSIVENESS
================================ */

@media (max-width:768px){
  
  .nav-container{
    flex-wrap:nowrap;
  }

 
  .header-actions{
    margin-left:auto;
  }

}  
/* MOBILE — prevent collisions with hamburger */
@media  (max-width: 1230px), (max-height: 600px) and (orientation: portrait),
  (max-width: 992px) and (max-height: 700px), (orientation: portrait) and (max-height: 700px),
  (max-width: 992px) and (orientation: portrait), (max-width: 768px) and (orientation: portrait),
  (max-width: 992px) and (max-height: 700px) and (orientation: portrait),
  (max-width: 768px) and (max-height: 700px) and (orientation: portrait),
  (max-width: 992px) and (orientation: portrait) and (max-height: 700px),
  (max-width: 768px) and (orientation: portrait) and (max-height: 700px) ,
  (min-height: 500px) and (orientation: portrait) ,
  (min-height: 500px) and (orientation: portrait) and (max-width: 992px),
  (min-height: 500px) and (orientation: portrait) and (max-width: 768px) ,
  (min-height: 500px) and (orientation: portrait) and (max-width: 992px) and (max-height: 700px),
  (min-height: 500px) and (orientation: portrait) and (max-width: 768px) and (max-height: 700px) ,
  (min-height: 500px) and (orientation: portrait) and (max-width: 992px) and (orientation: portrait) and (max-height: 700px),
  (min-height: 500px) and (orientation: portrait) and (max-width: 768px) and (orientation: portrait) and (max-height: 700px),
  (max-width: 992px) and (orientation: portrait) and (max-height: 700px) and (min-height: 500px),
  (max-width: 768px) and (orientation: portrait) and (max-height: 700px) and (min-height: 500px) {
  #siteSearch.show {
    width: min(220px, 96vw);
  }

}



@media (max-width: 768px) {

  .hero-text {
    font-size: 1.1rem;
    margin-bottom: 40px;
    padding: 0 12px;
  }

  .hero-text-white-bg {
    font-size: 1.8rem;
    margin-bottom: 40px;
    padding: 0 12px;
  }

  .hero-content {
    bottom: 20px;
    width: 90%;
  }
}

/* Ensure the main container doesn't restrict the Hero on mobile */
@media (max-width: 480px) {
  

  * {
    box-sizing: border-box;
  }

  
  /* Remove padding from the container specifically when it holds the hero */
  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Ensure the header still has its side padding even if the main container is 0 */
  .nav-container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  

  /* Force the Hero to be the full width of the screen */
  .hero {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important; /* Use 100% instead of 100vw to avoid scrollbar bugs */
    max-width: 100vw;
    display: flex;
  }

  /* Make the container fill the hero exactly */
  .hero-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    /*height: 100% !important;*/
    /* This ensures the red border sits exactly on the edge of the green one */
    flex: 1; 
    display: flex;
    flex-direction: column;

    height: auto !important;
    min-height: 100%;
  }


  /* Ensure slides don't have internal margins pushing them away from the edge */
  .slide {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 5. Ensure images/videos inside cover the whole area */
  .hero-image, .hero-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }
}

