.header{
  color: var(--button-text);
  font-size: 20px;
  display:flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  position:fixed;
  top: 0;
  right: 0;
  left: 0;
  background-color: var(--button-bg);
  height: 80px;
  border-bottom: 2px solid #2a2a35;
  z-index: 100;
  transition: all linear 0.4s;
  
 
}
.header.scrolled {
  background-color: var(--bg-gradient);
  box-shadow: 0 2px 12px var(--container-shadow);
  border-bottom: 2px solid var(--text-primary);
  color: var(--text-primary);
  border: none;
  opacity: 1;
  transition: all  ease-in 0.4s;
  backdrop-filter:blur(20px);
}

.header.scrolled a {
  color: var(--text-primary); 
  transition: all ease 0.4s;
}
.left-section{
  margin-left: 30px;
  font-size: 22px;
  font-weight: 700;
}
.right-section{
  display:flex; 
  gap: 24px;
  margin-right: 30px;
}

a{
  text-decoration: none;
  color: var(--button-text);
  transition: transform 0.15s;
  display: inline-block;
  transition: color 0.7s;
}
a:hover{
  color: black;;
  transform: scale(1.05);
}
a:active{
  opacity: 0.65;
  transform: scale(0.97);
}


.right-section {
  position: relative;
}
.nav-underline {
  position: absolute;
  left: 0;
  bottom: 0px;
  height: 2.5px;
  width: 40px;
  background: var(--accent-color);
  border-radius: 2px;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  z-index: 2;
  pointer-events: none;
}
body.dark-mode .nav-underline {
  background: var(--text-primary);
}


.right-section a,
.right-section a.active,
.right-section a:hover,
body.dark-mode .right-section a.active,
body.dark-mode .right-section a:hover {
  border-bottom: none !important;
}
.right-section a::after,
.right-section a.active::after,
.right-section a:hover::after,
body.dark-mode .right-section a.active::after,
body.dark-mode .right-section a:hover::after {
  display: none !important;
  content: none !important;
}

.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  top: auto;
  left: auto;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-color) 60%, var(--heading-color) 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2000;
  box-shadow: 0 4px 16px rgba(46,42,42,0.13);
  opacity: 0.92;
  transition: background-color 0.2s, color 0.2s, opacity 0.2s, transform 0.2s;
  outline: none;
  border: 2px solid #fff2;
  animation: fadeInUpBtn 0.5s cubic-bezier(0.4,0,0.2,1);
}
.scroll-to-top:hover {
  background: linear-gradient(135deg, var(--heading-color) 60%, var(--accent-color) 100%);
  color: #fff;
  opacity: 1;
  transform: scale(1.12);
  box-shadow: 0 8px 32px rgba(46,42,42,0.18);
}
.scroll-to-top svg {
  width: 22px;
  height: 22px;
  display: block;
}
@keyframes fadeInUpBtn {
  from { opacity: 0; transform: translateY(30px) scale(0.8); }
  to { opacity: 0.92; transform: translateY(0) scale(1); }
}
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  .scroll-to-top svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: center;
    height: auto;
    padding: 10px 0 0 0;
  }
  .left-section {
    margin: 0 0 8px 0;
    font-size: 18px;
    text-align: center;
  }
  .right-section {
    flex-direction: row;
    gap: 10px;
    font-size: 10px;
    margin: 0;
    justify-content: center;
    flex-wrap: wrap;
  }
  .right-section > div {
    margin: 0;
  }
  .mode-toggle {
    font-size: 18px;
    padding: 4px 8px;
  }
}

.right-section a {
  position: relative;
  transition: color 0.2s;
}
.right-section a.active::after,
.right-section a:hover::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2.5px;
  width: 100%;
  background: var(--accent-color);
  border-radius: 2px;
  bottom: -2px;
  transition: background-color 0.2s;
  
}



@media (max-width: 768px) {
  .header {
    flex-direction: column;
    background-color: #13131a;
    width: 100%;
    padding: 1%;
    position: fixed;
    top: 3;
    left: 0;
  }
  .left-section{
    margin: auto;
    
  }

  .right-section{
    margin: auto;
    gap: 16px;
    font-size: 14px;
  }
  
}

:root {
  --bg-gradient: linear-gradient(90deg, #647079 0%, #ffffff 100%);
  --bg-color: #f7f7f7; 
  --text-primary: #2a2a35;
  --text-secondary: #555555; 
  --heading-color:#214967;
  --accent-color: #944e8b;

  --container-bg: rgba(255, 255, 255, 0.08);
  --container-border: rgba(255, 255, 255, 0.15);
  --container-shadow: rgba(46, 42, 42, 0.4);

  
  --input-border: #444;
  --input-focus-shadow: rgba(148, 78, 139, 0.6);
  
  --link-hover: #944e8b;
}
body.dark-mode {
  --bg-gradient:  linear-gradient(90deg, #13131a 0%, #1c1f2a 100%);
  --bg-color: #214967;
  --text-primary: #FFF5E1;
  --text-secondary: #555555; 
  --heading-color:#94b9d4;
  --accent-color: #944e8b;

  --container-bg: rgba(255, 255, 255, 0.08);
  --container-border: rgba(255, 255, 255, 0.15);
  --container-shadow: rgba(56, 56, 61, 0.4);

  --button-bg:#f7f7f7dc;
  --button-text:#214967;
  --button-hover-bg:var(--button-text);
  --button-hover-text:var(--button-bg);

  --black-font: #fff5e1;
  --input-border: #444;
  --input-focus-shadow: rgba(148, 78, 139, 0.6);
  
  
}

body {
  transition: background-color 0.4s ease, color 0.4s ease;
}
.container,
.hero,
.project-container {
  transition: all 0.4s ease;
}

.mode-toggle svg {
  color: var(--button-text);
  transition: all 0.3s ease;
}

.mode-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 1px;
  transition: all 0.3s ease;
}

.mode-toggle svg.scrolled{
  color: var(--text-primary);
}

.scroll-to-top {
  z-index: 9999;
  pointer-events: auto;
}
.scroll-to-top.show {
  display: flex;
}
body.dark-mode .scroll-to-top {
  background: linear-gradient(135deg, var(--heading-color) 60%, var(--accent-color) 100%);
  color: #222;
  transition: all 0.2s, color 0.2s;
}
body.dark-mode .scroll-to-top:hover {
  background: linear-gradient(135deg, var(--accent-color) 60%, var(--heading-color) 100%);
  transition: all 0.2s, color 0.2s;
  opacity: 1;
  transform: scale(1.12);
  box-shadow: 0 8px 32px rgba(46,42,42,0.18);
  color: #222;
}
