:root{
  --background-color: #ffffe9;
  --secondary-color: rgb(64, 116, 176);
}

body{
  font-family: 'Open Sans', 'Helvetica Neue', sans-serif;
  padding-top: 70px;
  transition: all 0.8s ease;
}

/* ===== MAIN NAVBAR CONTAINER ===== */
 .topnavbar{
  justify-content:space-between;
  position: fixed;
  top:0;
  left:0;
  width: 100%;
  height: 70px;
  background-color: var(--background-color); 
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
  z-index: 1000;
  transition: all 0.8s ease;
}

.topnavbar, .right-container, .links-container{
  display: flex;
  align-items: center;
}

/* RIGHT CONTAINER STYLES */
.right-container{
  gap: 15px;
}

/* ===== NAVIGATION LINKS CONTAINER ===== */
.links-container{
  justify-content: space-between;
  gap: 18px;
}

/* ===== NAVIGATION LINKS ===== */
.links-container a{
  text-decoration: none;
  color: black; 
  padding: 10px 15px ;
  transition: all 0.3s ease;
}

/* ===== LOGO STYLES ===== */
.nav-logo{
  font-size: 40px;
  font-weight: bold;
  margin-left: 10px ;
}

/* ===== HOVER EFFECTS ===== */
.nav-links:hover{ 
  font-weight: bold;
  background-color: var(--secondary-color);
  color:white ;
  padding: 15px 20px;
  border-radius: 5px;
  transform: scale(1.05);
  transition:  transform 0.3s ease, background-color 0.3s ease;
} 


/* ===== SEARCH CONTAINER ===== */
.search-container{
  position: relative;
  margin: 0 10px;
}

/* ===== SEARCH INPUT FIELD ===== */
/* Base styles for the search input with compact initial state */
.search-container input{
  font-weight: bold;
  color: gray;
  width: 40px;
  height: 45px;
  padding: 0;
  border: none;
  border-radius: 20px;
  z-index: 0;
  transition: width 0.3s;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.84);
} 

/* ===== PLACEHOLDER STYLING ===== */
/* Hide placeholder text when search is collapsed */
.search-container input::placeholder{
  color: transparent;
  transition: color 0.2s;
}

/* ===== SEARCH ICON ===== */
/* Styled magnifying glass icon that triggers expansion */
.search-icon{
  width: 35px;
  height: 28px;
  text-align: center;
  background-color: var(--secondary-color);
  color:  white;
  padding-top: 10px;
  border-radius: 50%;
  position: absolute;
  right: 2.5px;
  top: 3px;
  z-index: 1;
  cursor: pointer;
}
/* ===== EXPANDED SEARCH STATE ===== */
/* Styles applied when search is expanded via JavaScript */
.search-container input.search-expanded{
  width: 180px;
  padding: 0 40px 0 20px;
}

/* ===== EXPANDED PLACEHOLDER ===== */
/* Show placeholder text when search is expanded */
.search-container input.search-expanded::placeholder{
  color: gray;
}


/* ===== DARK MODE TOGGLE BUTTON ===== */
/* Container for the toggle switch with pill-shaped design */
/* Provides visual representation of light/dark mode state */
.btn{
  width: 60px;
  height: 30px;
  border: none;
  border-radius: 20px;
  background-color: #fae5ab; /* Orange background for light mode */
  position: relative;
}

/* ===== TOGGLE THUMB/SLIDER ===== */
/* The circular element that moves left/right to indicate state */
/* Visual indicator of current mode selection */
.btn span{
  position: absolute;
  width: 25px;
  height: 25px;
  left: 3px;
  top: 2px;
  background-color: rgb(255, 255, 255);
  border-radius: 50%;
  transition: all 0.8s ease;
}

/* the sun icon */
.btn span i{
  display: block;
  font-size: 1.1rem;
  color: rgb(255, 145, 0);
  position: absolute;
  top: 3.2px;
  left: 3px;
}

/* ===== DARK MODE GLOBAL STYLES ===== */
/* Applied to body or parent container when dark mode is active */
/* Transforms entire color scheme to dark theme */
.dark-mode{
  background-color: black;
  color: white;
  transition: all 0.8s ease;
}

.dark-mode .topnavbar{
  background-color: #333; /* Darker navbar background for dark mode */
  box-shadow: 0 2px 5px rgba(255, 255, 255, 0.368); /* Lighter shadow for dark mode */
  transition: all 0.8s ease;
}

.dark-mode .nav-links,.dark-mode .nav-logo{
  color: white; /* Light text for dark mode */
}

.dark-mode .btn{
  background-color: var(--secondary-color); /* Change toggle background for dark mode */
}
.dark-mode .language-icon .language-toggle i{
  color: rgb(198, 216, 235);
}

