/* itsFreelancer — Header + Footer Styles v7.0 — Clean, no conflicts */
:root {
  --itf-navy: #101827;
  --itf-text: #111827;
  --itf-muted: #5b6472;
  --itf-border: #e5e7eb;
  --itf-blue: #2563eb;
  --itf-blue-dark: #1d4ed8;
  --itf-white: #ffffff;
  --itf-soft: #f5f8ff;
  --itf-shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

.itf-header,
.itf-header * {
  box-sizing: border-box;
}

/* ============================================
   HEADER BASE
   ============================================ */
.itf-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 clamp(16px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--itf-border);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ============================================
   LOGO
   ============================================ */
.itf-logo {
  flex: 0 0 auto;
  color: var(--itf-text);
  text-decoration: none;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.itf-logo span { color: var(--itf-blue); }

/* ============================================
   NAV — DESKTOP
   ============================================ */
.itf-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
}

.itf-nav > a,
.itf-nav .itf-dropdown-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--itf-text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  transition: background .15s ease, color .15s ease;
}

.itf-nav > a:hover,
.itf-nav .itf-dropdown-toggle:hover {
  background: var(--itf-soft);
  color: var(--itf-blue);
}

/* ============================================
   HIRE ME BUTTON
   ============================================ */
.itf-cta {
  margin-left: 6px;
  padding: 10px 20px !important;
  border-radius: 10px !important;
  color: #fff !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  font-size: 14px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .25);
  white-space: nowrap;
}
.itf-cta:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

/* ============================================
   COMBINED SIGN IN / SIGN UP BUTTON
   ============================================ */
.itf-btn-auth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff !important;
  background: #2563eb;
  border: none;
  text-decoration: none;
  transition: all .18s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  margin-left: 4px;
}
.itf-btn-auth:hover,
.itf-btn-auth:focus,
.itf-btn-auth:active,
.itf-btn-auth:visited {
  background: #1d4ed8 !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  text-decoration: none !important;
}

/* ============================================
   TOOLS + FORUM DROPDOWN
   ============================================ */
.itf-dropdown { position: relative; }

.itf-dropdown-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.itf-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 320px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--itf-border);
  border-radius: 16px;
  background: rgba(255,255,255,.99);
  box-shadow: var(--itf-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  z-index: 10000;
}

.itf-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 30px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid var(--itf-border);
  border-top: 1px solid var(--itf-border);
  transform: rotate(45deg);
}

.itf-dropdown:hover .itf-dropdown-menu,
.itf-dropdown.open .itf-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.itf-combo-menu { width: 320px; }

.itf-menu-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #94a3b8;
  padding: 4px 10px 2px;
}
.itf-menu-divider {
  height: 1px;
  background: var(--itf-border);
  margin: 4px 0;
}
.itf-badge-login {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  background: #fef3c7;
  color: #92400e;
  vertical-align: middle;
  margin-left: 4px;
}

