/* header.css - Rectangular buttons with rounded edges */

:root {
  /* New colors for buttons - Same as content page */
  --button-bg: rgba(62, 97, 167, 0.105); /* Dark background */
  --button-text: #000000; /* Light gray text */
  --button-hover-bg: rgba(48, 37, 245, 0.95);
  --button-border: rgba(241, 255, 44, 0.1);
  --button-active-bg: rgba(30, 25, 150, 0.95);
  --button-active-text: #ffffff;
  --button-active-border: rgba(241, 255, 44, 0.3);

    /* Navbar colors */
  --navbar-bg: rgba(221, 220, 220, 0.815); /* 50% opacity */
  --navbar-border: rgba(241, 255, 44, 0.15);
}

/* Header */
header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  height: 80px; /* Fixed height for navbar */
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

/* Navbar Container - Fitted around buttons */
.navbar-container {
  background: var(--light);
  backdrop-filter: blur(10px); /* Glass effect */
  -webkit-backdrop-filter: blur(10px);
  border-radius: 40px;
  border: 1px solid var(--navbar-border);
  padding: 0 5px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: fit-content;
  max-width: 90%;
  margin: 0 auto;
  /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); */
  transition: all 0.3s ease;
  pointer-events: auto;
  /* opacity: 0.8; 50% opacity overall */
}

.navbar-container:hover {
  opacity: 1;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  border-color: rgba(241, 255, 44, 0.25);
}

/* Navbar buttons container */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 0;
  gap: 10px; /* Reduced gap for better fitting */
  pointer-events: none;
  width: 100%;
}

/* Rectangular buttons with rounded edges */
.button {
  position: relative;
  min-width: 100px;
  height: 40px; /* Reduced height for better fit */
  padding: 0 20px; /* Reduced padding */
  border-radius: 20px; /* Slightly less rounded */
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--button-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  pointer-events: auto;
  z-index: 1001;
  /* opacity: 0.9; Slightly more visible */
  transform: translateY(0);
  box-shadow: none; /* No shadow by default */
  flex-shrink: 0; /* Prevent buttons from shrinking */
}

/* Active button state */
.button.active {
  background: var(--button-active-bg);
  color: var(--button-active-text);
  border-color: var(--button-active-border);
  font-weight: 600;
  box-shadow: 0 0 15px rgba(241, 255, 44, 0.2);
  opacity: 1;
}

/* Home button - icon only */
.button:first-child {
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 20px;
    margin-right: 5px; /* Small separation from next button */
}

/* Hide text in home button */
.button:first-child span {
  display: none;
}

/* Hide icons in all buttons except home */
.button:not(:first-child) i {
  display: none;
}

/* Show icon only in home button */
.button:first-child i {
  display: block;
  font-size: 20px;
  transition: all 0.3s ease;
}

/* Button text styling */
.button span {
  display: block;
  font-weight: 500;
  letter-spacing: 0.5px;
    white-space: nowrap; /* Prevent text wrapping */
}

/* Initial animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar-container {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.button {
  animation: slideDown 0.5s ease forwards;
}

/* Staggered entrance */
.button:nth-child(1) { animation-delay: 0.1s; }
.button:nth-child(2) { animation-delay: 0.2s; }
.button:nth-child(3) { animation-delay: 0.3s; }
.button:nth-child(4) { animation-delay: 0.4s; }
.button:nth-child(5) { animation-delay: 0.5s; }

/* Hover effects */
.button:hover:not(.active) {
  opacity: 1 !important;
  transform: translateY(-2px);
  color: white; /* White text on hover */
  background: var(--button-hover-bg);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* Shadow on hover */
  font-weight: 600;
}

/* Active button hover - different styling */
.button.active:hover {
  background: var(--button-active-bg);
  color: var(--button-active-text);
  border-color: var(--button-active-border);
  box-shadow: 0 0 20px rgba(241, 255, 44, 0.3);
  transform: translateY(-2px);
}

/* Home button hover - icon animation */
.button:first-child:hover i {
  transform: scale(1.2);
  animation: homeIconPulse 1s infinite;
}

@keyframes homeIconPulse {
  0%, 100% { transform: scale(1.2); }
  50% { transform: scale(1.3); }
}

/* Text buttons hover - underline effect */
.button:not(:first-child):hover:not(.active) span {
  position: relative;
}

