:root {
  --brand-orange: #FF6B00;
  --brand-orange-hover: #e65a00;
  --text-dark: #111827;
  --text-gray: #6b7280;
  --bg-light: #f3f4f6;
}

/* 🟢 ANTI-FLICKER CSS LOGIC */
#auth-logged-out, #auth-logged-in, #mobile-login-link, #mobile-logged-in-links, #mobile-cta-wrapper { display: none; }
.is-logged-out #auth-logged-out { display: flex; }
.is-logged-out #mobile-login-link { display: block; }
.is-logged-out #mobile-cta-wrapper { display: block; }
.is-logged-in #auth-logged-in { display: block; }
.is-logged-in #mobile-logged-in-links { display: flex; flex-direction: column; }

/* =========================================
   1. GLOBAL HEADER STYLES
========================================= */
.leadiary-header { font-family: 'Inter', 'Plus Jakarta Sans', sans-serif; width: 100%; background: #ffffff; border-bottom: 1px solid var(--bg-light); position: sticky; top: 0; z-index: 1000; }
.header-container { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0px 24px; }
.brand-logo { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo img { height: 40px; width: auto; }
.desktop-menu { display: flex; align-items: center; flex-grow: 1; justify-content: flex-end; gap: 40px; }
.main-nav { display: flex; gap: 32px; align-items: center; height: 56px; } 
.nav-link-item { text-decoration: none; color: var(--text-gray); font-size: 15px; font-weight: 600; transition: color 0.2s; display: flex; align-items: center; height: 100%; }
.nav-link-item:hover { color: var(--brand-orange); }
.nav-dropdown-wrapper { position: relative; height: 100%; display: flex; align-items: center; }
.dropdown-chevron { margin-left: 6px; transform: translateY(1px); transition: transform 0.2s; }
.nav-dropdown-wrapper:hover .dropdown-chevron { transform: translateY(1px) rotate(180deg); }
.nav-dropdown { position: absolute; top: 100%; left: -20px; min-width: 240px; background: #ffffff; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); border: 1px solid var(--bg-light); padding: 16px 0 8px; z-index: 1001; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.2s ease; }
.nav-dropdown-wrapper:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-category { padding: 0 24px 12px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dark); }
.nav-dropdown a { display: block; padding: 10px 24px; font-size: 14px; font-weight: 500; color: #4b5563; text-decoration: none; transition: background 0.2s, color 0.2s; }
.nav-dropdown a:hover { background: #f9fafb; color: var(--brand-orange); }
.auth-group { display: flex; align-items: center; gap: 24px; }
.login-link { text-decoration: none; color: var(--text-gray); font-size: 14px; font-weight: 600; transition: color 0.2s; }
.login-link:hover { color: var(--text-dark); }
.btn-cta-orange { text-decoration: none; background: var(--brand-orange); color: #ffffff; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 700; transition: background 0.2s, transform 0.2s; white-space: nowrap; }
.btn-cta-orange:hover { background: var(--brand-orange-hover); transform: translateY(-1px); }
.relative { position: relative; }
.user-avatar-btn { height: 32px; width: 32px; border-radius: 50%; background: #141414; color: #ffffff; border: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; cursor: pointer; transition: box-shadow 0.2s; }
.user-avatar-btn:hover, .user-avatar-btn:focus { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--brand-orange); outline: none; }
.user-avatar-btn span { text-transform: uppercase; line-height: 1; transform: translateY(1px); }
.user-dropdown { position: absolute; top: 100%; right: 0; margin-top: 12px; width: 220px; background: #ffffff; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); border: 1px solid var(--bg-light); padding: 8px 0; z-index: 1001; transform-origin: top right; animation: scaleUp 0.2s ease-out forwards; }
@keyframes scaleUp { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.dropdown-header { padding: 8px 16px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; color: #9ca3af; background: #f9fafb; margin-bottom: 4px; }
.dropdown-item { display: block; padding: 10px 16px; font-size: 14px; font-weight: 600; color: #374151; text-decoration: none; transition: background 0.2s, color 0.2s; border: none; width: 100%; text-align: left; background: none; cursor: pointer; font-family: inherit; }
.dropdown-item:hover { background: #fff7ed; color: var(--brand-orange); }
.dropdown-divider { height: 1px; background: var(--bg-light); margin: 4px 0; }
.text-red { color: #dc2626 !important; }
.text-red:hover { background: #fef2f2 !important; color: #dc2626 !important; }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.mobile-dropdown { display: none; background: #ffffff; position: absolute; top: 100%; left: 0; width: 100%; border-bottom: 1px solid #e5e7eb; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); padding: 10px 24px 24px 24px; }
.mobile-dropdown.is-open { display: block; animation: slideDown 0.3s ease-out; }
.mobile-nav { display: flex; flex-direction: column; }
.mobile-link { text-decoration: none; color: #4b5563; font-size: 16px; font-weight: 600; padding: 16px 0; border-bottom: 1px solid var(--bg-light); display: block; }
.mobile-link:last-child { border-bottom: none; margin-bottom: 16px; }
.mobile-nav-group { border-bottom: 1px solid var(--bg-light); padding: 16px 0; }
.mobile-nav-header { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dark); margin-bottom: 16px; }
.mobile-sublink { display: block; text-decoration: none; color: var(--text-gray); font-size: 15px; font-weight: 500; padding: 10px 0 10px 12px; }
.mobile-auth { margin-top: 10px; }
.mobile-full-btn { display: block; text-align: center; width: 100%; padding: 14px 20px; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   2. FOOTER STYLES
========================================= */
.leadiary-footer { background-color: #ffffff; color: #4b5563; padding: 45px 24px 20px; font-family: 'Inter', sans-serif; border-top: 4px solid var(--brand-orange); box-shadow: 0 -10px 30px -10px rgba(0, 0, 0, 0.05); }
.footer-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 40px; }
.footer-brand-side { flex: 1; }
.footer-logo-link { display: inline-block; margin-bottom: 12px; }
.footer-logo { height: 30px; width: auto; display: block; }
.footer-tagline { font-size: 13px; line-height: 1.5; max-width: 250px; margin-bottom: 20px; color: #4b5563; }
.footer-links-grid { flex: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.link-column h4 { color: #111827; font-size: 11px; font-weight: 800; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.1em; }
.link-column a { display: block; color: #6b7280; text-decoration: none; font-size: 13px; margin-bottom: 8px; transition: all 0.2s ease; font-weight: 500; }
.link-column a:hover { color: var(--brand-orange); transform: translateX(3px); }
.ext-link { color: #111827 !important; font-weight: 700; }
.ext-link i { color: var(--brand-orange); }
.footer-socials { display: flex; gap: 8px; }
.footer-socials a { width: 32px; height: 32px; background-color: #f3f4f6; color: #4b5563; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all 0.2s ease; }
.footer-socials a:hover { background-color: var(--brand-orange); color: #ffffff; transform: translateY(-2px); }
.footer-bottom { max-width: 1200px; margin: 25px auto 0; padding-top: 20px; border-top: 1px solid #f3f4f6; }
.footer-bottom-content { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #9ca3af; }
.footer-legal-links { display: flex; gap: 15px; }
.footer-legal-links a { color: #9ca3af; text-decoration: none; transition: color 0.2s ease; }
.footer-legal-links a:hover { color: #111827; }

/* =========================================
   3. RESPONSIVE ADJUSTMENTS (Header/Footer)
========================================= */
@media (max-width: 991px) {
  .desktop-menu { display: none; }
  .mobile-toggle { display: block; }
  .brand-logo img { height: 26px; }
  .footer-container { flex-direction: column; gap: 30px; }
  .footer-links-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .footer-links-grid { grid-template-columns: 1fr; }
  .footer-bottom-content { flex-direction: column; gap: 12px; text-align: center; }
}