/**
 * Navigation Auth Buttons - Rebuilt from Ground Up
 * 
 * Purpose: Prevent text stacking in Sign Up button across all screen sizes and languages
 * Last Updated: February 8, 2026
 * 
 * Key Features:
 * - Inline-flex layout prevents text wrapping
 * - Min-width ensures button never gets too narrow
 * - Proper padding maintains consistent sizing
 * - Works with all translations (English, 繁體中文, 简体中文)
 */

/* ============================================
   LOGIN BUTTON - Desktop
   ============================================ */
.nav-login-btn {
  /* Display & Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  /* Sizing - Prevents text stacking */
  min-width: 70px;
  min-height: 40px;
  padding: 0.5rem 1rem;
  
  /* Typography */
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  
  /* Colors */
  color: #374151; /* gray-700 */
  background-color: transparent;
  
  /* Border & Shape */
  border: none;
  border-radius: 0.5rem;
  
  /* Effects */
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  
  /* Prevent text selection */
  user-select: none;
  -webkit-user-select: none;
}

.nav-login-btn:hover {
  color: #2563eb; /* blue-600 */
  background-color: #f3f4f6; /* gray-100 */
}

.nav-login-btn:active {
  transform: scale(0.98);
}

.nav-login-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ============================================
   SIGN UP BUTTON - Desktop
   ============================================ */
.nav-signup-btn {
  /* Display & Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  /* Sizing - CRITICAL: Prevents text stacking */
  min-width: 90px;
  min-height: 40px;
  padding: 0.5rem 1.25rem;
  
  /* Typography */
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  
  /* Colors - EduQ AI Brand Blue */
  color: #ffffff;
  background-color: #0066FF; /* EduQ AI Blue */
  
  /* Border & Shape */
  border: none;
  border-radius: 0.5rem;
  
  /* Effects */
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  
  /* Prevent text selection */
  user-select: none;
  -webkit-user-select: none;
}

.nav-signup-btn:hover {
  background-color: #0052CC; /* Darker blue */
  box-shadow: 0 4px 6px rgba(0, 102, 255, 0.3);
  transform: translateY(-1px);
}

.nav-signup-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-signup-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ============================================
   MOBILE VARIANTS
   ============================================ */
.nav-login-btn--mobile {
  /* Full width on mobile */
  display: flex;
  width: 100%;
  min-width: unset;
  padding: 0.75rem 1rem;
  
  /* Larger touch target */
  min-height: 44px;
  
  /* Center text */
  justify-content: center;
}

.nav-signup-btn--mobile {
  /* Full width on mobile */
  display: flex;
  width: 100%;
  min-width: unset;
  padding: 0.75rem 1rem;
  
  /* Larger touch target */
  min-height: 44px;
  
  /* Center text */
  justify-content: center;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .nav-login-btn {
    min-width: 65px;
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
  }
  
  .nav-signup-btn {
    min-width: 85px;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
  }
}

/* Small Desktop (1024px - 1280px) */
@media (min-width: 1024px) and (max-width: 1280px) {
  .nav-login-btn {
    min-width: 70px;
    padding: 0.5rem 1rem;
  }
  
  .nav-signup-btn {
    min-width: 90px;
    padding: 0.5rem 1.25rem;
  }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  .nav-login-btn {
    min-width: 75px;
    padding: 0.5rem 1.125rem;
  }
  
  .nav-signup-btn {
    min-width: 95px;
    padding: 0.5rem 1.5rem;
  }
}

/* ============================================
   LANGUAGE-SPECIFIC ADJUSTMENTS
   ============================================ */

/* Chinese characters need slightly more width */
html[lang="zh-HK"] .nav-signup-btn,
html[lang="zh-CN"] .nav-signup-btn {
  min-width: 100px;
  padding: 0.5rem 1.5rem;
}

html[lang="zh-HK"] .nav-login-btn,
html[lang="zh-CN"] .nav-login-btn {
  min-width: 75px;
  padding: 0.5rem 1.125rem;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .nav-login-btn {
    border: 2px solid currentColor;
  }
  
  .nav-signup-btn {
    border: 2px solid #ffffff;
  }
  
  .nav-login-btn:focus,
  .nav-signup-btn:focus {
    outline-width: 3px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .nav-login-btn,
  .nav-signup-btn {
    transition: none;
  }
  
  .nav-login-btn:hover,
  .nav-signup-btn:hover {
    transform: none;
  }
  
  .nav-login-btn:active,
  .nav-signup-btn:active {
    transform: none;
  }
}

/* Focus Visible (keyboard navigation) */
.nav-login-btn:focus-visible,
.nav-signup-btn:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 3px;
}

/* ============================================
   LOADING STATE (Optional)
   ============================================ */
.nav-login-btn[aria-busy="true"],
.nav-signup-btn[aria-busy="true"] {
  opacity: 0.6;
  cursor: wait;
  pointer-events: none;
}

/* ============================================
   DISABLED STATE
   ============================================ */
.nav-login-btn[aria-disabled="true"],
.nav-signup-btn[aria-disabled="true"],
.nav-login-btn:disabled,
.nav-signup-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .nav-login-btn,
  .nav-signup-btn {
    display: none;
  }
}