.itf-tool-link {
  position: relative;
  display: grid !important;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px !important;
  padding: 10px !important;
  border-radius: 12px !important;
  color: var(--itf-text);
  text-decoration: none;
  overflow: hidden;
}
.itf-tool-link:hover {
  background: var(--itf-soft) !important;
  color: var(--itf-blue);
  transform: none !important;
}
.itf-tool-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eef4ff;
  color: var(--itf-blue);
  flex-shrink: 0;
}
.itf-tool-icon svg { width: 18px; height: 18px; }
.itf-tool-icon--purple {
  background: rgba(124,58,237,.1) !important;
  color: #7c3aed !important;
}
.itf-tool-title {
  display: block;
  color: var(--itf-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.itf-tool-desc {
  display: block;
  margin-top: 2px;
  color: var(--itf-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
}
.itf-tool-link:hover .itf-tool-title { color: var(--itf-blue); }
.itf-tool-link--locked { opacity: .85; }

/* ============================================
   USER AVATAR + DROPDOWN — LOGGED IN
   ============================================ */
.itf-user-menu {
  position: relative;
  margin-left: 4px;
}
.itf-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s;
  font-family: inherit;
}
.itf-user-avatar:hover,
.itf-user-avatar[aria-expanded="true"] {
  border-color: var(--itf-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.itf-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: #fff;
  border: 1px solid var(--itf-border);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.13);
  z-index: 9999;
  overflow: hidden;
}
.itf-user-dropdown.open {
  display: block;
  animation: itfFadeDown .15s ease;
}
@keyframes itfFadeDown {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.itf-user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.itf-user-dropdown-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.itf-user-dropdown-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.itf-user-dropdown-email {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.itf-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  transition: background .12s;
  width: 100%;
  background: none;
  cursor: pointer;
  font-family: inherit;
  border: none;
}
.itf-user-dropdown-item svg { width: 15px; height: 15px; opacity: .45; flex-shrink: 0; }
.itf-user-dropdown-item:hover { background: #f8fafc; color: #1e293b; }
.itf-user-dropdown-item:hover svg { opacity: .75; }
.itf-user-dropdown-item--danger { color: #dc2626 !important; }
.itf-user-dropdown-item--danger:hover { background: #fef2f2 !important; }
.itf-user-dropdown-divider { height:1px; background:#f1f5f9; margin:3px 0; }

/* ============================================
   HAMBURGER BUTTON — hidden on desktop
   ============================================ */
.itf-hamburger {
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1.5px solid var(--itf-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.itf-hamburger span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--itf-text);
  transition: transform .18s ease, opacity .18s ease;
  display: block;
}
.itf-header.menu-open .itf-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.itf-header.menu-open .itf-hamburger span:nth-child(2) {
  opacity: 0;
}
.itf-header.menu-open .itf-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   FOOTER AUTH BUTTONS
   ============================================ */
.iff-auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.iff-auth-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  line-height: 1.2;
}
.iff-auth-login {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9) !important;
}
.iff-auth-login:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.5);
  color: #fff !important;
}
.iff-auth-signup {
  background: var(--itf-blue, #2563eb);
  border: 1.5px solid transparent;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(37,99,235,.4);
}
.iff-auth-signup:hover {
  background: #1d4ed8;
  color: #fff !important;
  transform: translateY(-1px);
}
.iff-auth-dashboard {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85) !important;
}
.iff-auth-dashboard:hover {
  background: rgba(255,255,255,.08);
  color: #fff !important;
}
.iff-auth-logout {
  background: rgba(220,38,38,.1);
  border: 1.5px solid rgba(220,38,38,.25);
  color: #fca5a5 !important;
}
.iff-auth-logout:hover {
  background: rgba(220,38,38,.2);
  color: #f87171 !important;
}

/* ============================================
   MOBILE RESPONSIVE — SINGLE BREAKPOINT 980px
   ============================================ */
@media (max-width: 980px) {

  /* Show hamburger */
  .itf-hamburger {
    display: flex !important;
  }

  /* Hide desktop nav by default */
  .itf-nav {
    position: fixed !important;
    top: 72px;
    left: 0;
    right: 0;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 2px;
    padding: 12px 14px 20px;
    background: #fff;
    border-top: 1px solid var(--itf-border);
    box-shadow: 0 16px 40px rgba(15,23,42,.10);
    z-index: 9998;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }

  /* Open state */
  .itf-nav.open {
    display: flex !important;
  }

  /* Nav links */
  .itf-nav > a,
  .itf-nav .itf-dropdown-toggle {
    width: 100%;
    padding: 12px 14px !important;
    border-radius: 10px;
    justify-content: space-between;
    font-size: 15px;
  }

  /* Hire Me */
  .itf-cta {
    margin: 6px 0 0 !important;
    justify-content: center !important;
    text-align: center;
    width: 100%;
    padding: 14px 20px !important;
  }

  /* Auth button full width */
  .itf-btn-auth {
    margin: 6px 0 0 !important;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 10px;
  }

  /* Tools dropdown — static, full width on mobile */
  .itf-dropdown {
    width: 100%;
  }
  /* Remove blue highlight on open dropdown toggle in mobile */
  .itf-dropdown.open > .itf-dropdown-toggle,
  .itf-dropdown.open > .itf-dropdown-toggle:hover {
    background: var(--itf-soft);
    color: var(--itf-text);
  }
  .itf-dropdown-menu {
    position: static !important;
    width: 100% !important;
    display: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none;
    border-radius: 12px;
    background: #f8fbff;
    margin: 4px 0 6px;
    padding: 8px;
    border: 1px solid var(--itf-border);
  }
  .itf-dropdown.open .itf-dropdown-menu {
    display: grid !important;
  }
  .itf-dropdown-menu::before { display: none; }
  .itf-combo-menu { width: 100% !important; }

  /* User menu full width */
  .itf-user-menu {
    width: 100%;
    margin: 6px 0 0;
  }
  .itf-user-avatar {
    width: 100% !important;
    border-radius: 10px !important;
    height: 46px;
    justify-content: flex-start !important;
    padding: 0 14px !important;
    gap: 10px;
    font-size: 15px;
  }
  .itf-user-avatar::after {
    content: 'My Account';
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-left: 2px;
  }
  .itf-user-dropdown {
    position: static !important;
    width: 100% !important;
    margin-top: 6px;
    border-radius: 12px;
  }
}

/* ============================================
   FOOTER MOBILE
   ============================================ */
@media (max-width: 768px) {
  .iff-auth-links { gap: 8px; }
  .iff-auth-link { flex: 1; justify-content: center; min-width: 110px; }
}
@media (max-width: 480px) {
  .iff-auth-links { flex-direction: column; }
  .iff-auth-link { width: 100%; justify-content: center; }
}
