/* ── Profile settings layout ── */
.profile-settings-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.profile-settings-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.profile-settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 180px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: sticky;
    top: 1rem;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #444;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.profile-nav-item .material-icons {
    font-size: 1.1rem;
    color: #888;
}

.profile-nav-item:hover {
    background: #f5f7fa;
    color: var(--primary);
    text-decoration: none;
}

.profile-nav-item.active {
    background: #f0f4ff;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.profile-nav-item.active .material-icons {
    color: var(--primary);
}

.profile-settings-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 600px) {
    .profile-settings-container {
        padding: 1rem 0;
        max-width: 100%;
    }

    .profile-settings-container h1 {
        padding: 0 1rem;
    }

    .profile-settings-layout {
        flex-direction: column;
        gap: 0;
    }

    .profile-settings-nav {
        flex-direction: row;
        min-width: 0;
        width: 100%;
        position: static;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .profile-settings-content {
        width: 100%;
        padding: 1rem;
    }

    .profile-nav-item {
        flex: 1;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 0.6rem 0.25rem;
        font-size: 0.75rem;
        border-left: none;
        border-bottom: 3px solid transparent;
        text-align: center;
    }

    .profile-nav-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary);
    }

    .profile-nav-item .material-icons {
        font-size: 1.3rem;
    }
}

/* ── end profile settings ── */

/* navbar.css - fully scoped to avoid Bootstrap overrides */
.custom-navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background-color: var(--primary);
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    font-family: Roboto, Arial, sans-serif;
}

.custom-navbar a {
    text-decoration: none;
    color: var(--primary);
    margin-right: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 0.7rem 0.5rem;
    border-radius: 4px;
}

.custom-navbar a:hover,
.custom-navbar a:focus {
    color: var(--primary-dark);
    background-color: var(--color-navbar-link-hover-bg);
    outline: none;
    text-decoration: none;
}

.custom-navbar a h4 {
    margin: 0;
    font-weight: 400;
    font-size: 1.1rem; 
    color: var(--bg-primary);
    flex-grow: 1;
}

.custom-navbar .nav-links {
    display: flex;
    flex-grow: 1;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-links .flex-spacer {
    flex-grow: 1;
}

.custom-navbar .burger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 25px;
    height: 25px;
}

.custom-navbar .burger div {
    width: 25px;
    height: 3px;
    background-color: var(--bg-primary);
    border-radius: 2px;
}

.custom-navbar .icon-button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.3em;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.custom-navbar .icon-button:hover {
    color: var(--primary-dark);
}

.custom-navbar #theme-toggle-btn {
    background-color: var(--primary);
    color: var(--color-white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.custom-navbar #theme-toggle-btn:hover {
    background-color: var(--primary-dark);
}

.custom-navbar #install-btn {
    background-color: transparent;
    color: var(--bg-primary);
    border: 1px solid var(--bg-primary);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
    order: 2;
}

.custom-navbar #install-btn:hover,
.custom-navbar #install-btn:focus {
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}


/* Overlay behind the mobile drawer */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}


/* Profile circle */
.profile-circle-wrapper {
    position: relative;
    flex-shrink: 0;
    margin-left: auto; /* on desktop: nav-links fills space so this is 0; on mobile: pushes circle right */
}

.profile-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    color: var(--primary);
    border: 2px solid var(--bg-primary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    transition: opacity 0.2s;
}

.profile-circle:hover {
    opacity: 0.85;
}

.profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-dropdown {
    display: none;
    position: fixed;
    top: 70px; /* height of the navbar bar */
    right: 1rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    min-width: 210px;
    max-width: calc(100vw - 2rem);
    z-index: 2000;
    overflow: hidden;
}

.profile-dropdown.open {
    display: block;
}

.profile-dropdown-header {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-dropdown-header strong {
    font-size: 0.95rem;
    color: #333;
}

.profile-dropdown-header small {
    font-size: 0.78rem;
    color: #888;
    word-break: break-all;
}

.profile-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    margin: 0;
    border-radius: 0;
}

.profile-dropdown a:hover {
    background: #f0f4f8;
    color: var(--primary);
}


@media (max-width: 1160px) {
    .custom-navbar .burger {
        display: flex;
    }

    .custom-navbar .nav-links {
        /* Slide-out drawer */
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 270px;
        max-width: 85vw;
        flex-direction: column;
        flex-grow: 0;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 0;
        padding: 1.25rem 0 2rem;
        overflow-y: auto;
        background-color: var(--primary);
        box-shadow: 4px 0 20px rgba(0,0,0,0.2);
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 1500;
    }

    .custom-navbar .nav-links.active {
        transform: translateX(0);
    }

    .custom-navbar .nav-links a {
        width: 100%;
        margin: 0;
        padding: 0.75rem 1.5rem;
        border-radius: 0;
    }

    .custom-navbar .nav-links a:hover {
        background-color: rgba(255,255,255,0.1);
    }

    .custom-navbar .nav-links .flex-spacer {
        flex-grow: 1;
        min-height: 1rem;
    }

    .custom-navbar #install-btn {
        margin-left: 0;
        width: 100%;
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(255,255,255,0.15);
        padding: 0.75rem 1.5rem;
        justify-content: flex-start;
    }

    .profile-dropdown {
        top: 60px;
        right: 0.5rem;
    }
}
