/* ═══════════════════════════════════════════
   FitTrack — Global Styles
   Single source of truth for all pages
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,800&family=Instrument+Sans:wght@400;500;600&display=swap');

:root {
    --accent:    #2f6b3e;
    --accent-dk: #1e4a2b;
    --accent-lt: #e8f2eb;
    --accent-md: #c5dfc9;
    --ink:       #1a1916;
    --ink-2:     #4a4840;
    --ink-3:     #8a877f;
    --bg:        #faf9f6;
    --surface:   #ffffff;
    --border:    rgba(26,25,22,0.09);
    --border-md: rgba(26,25,22,0.13);
    --orange:    #e8520a;
    --nav-h:     64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Instrument Sans', sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ── NAVBAR ── */
nav {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--nav-h);
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(250,249,246,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

/* LOGO */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Bricolage Grotesque', 'Instrument Sans', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.025em;
    color: var(--ink);
    text-decoration: none;
}

.logo-mark {
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* NAV SIDES */
.nav-right,
.nav-right-auth {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* NAV LINKS */
.nav-link {
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.nav-link:hover { background: var(--accent-lt); color: var(--ink); }

.nav-link.active {
    background: var(--accent-lt);
    color: var(--accent);
    font-weight: 600;
}

/* CTA BUTTON */
.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--ink);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s;
    white-space: nowrap;
    margin-left: 4px;
}

.btn-nav:hover { background: var(--accent); }

/* PROFILE DROPDOWN */
.profile-dropdown {
    position: relative;
    margin-left: 4px;
}

.profile-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s;
    user-select: none;
}

.profile-dropdown:hover .profile-icon {
    border-color: var(--accent-md);
}

.dropdown-menu-custom {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-md);
    border-radius: 13px;
    padding: 6px;
    min-width: 200px;
    box-shadow: 0 4px 6px rgba(26,25,22,0.04), 0 16px 40px rgba(26,25,22,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    pointer-events: none;
}

.profile-dropdown:hover .dropdown-menu-custom,
.profile-dropdown:focus-within .dropdown-menu-custom {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-header {
    padding: 8px 10px 10px;
}

.dh-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 2px;
}

.dh-email {
    font-size: 0.74rem;
    color: var(--ink-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.84rem;
    color: var(--ink-2);
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}

.dropdown-item:hover { background: var(--accent-lt); color: var(--ink); }

.dropdown-item-danger { color: #dc2626; }
.dropdown-item-danger:hover { background: #fef2f2; color: #dc2626; }

/* ── UTILITY BUTTONS (reused on auth pages etc.) ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--ink);
    color: #fff;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.93rem;
    padding: 0.82rem 1.8rem;
    border-radius: 100px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
}

.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.82rem 1.7rem;
    border-radius: 100px;
    border: 1px solid var(--border-md);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover { background: var(--accent-lt); }

.btn-white {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.93rem;
    padding: 0.88rem 2rem;
    border-radius: 100px;
    text-decoration: none;
    transition: background 0.15s, transform 0.12s;
}

.btn-white:hover { background: var(--accent-lt); transform: translateY(-2px); }

/* ── WORKOUT MODAL (global — injected via navbar fragment) ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(26,25,22,0.5);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%; max-width: 420px;
    margin: 1rem;
    box-shadow: 0 20px 60px rgba(26,25,22,0.2);
    transform: translateY(10px);
    transition: transform 0.2s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }

.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 600; color: var(--ink); }
.modal-close {
    width: 28px; height: 28px; border-radius: 8px;
    border: none; background: #f0f0ee; color: var(--ink-3);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: background 0.12s;
}
.modal-close:hover { background: #e4e4e0; color: var(--ink); }

.modal-body { padding: 1.4rem; }
.m-group { margin-bottom: 1rem; }
.m-label {
    display: block; font-size: 0.75rem; font-weight: 600;
    color: var(--ink-3); text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 0.42rem;
}
.m-input, .m-select, .m-textarea {
    width: 100%; padding: 0.72rem 0.9rem;
    border: 1px solid var(--border-md); border-radius: 9px;
    font-family: inherit; font-size: 0.88rem; color: var(--ink);
    background: #fafaf8; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.m-input:focus, .m-select:focus, .m-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47,107,62,0.1);
    background: #fff;
}
.m-textarea { resize: vertical; min-height: 72px; }
.btn-save {
    width: 100%; padding: 0.82rem;
    background: var(--accent); color: #fff; border: none;
    border-radius: 9px; font-family: inherit; font-size: 0.9rem;
    font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn-save:hover { background: var(--accent-dk); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    nav { padding: 0 1.2rem; }
    .nav-link { padding: 5px 8px; font-size: 0.82rem; }
}

@media (max-width: 540px) {
    .nav-link:not(.btn-nav) { display: none; }
}
