/**
 * Developer Portal — dashboard UI polish (console + shared chrome).
 *
 * By Cursor, 2026-07-03: Header, cards, hero, footer, and page shell enhancements.
 */

:root {
    --pd-primary: #0b5cab;
    --pd-primary-dark: #063d73;
    --pd-accent: #006aff;
    --pd-bg: #eef3f8;
    --pd-surface: #ffffff;
    --pd-border: #e2e8f0;
    --pd-text: #0f172a;
    --pd-muted: #64748b;
    --pd-radius: 14px;
    --pd-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --pd-header-h: 68px;
}

/* ── Console page shell ─────────────────────────────────────── */
.main-wrapper.portal-home {
    padding: 0 0 48px;
    background: var(--pd-bg);
    min-height: 100vh;
}

.main-wrapper.portal-home::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(11, 92, 171, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 106, 255, 0.05), transparent);
    pointer-events: none;
    z-index: 0;
}

.main-wrapper.portal-home .content-area {
    position: relative;
    z-index: 1;
}

.main-wrapper .content-area.index-layout,
.main-wrapper .content-area.portal-page-content,
.main-wrapper .content-area.browse-apps-layout {
    max-width: 1180px;
    width: 92%;
}

/* ── Authenticated sticky header ────────────────────────────── */
.portal-shell-header {
    position: sticky;
    top: 0;
    z-index: 900;
    margin-bottom: 24px;
    padding: 10px 0;
    /*background: linear-gradient(180deg, var(--pd-bg) 85%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);*/
}

.portal-shell-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    box-shadow: var(--pd-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
	text-decoration:none;
}

.portal-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pd-primary) 0%, var(--pd-primary-dark) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.02em;
    box-shadow: 0 4px 12px rgba(11, 92, 171, 0.28);
}

.portal-brand-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--pd-text);
    line-height: 1.2;
}

.portal-brand-text span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--pd-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

a.portal-brand:hover .portal-brand-text {
    color: var(--pd-primary);
}

.portal-shell-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
    min-width: 0;
}

.portal-shell-nav .portal-topbar-link {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    color: var(--pd-muted);
    border: 1px solid transparent;
}

.portal-shell-nav .portal-topbar-link:hover {
    background: #f1f5f9;
    color: var(--pd-primary);
    border-color: #e2e8f0;
}

.portal-shell-nav .portal-topbar-link.portal-topbar-link-active {
    background: linear-gradient(135deg, var(--pd-primary) 0%, var(--pd-primary-dark) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(11, 92, 171, 0.25);
}

.portal-nav-divider {
    width: 1px;
    height: 22px;
    background: var(--pd-border);
    margin: 0 6px;
    flex-shrink: 0;
}

.portal-shell-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-left: 12px;
    border-left: 1px solid var(--pd-border);
}

/* By Cursor, 2026-07-10: Clickable profile area in top bar. */
.portal-shell-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 4px 6px 4px 4px;
    margin: -4px 0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.portal-shell-user-link:hover {
    background: rgba(11, 92, 171, 0.08);
    text-decoration: none;
    color: inherit;
}

.portal-shell-user-link:focus-visible {
    outline: 2px solid var(--pd-accent, #0b5cab);
    outline-offset: 2px;
}

.portal-shell-user-meta {
    min-width: 0;
    text-align: right;
}

.portal-shell-user-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--pd-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.portal-shell-user-email {
    display: block;
    font-size: 11px;
    color: var(--pd-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.portal-topbar-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.portal-shell-signout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--pd-border);
    color: var(--pd-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.portal-shell-signout:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
    text-decoration: none;
}

/* ── Browse / manage apps pages ───────────────────────────── */
.browse-apps-layout .ma-toolbar,
.browse-apps-layout .portal-hero.browse-hero {
    border-radius: var(--pd-radius);
    /*box-shadow: var(--pd-shadow);*/
}

.browse-hero.portal-hero {
    border-radius: 18px;
}

/* ── Public header (docs, landing) ──────────────────────────── */
.portal-dashboard-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 32px 36px;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #0b5cab 0%, #084a8f 45%, #063d73 100%);
    color: #fff;
    box-shadow: 0 12px 40px rgba(11, 92, 171, 0.28);
}

.portal-dashboard-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 320px;
    height: 320px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.portal-dashboard-hero::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: 10%;
    width: 240px;
    height: 240px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    pointer-events: none;
}

.portal-dashboard-hero-inner {
    position: relative;
    z-index: 1;
}

.portal-dashboard-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.85;
    margin: 0 0 10px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.portal-dashboard-hero h1 {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.2;
}

.portal-dashboard-hero-lead {
    font-size: 16px;
    opacity: 0.92;
    margin: 0 0 20px;
    max-width: 540px;
    line-height: 1.55;
    font-weight: 400;
}

