/**
 * Portal sub-pages: secondary nav under dashboard-header (desktop + mobile).
 * Include after page styles; uses root-relative URLs for hosting + localhost.
 */

.dashboard-header.portal-header-with-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.dashboard-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.user-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    position: relative;
    z-index: 1;
}

/* Larger type; green shades + maroon (courses.html & profile.html portal strip) */
.user-nav a {
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.user-nav a:nth-child(1) {
    color: #ecfdf5;
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    border-color: rgba(167, 243, 208, 0.45);
}

.user-nav a:nth-child(2) {
    color: #f0fdf4;
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    border-color: rgba(134, 239, 172, 0.5);
}

.user-nav a:nth-child(3) {
    color: #fff5f5;
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-color: rgba(252, 165, 165, 0.45);
}

.user-nav a:hover {
    filter: brightness(1.08);
    border-color: rgba(255, 255, 255, 0.45);
}

.user-nav a:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.user-nav a.active {
    font-weight: 800;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55), 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* Back to Dashboard — on purple portal header: white text, light border, pill shape (desktop + mobile) */
.btn-back-dashboard {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    touch-action: manipulation;
}

.btn-back-dashboard:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.65);
}

.btn-back-dashboard:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 3px;
}

.portal-header-with-nav .user-info .btn-back-dashboard {
    margin-top: 4px;
}

@media (max-width: 768px) {
    .dashboard-header.portal-header-with-nav {
        text-align: center;
    }

    .dashboard-header-top {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }

    .user-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
        justify-content: flex-start;
    }

    .user-nav a {
        flex: 0 0 auto;
        font-size: 15px;
        padding: 9px 12px;
    }

    .btn-back-dashboard {
        font-size: 15px;
        padding: 10px 18px;
    }
}
