/* =========================================================
   MONEYTOOL.IO — HEADER
   Clean • Professional • Fast • Responsive
   ========================================================= */

/* ---------------------------------------------------------
   Header Container
   --------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;

    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;

    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.header-inner {
    min-height: 76px;

    display: flex;
    align-items: center;

    /* Important:
       Keeps logo left while giving navigation more
       breathing room before it starts. */
    gap: 0;
}


/* ---------------------------------------------------------
   LOGO
   --------------------------------------------------------- */

.site-logo {
    display: inline-flex;
    align-items: center;

    flex: 0 0 auto;

    text-decoration: none;

    color: #0f766e;

    white-space: nowrap;

    line-height: 1;

    transition: opacity 0.2s ease;
}

.site-logo:hover {
    color: #115e59;
    opacity: 0.96;
}


/* Logo Mark */

.site-logo-mark {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-right: 10px;

    border-radius: 10px;

    background: #0f766e;
    color: #ffffff;

    font-size: 21px;
    font-weight: 800;

    letter-spacing: -0.03em;
}


/* Logo Text */

.site-logo-text {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 25px;
    font-weight: 800;

    letter-spacing: -0.035em;

    color: #0f766e;
}

.site-logo-text span {
    color: #115e59;
    font-weight: 700;
}


/* ---------------------------------------------------------
   DESKTOP NAVIGATION
   --------------------------------------------------------- */

.main-navigation {
    display: flex;
    align-items: center;

    /* This is the key adjustment:
       creates space between logo and menu. */
    margin-left: auto;

    gap: 6px;

    white-space: nowrap;
}


/* Navigation Links */

.main-navigation .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 9px 12px;

    border: 0;
    background: transparent;

    color: #1f2937;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 15px;
    font-weight: 600;

    line-height: 1.2;

    text-decoration: none;

    cursor: pointer;

    border-radius: 8px;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.main-navigation .nav-link:hover,
.main-navigation .nav-link:focus-visible {
    color: #0f766e;
    background: #f0fdfa;
}


/* ---------------------------------------------------------
   MEGA MENU TRIGGER
   --------------------------------------------------------- */

.nav-mega-wrapper {
    position: relative;
}

.nav-mega-trigger {
    gap: 7px;
}

.nav-chevron {
    display: inline-flex;
    align-items: center;

    font-size: 13px;
    font-weight: 700;

    color: #64748b;

    transform: translateY(-1px);

    transition: transform 0.2s ease;
}

.nav-mega-wrapper:hover .nav-chevron,
.nav-mega-trigger[aria-expanded="true"] .nav-chevron {
    transform: translateY(1px);
}


/* ---------------------------------------------------------
   HEADER SEARCH
   --------------------------------------------------------- */

.header-search {
    flex: 0 0 190px;

    width: 190px;
    height: 40px;

    margin-left: 16px;

    display: flex;
    align-items: center;

    padding: 0 11px;

    background: #f8fafc;

    border: 1px solid #dbe2ea;
    border-radius: 9px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.header-search:focus-within {
    background: #ffffff;

    border-color: #0f766e;

    box-shadow:
        0 0 0 3px rgba(15, 118, 110, 0.10);
}


/* Search Icon */

.header-search-icon {
    flex: 0 0 auto;

    margin-right: 7px;

    color: #64748b;

    font-size: 18px;
    line-height: 1;
}


/* Search Input */

.header-search input {
    min-width: 0;
    width: 100%;

    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: #111827;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 13px;
    font-weight: 500;

    line-height: 1;
}

.header-search input::placeholder {
    color: #94a3b8;
    opacity: 1;
}


/* Remove browser search decoration */

.header-search input::-webkit-search-decoration,
.header-search input::-webkit-search-cancel-button,
.header-search input::-webkit-search-results-button,
.header-search input::-webkit-search-results-decoration {
    -webkit-appearance: none;
}


/* ---------------------------------------------------------
   ACCOUNT ACTIONS
   --------------------------------------------------------- */

.header-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 8px;

    margin-left: 14px;

    white-space: nowrap;
}


/* Sign In */

.header-signin {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 8px 12px;

    color: #334155;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    border-radius: 8px;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.header-signin:hover {
    color: #0f766e;
    background: #f0fdfa;
}


/* Sign Up */

.header-signup {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 8px 15px;

    color: #ffffff !important;

    background: #0f766e;

    border: 1px solid #0f766e;
    border-radius: 8px;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;
    font-weight: 700;

    line-height: 1;

    text-decoration: none;

    white-space: nowrap;

    box-shadow: 0 2px 5px rgba(15, 118, 110, 0.15);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.header-signup:hover {
    color: #ffffff !important;

    background: #115e59;
    border-color: #115e59;

    transform: translateY(-1px);

    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.20);
}


/* ---------------------------------------------------------
   MOBILE MENU BUTTON
   --------------------------------------------------------- */

.mobile-menu-toggle {
    display: none;

    width: 42px;
    height: 42px;

    margin-left: auto;

    padding: 8px;

    border: 1px solid #dbe2ea;
    border-radius: 8px;

    background: #ffffff;

    cursor: pointer;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;
}

.mobile-menu-toggle span {
    display: block;

    width: 20px;
    height: 2px;

    background: #1f2937;

    border-radius: 2px;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.mobile-menu-toggle:hover {
    border-color: #0f766e;
    background: #f0fdfa;
}


/* ---------------------------------------------------------
   SCREEN READER ONLY
   --------------------------------------------------------- */

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


/* =========================================================
   RESPONSIVE HEADER
   ========================================================= */


/* ---------------------------------------------------------
   Medium Desktop / Laptop
   --------------------------------------------------------- */

@media (max-width: 1200px) {

    .main-navigation .nav-link {
        padding-left: 9px;
        padding-right: 9px;

        font-size: 14px;
    }

    .header-search {
        flex-basis: 165px;
        width: 165px;

        margin-left: 10px;
    }

    .header-actions {
        margin-left: 9px;
    }

    .header-signin,
    .header-signup {
        font-size: 13px;
    }
}


/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 1024px) {

    .site-logo-text {
        font-size: 23px;
    }

    .main-navigation {
        gap: 2px;
    }

    .main-navigation .nav-link {
        padding-left: 7px;
        padding-right: 7px;

        font-size: 13px;
    }

    .header-search {
        flex-basis: 145px;
        width: 145px;

        margin-left: 7px;
    }

    .header-actions {
        gap: 4px;
        margin-left: 7px;
    }

    .header-signin {
        padding-left: 8px;
        padding-right: 8px;
    }

    .header-signup {
        padding-left: 10px;
        padding-right: 10px;
    }
}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .header-inner {
        min-height: 68px;
    }

    .main-navigation,
    .header-search,
    .header-actions {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .site-logo-mark {
        width: 35px;
        height: 35px;

        margin-right: 8px;

        font-size: 19px;
    }

    .site-logo-text {
        font-size: 22px;
    }
}


/* ---------------------------------------------------------
   Small Mobile
   --------------------------------------------------------- */

@media (max-width: 480px) {

    .header-inner {
        padding-left: 15px;
        padding-right: 15px;
    }

    .site-logo-mark {
        width: 32px;
        height: 32px;

        border-radius: 8px;

        font-size: 17px;
    }

    .site-logo-text {
        font-size: 20px;
    }
}