/* =========================================
   GLOBAL STYLES (Navigation & Footer)
   Used across all Easy Resources tools
   ========================================= */

/* Use fallback variables so it doesn't break individual tool color schemes */
:root {
  --gl-text: var(--text-primary, var(--text, #1a1a1a));
  --gl-text-soft: var(--text-secondary, var(--text-soft, var(--text-muted, #666)));
  --gl-bg: var(--bg-primary, var(--bg, #ffffff));
  --gl-bg-soft: var(--bg-secondary, var(--bg-soft, #f8f9fa));
  --gl-accent: var(--accent, #2563eb);
  --gl-border: var(--border, #e5e7eb);
  --gl-radius: var(--radius, 12px);
}

/* -----------------------------------------
   NAVIGATION
   ----------------------------------------- */
nav {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gl-border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container, 1200px);
  margin: 0 auto;
  padding: 0 2rem;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gl-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo span { color: var(--gl-accent); }
.nav-links { display: flex; align-items: center; gap: 2.5rem; }
.nav-item { position: relative; }
.nav-link {
  text-decoration: none;
  color: var(--gl-text-soft);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-link:hover, .nav-link.active { color: var(--gl-text); }

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: white;
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
  padding: 1rem;
  min-width: 500px; /* Wider for 2 columns */
  display: grid;
  grid-template-columns: 1fr 1fr; /* Split into 2 columns */
  gap: 0.5rem;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}
.nav-item .chevron { transition: transform 0.3s; width: 14px; height: 14px; }
.nav-item:hover .chevron { transform: rotate(180deg); }
.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--gl-text);
  border-radius: 8px;
  transition: background 0.2s;
  text-align: left;
}
.dropdown-item:hover { background: var(--gl-bg-soft); }
.dropdown-item .icon { font-size: 1.125rem; color: var(--gl-accent); display: flex; align-items: center; }
.dropdown-item .text { display: flex; flex-direction: column; }
.dropdown-item .title { font-weight: 700; font-size: 0.875rem; display: block; color: var(--gl-text); }
.dropdown-item .desc { font-size: 0.75rem; color: var(--gl-text-soft); display: block; font-weight: 400; }

.nav-cta {
  padding: 0.7rem 1.5rem;
  background: var(--gl-text);
  color: white;
  text-decoration: none;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.2s;
}
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* Mobile Nav */
.mobile-only { display: none; }
.desktop-only { display: flex; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  transition: cubic-bezier(0.4, 0, 0.2, 1);
}
.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--gl-text);
  border-radius: 2px;
  transition: 0.3s;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 991px) {
  .desktop-only { display: none; }
  .mobile-only { display: flex; }
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: white;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 2rem;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
  }
  .nav-links.active { right: 0; }
  .nav-link { font-size: 1.25rem; }
  .dropdown {
    position: static;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none;
    border: none;
    padding: 0;
    height: 0;
    overflow: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: unset;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .nav-item.active .dropdown { height: auto; padding-top: 1rem; }
  .nav-item.active .chevron { transform: rotate(180deg); }
  .chevron { transition: 0.3s; }
}

/* -----------------------------------------
   FOOTER
   ----------------------------------------- */
footer { padding: 6rem 0; background: #111; color: white; border-top: 1px solid #333; }
.footer-content { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem; max-width: var(--container, 1200px); margin-left: auto; margin-right: auto; padding: 0 2rem; }
.footer-brand .logo { color: white; margin-bottom: 1.5rem; }
.footer-brand p { color: #999; font-size: 0.9375rem; line-height: 1.6; max-width: 300px; }
.footer-col h4 { font-size: 1rem; font-weight: 700; margin-bottom: 1.5rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col ul li a { color: #999; text-decoration: none; font-size: 0.9375rem; transition: color 0.2s; }
.footer-col ul li a:hover { color: white; }
.footer-bottom { 
  padding-top: 3rem; 
  border-top: 1px solid #333; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  color: #666; 
  font-size: 0.875rem; 
  max-width: var(--container, 1200px); 
  margin-left: auto; 
  margin-right: auto; 
  padding: 3rem 2rem 0 2rem; 
}
.footer-socials { display: flex; gap: 1.5rem; }
.footer-socials a { color: inherit; text-decoration: none; transition: color 0.2s; }
.footer-socials a:hover { color: white; }

@media (max-width: 768px) {
  .footer-content { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
  .footer-brand { display: flex; flex-direction: column; align-items: center; }
  .footer-brand p { max-width: 100%; }
  .footer-bottom { flex-direction: column; gap: 1.5rem; text-align: center; }
}