/* ===== DARK MODE THUMB/SLIDER ===== */
/* Thumb transformation when dark mode is activated */
/* Moves to right side and changes color for visual feedback */
.dark-mode .btn span{
  background-color: rgb(255, 255, 255);
  transform: translateX(30px);
}

/* the hamburger menu */
.dark-mode .hamburger-line{
  background-color: white;
}

/* ===== LANGUAGE ICON CONTAINER ===== */
/* Wrapper element for the language selector component */
/* Provides spacing and positioning within the navbar */
.language-icon {
  margin-left: 10px;             
  display: flex;                  /* Enable flexbox for vertical centering */
  align-items: center;          
}

/* ===== LANGUAGE TOGGLE BUTTON ===== */
/* Interactive button for language selection functionality */
/* Designed to be minimal and blend with navbar aesthetics */
.language-icon .language-toggle {
  background: none;              
  border: none;                   
  cursor: pointer;              
  color: inherit;                 
  padding: 8px;                  
  border-radius: 4px;            
  transition: background-color 0.2s ease;
}

/* ===== HOVER STATES ===== */
/* Visual feedback when interacting with language button */
.language-icon .language-toggle:hover {
  background-color: rgba(0, 0, 0, 0.1); 
}

/* ===== LANGUAGE ICON STYLING ===== */
/* Font Awesome icon customization within the button */
.language-icon .language-toggle i {
  display: block;            
  font-size: 2rem;  
  color: var(--secondary-color);
  transition: transform 0.2s ease; 
}

/* ===== INTERACTIVE FEEDBACK ===== */
/* Visual response to user interactions */
.language-icon .language-toggle:hover i {
  transform: scale(1.1);          
}

.language-icon .language-toggle:active i {
  transform: scale(0.95);        
}



/* ===== AUTHENTICATION LINKS ===== */
.auth-links{
  display: flex;
  gap: 5px; /* Space between Login and Sign Up */
  margin-right: 4px;
}
.auth-links a{
  text-decoration: none;
  font-weight: bold;
  background-color: var(--secondary-color);
  color: white;
  padding: 8px 10px;
  border-radius: 20px;
}
.auth-links a:hover{
  background-color: rgb(38, 38, 134);
}


/* ===== MOBILE MENU TOGGLE ===== */
.mobile-menu-toggle {
  display: none;
  background-color: transparent; 
  border: none;
}
.hamburger-line {
  display: block;
  width: 25px;
  height: 3px;
  background-color: black;
  margin: 4px 0 4px 8px;
  transition: all 0.3s ease;
}

/* Hamburger to X animation */

/* Target the button when active */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -7px);
}

/* ====Media Queries==== */
/* Mobile Small (0 - 479px) */
@media (max-width: 479px) {
  body{
    padding-top: 80px !important;
  }
  .topnavbar {
    flex-direction: column;
    width: 100%;
    max-height: 25px;
    padding: auto;
  } 

  .mobile-menu-toggle {
    display: block;
    align-self: flex-start;
    margin: 20px 10px 0 0; /* aligns to the left */
  }
 
  .links-container {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
  }
  .links-container .nav-logo{
    font-size: 1.5em;
    position: absolute;
    top: 10px;
    left: 22px;
  }
  
  .links-container .nav-links{
    display: none;
    margin-top: 20px;
    padding: 0 10px 0 5px;
    font-size: 1.2em;
    gap: 12px;
  }

  .search-container{
    position: absolute;
    top: 10px;
    right: 1px;
    z-index: 1;
  }

  .btn{
    position: absolute;
    top: 18px;
    right: 105px;
  }
  .language-icon{
    position: absolute;
    top: 25px;
    right: 50px;  
  }

  .auth-links{
    display: none;
    margin: 0 0 20px;
  }
  .nav-links.menu-open, .auth-links.menu-open{
    display: block;
    margin-top: 15px;
    margin-bottom: 20px !important;
  }
  .topnavbar.menu-height{
    height: auto;
    max-height: 120px !important;
  }
}

/* large screens  */
@media (min-width: 480px) {
  .topnavbar{
    height: 70px !important;
  }
  .nav-links,
  .auth-links {
      display: block; /* Force visible */
  }
}

/* Mobile large (480px - 767px) */  
@media (max-width: 767px) {
  body{
    padding-top: 120px;
  }
  .topnavbar {
    flex-direction: column;
    width: 100%;
    height: 200px;
    padding: 0 0 50px;
  }
  .links-container{
    justify-content: end;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: 0.8em;
  }
}


/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1048px) {
  body{
    padding-top: 130px;
  }
  .topnavbar {
    flex-direction: column;
    justify-content: space-around;
    height: 120px !important;
    padding: 8px 20px;
  }
  .links-container{
    justify-content: space-around;
    margin-top: 0;
  }
}