.portal-dashboard-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-dashboard-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

/* ── Section cards grid ─────────────────────────────────────── */
.portal-section {
    margin-bottom: 40px;
}

.portal-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pd-muted);
    margin: 0 0 18px;
    padding: 0;
    border: none;
}

.portal-section-title::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pd-primary), var(--pd-accent));
    flex-shrink: 0;
}

.index-layout .nav-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.index-layout .nav-card {
    position: relative;
    padding: 26px 24px 24px;
    border-radius: var(--pd-radius);
    border: 1px solid var(--pd-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.index-layout .nav-card::after {
    content: '→';
    position: absolute;
    top: 22px;
    right: 20px;
    font-size: 18px;
    color: #cbd5e1;
    transition: transform 0.2s, color 0.2s;
}

.index-layout .nav-card:hover {
    transform: translateY(-3px);
    border-color: var(--pd-primary);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}

.index-layout .nav-card:hover::after {
    transform: translateX(3px);
    color: var(--pd-primary);
}

.index-layout .nav-card.nav-card-featured {
    border-color: var(--pd-primary);
    background: linear-gradient(160deg, #eff6ff 0%, #fff 55%);
    box-shadow: 0 8px 24px rgba(11, 92, 171, 0.12);
}

.index-layout .nav-card .icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #f1f5f9;
    border-radius: 12px;
    margin-bottom: 14px;
}

.index-layout .nav-card.nav-card-featured .icon {
    background: rgba(11, 92, 171, 0.1);
}

.index-layout .nav-card .title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.portal-footer {
    margin-top: 48px;
    padding: 32px 24px;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    box-shadow: var(--pd-shadow);
    text-align: left;
}

.portal-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.portal-footer-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--pd-text);
    margin: 0 0 8px;
}

.portal-footer-brand span {
    color: var(--pd-primary);
}

.portal-footer-tagline {
    font-size: 13px;
    color: var(--pd-muted);
    line-height: 1.5;
    margin: 0;
    max-width: 280px;
}

.portal-footer-col h4 {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pd-muted);
    margin: 0 0 12px;
}

.portal-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.portal-footer-links li {
    margin-bottom: 8px;
}

.portal-footer-links a {
    font-size: 14px;
    color: var(--pd-text);
    text-decoration: none;
    font-weight: 500;
}

.portal-footer-links a:hover {
    color: var(--pd-primary);
    text-decoration: none;
}

.portal-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--pd-border);
    font-size: 13px;
    color: var(--pd-muted);
}

.portal-footer-bottom a {
    color: var(--pd-primary);
    font-weight: 600;
    text-decoration: none;
}

.portal-footer .portal-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--pd-border);
    color: var(--pd-muted) !important;
    font-weight: 600;
}

.portal-footer .portal-logout:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c !important;
}

/* ── Public header (docs, landing) ──────────────────────────── */
.api-ref-topbar {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 4px 20px rgba(15, 23, 42, 0.04);
}

.api-ref-logo.portal-brand .portal-brand-text span {
    color: var(--pd-primary);
}

.api-ref-topnav a {
    padding: 7px 12px;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
}

/*.api-ref-topnav a:hover {
    background: #f1f5f9;
}*/

.api-ref-topnav a.gs-nav-active {
    background: #eff6ff;
    color: var(--pd-primary) !important;
}

.api-ref-signin-btn {
    box-shadow: 0 4px 12px rgba(11, 92, 171, 0.22);
}

.api-ref-signin-btn-outline {
    background: transparent !important;
    color: var(--pd-primary) !important;
    border: 1px solid var(--pd-primary);
    box-shadow: none;
}

/* ── Explorer console header alignment ──────────────────────── */
.ae-console-wrap .portal-shell-header {
    padding-top: 0;
    margin-bottom: 8px;
    background: transparent;
    backdrop-filter: none;
}

.ae-console-wrap .portal-shell-header-inner {
    border-radius: 12px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
    .portal-shell-header-inner {
        flex-wrap: wrap;
        padding: 12px;
    }

    .portal-shell-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        padding-top: 8px;
        border-top: 1px solid var(--pd-border);
    }

    .portal-shell-user {
        margin-left: auto;
        border-left: none;
        padding-left: 0;
    }

    .portal-shell-user-meta {
        display: none;
    }

    .portal-footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .portal-dashboard-hero {
        padding: 24px 20px;
    }

    .portal-shell-nav .portal-topbar-link {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* By Cursor, 2026-07-10: Developer profile page layout */
.developer-profile-layout {
    max-width: 1080px;
}

.developer-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.developer-profile-card {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .developer-profile-grid {
        grid-template-columns: 1fr;
    }
}