.button:not(:first-child):hover:not(.active) span::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 100%;
  height: 2px;
  background: white;
  animation: underlineExpand 0.3s ease forwards;
}

@keyframes underlineExpand {
  from { width: 0; }
  to { width: 100%; }
}

/* CTA button (Ayurveda) - Different styling */
.button.cta {
  background: rgba(123, 22, 224, 0.9); /* Dark purple background */
  border-color: rgba(162, 119, 253, 0.3);
}

.button.cta:hover:not(.active) {
  background: rgba(112, 49, 175, 0.95);
  border-color: rgba(128, 90, 213, 0.5);
  box-shadow: 0 5px 15px rgba(128, 90, 213, 0.2);
}

.button.cta.active {
  background: rgba(90, 15, 180, 0.95);
  border-color: rgba(162, 119, 253, 0.5);
  box-shadow: 0 0 15px rgba(128, 90, 213, 0.3);
}

/* Active/click state */
.button:active {
  transform: translateY(19px) scale(0.98);
  transition: transform 0.1s ease;
}

/* Scroll state - navbar becomes more compact */
.navbar-container.scrolled {
  height: 50px;
  border-radius: 25px;
  padding: 0 15px;
  opacity: 1;
}


.navbar-container.scrolled .button {
  height: 35px;
  min-width: 80px;
  padding: 0 15px;
  font-size: 13px;
  border-radius: 17px;
  opacity: 1;
}

.navbar-container.scrolled .button:first-child {
  min-width: 35px;
  width: 35px;
  height: 35px;
  border-radius: 17px;
}

.navbar-container.scrolled .button:first-child i {
  font-size: 16px;
}

.navbar-container.scrolled .button:hover:not(.active) {
  opacity: 1 !important;
  transform: translateY(-1px);
}

.navbar-container.scrolled .button.active {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .navbar-container {
    padding: 0 20px;
    max-width: 95%;
  }
  
  .button {
    min-width: 90px;
    padding: 0 15px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  header {
    height: 70px;
    padding: 0 15px;
  }
  
  .navbar-container {
    height: 55px;
    padding: 0 15px;
    border-radius: 30px;
  }
  
  .navbar {
    gap: 8px;
  }
  
  .button {
    min-width: 70px;
    height: 35px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 17px;
  }
  
  .button:first-child {
    min-width: 35px;
    width: 35px;
    height: 35px;
    border-radius: 17px;
  }
  
  .button:first-child i {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  header {
    height: 60px;
    padding: 0 10px;
  }
  
  .navbar-container {
    height: 50px;
    padding: 0 10px;
    border-radius: 25px;
  }
  
  .navbar {
    gap: 6px;
  }
  
  .button {
    min-width: 60px;
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 16px;
  }
  
  .button:first-child {
    min-width: 32px;
    width: 32px;
    height: 32px;
    border-radius: 16px;
  }
  
  .button:first-child i {
    font-size: 14px;
  }
  
  /* Hide text on very small screens */
  .button:not(:first-child) span {
    display: none;
  }
  
  .button:not(:first-child)::after {
    content: attr(data-initial);
    display: block;
    font-size: 10px;
  }
  
  .button.cta::after {
    content: 'آیو';
  }
  
  .button:nth-child(3)::after {
    content: 'مدی';
  }
  
  .button:nth-child(4)::after {
    content: 'آمو';
  }
  
  .button:nth-child(5)::after {
    content: 'درب';
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  header {
    height: 50px;
  }
  
  .navbar-container {
    height: 40px;
    padding: 0 10px;
    border-radius: 20px;
  }
  
  .button {
    height: 30px;
    min-width: 50px;
    padding: 0 8px;
    font-size: 10px;
    border-radius: 15px;
  }
  
  .button:first-child {
    min-width: 30px;
    width: 30px;
    height: 30px;
    border-radius: 15px;
  }
  
  .button:first-child i {
    font-size: 12px;
  }
}

/* Smooth underline for desktop */
@media (min-width: 769px) {
  .button:not(:first-child) span {
    position: relative;
    padding-bottom: 2px;
  }
  
  .button:not(:first-child) span::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 1px;
    background: var(--button-text);
    transition: width 0.3s ease;
  }
  
  .button:not(:first-child):hover:not(.active) span::after {
    width: 100%;
    background: white;
  }
  
  .button.active span::after {
    display: none;
  }
}