/* ==========================================================================
   UCE App Shell – Global nav, full-width layout, mobile drawer, footer
   Deep navy / gold SaaS aesthetic – no theme sidebar interference.
   ========================================================================== */

/* ---- Reset / base for standalone app pages ---- */
body.uce-app-page {
    margin: 0;
    padding: 0;
    background: #0b1221;
    color: #e2eaf5;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.uce-app-page *,
body.uce-app-page *::before,
body.uce-app-page *::after {
    box-sizing: border-box;
}

body.uce-nav-open { overflow: hidden; }

/* Hide theme chrome when we take over */
body.uce-app-page #wpadminbar { position: fixed; }
body.uce-app-page .uce-hide-adminbar #wpadminbar { display: none; }

/* Skip link */
.uce-skip-link {
    position: absolute;
    top: -999px; left: 50%; transform: translateX(-50%);
    background: #c8a042; color: #070d18;
    padding: 8px 20px; font-weight: 700; font-size: 14px;
    border-radius: 0 0 8px 8px; z-index: 99999;
    text-decoration: none;
    transition: top 0.1s;
}
.uce-skip-link:focus { top: 0; }

/* ==========================================================================
   App Shell Wrapper
   ========================================================================== */
.uce-app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   Ticker Bar (above nav)
   ========================================================================== */
.uce-ticker-bar {
    position: sticky;
    top: 0;
    z-index: 1001;
    width: 100%;
}

.uce-ticker-bar-inner {
    max-width: 100%;
}

.uce-ticker-bar .usce-ticker {
    background: rgba(5, 10, 20, 0.96);
    border-bottom: 1px solid rgba(200,160,66,0.12);
    height: 32px;
    padding: 0 24px;
    justify-content: center;
    gap: 28px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.admin-bar .uce-ticker-bar { top: 32px; }
@media (max-width: 782px) { body.admin-bar .uce-ticker-bar { top: 46px; } }
@media (max-width: 600px) { .uce-ticker-bar { display: none; } }

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */
.uce-top-nav {
    position: sticky;
    top: 32px;
    z-index: 1000;
    width: 100%;
    background: rgba(7, 13, 24, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: box-shadow 0.2s ease, background 0.2s ease;
    height: 60px;
}

.uce-top-nav.is-scrolled {
    background: rgba(7, 13, 24, 0.98);
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
    border-bottom-color: rgba(200,160,66,0.15);
}

/* Admin bar offset - nav sits below ticker (32px) + admin bar */
body.admin-bar .uce-top-nav { top: calc(32px + 32px); }
@media (max-width: 782px) { body.admin-bar .uce-top-nav { top: calc(32px + 46px); } }
/* No admin bar: nav sits below ticker */
body:not(.admin-bar) .uce-top-nav { top: 32px; }

.uce-nav-inner {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
}

/* Logo */
.uce-nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 32px;
}

.uce-nav-logo-icon {
    width: 32px; height: 32px;
    color: #c8a042;
    flex-shrink: 0;
}

.uce-nav-logo-icon svg { width: 100%; height: 100%; }

.uce-nav-logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: #e2eaf5;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.uce-nav-logo-custom {
    display: flex;
    align-items: center;
}

.uce-nav-logo-img {
    display: block;
    max-height: 36px;
    width: auto;
    object-fit: contain;
}

/* Desktop nav links */
.uce-nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.uce-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.uce-nav-link:hover {
    color: #e2eaf5;
    background: rgba(255,255,255,0.06);
}

.uce-nav-link--active {
    color: #c8a042;
    background: rgba(200,160,66,0.08);
}

.uce-nav-link--active:hover {
    color: #e2c574;
    background: rgba(200,160,66,0.14);
}

.uce-nav-link-icon {
    width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8;
}
.uce-nav-link-icon svg { width: 100%; height: 100%; }

/* Right actions */
.uce-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* CTA button */
.uce-nav-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: linear-gradient(135deg, #c8a042, #e2c574);
    color: #070d18;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 12px rgba(200,160,66,0.25);
    white-space: nowrap;
}

.uce-nav-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(200,160,66,0.35);
}

.uce-nav-cta svg { width: 14px; height: 14px; }

/* Login link */
.uce-nav-login {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: none;
    padding: 7px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.uce-nav-login:hover {
    color: #e2eaf5;
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.04);
}

/* Avatar / user menu */
.uce-nav-user-menu { position: relative; }

.uce-nav-avatar-btn {
    background: none;
    border: 2px solid rgba(200,160,66,0.3);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, transform 0.1s;
    width: 38px; height: 38px;
}
.uce-nav-avatar-btn:hover { border-color: #c8a042; transform: scale(1.04); }

.uce-nav-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Dropdown */
.uce-nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: #162034;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.7);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 2000;
}

.uce-nav-user-menu.is-open .uce-nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.uce-nav-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 4px;
}
.uce-nav-dropdown-avatar {
    width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
}
.uce-nav-dropdown-name {
    font-size: 13px; font-weight: 600; color: #e2eaf5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 130px;
}

.uce-nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.uce-nav-dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.uce-nav-dropdown-item:hover { background: rgba(255,255,255,0.07); color: #e2eaf5; }
.uce-nav-dropdown-item--danger:hover { background: rgba(239,68,68,0.1); color: #f87171; }

.uce-nav-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 4px 0;
}

/* Hamburger */
.uce-nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px; height: 36px;
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s, background 0.15s;
}
.uce-nav-hamburger:hover {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.04);
}
.uce-nav-hamburger span {
    display: block;
    width: 18px; height: 2px;
    background: #94a3b8;
    border-radius: 2px;
    transition: background 0.15s;
}
.uce-nav-hamburger:hover span { background: #e2eaf5; }

/* ==========================================================================
   Mobile Navigation Drawer
   ========================================================================== */
.uce-mobile-nav {
    position: fixed;
    top: 0; right: 0;
    width: min(320px, 85vw);
    height: 100vh;
    height: 100dvh;
    background: #0f1a2e;
    border-left: 1px solid rgba(255,255,255,0.08);
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}

.uce-mobile-nav.is-open { transform: translateX(0); }

.uce-mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    z-index: 2999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}
.uce-mobile-nav-overlay.is-visible { opacity: 1; visibility: visible; }

.uce-mobile-nav-inner { padding: 0 16px 32px; flex: 1; }

.uce-mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 12px;
}

.uce-mobile-nav-title {
    font-size: 15px; font-weight: 700; color: #e2eaf5;
}

.uce-mobile-nav-close {
    background: none; border: none;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: #94a3b8;
    transition: background 0.12s, color 0.12s;
}
.uce-mobile-nav-close:hover { background: rgba(255,255,255,0.07); color: #e2eaf5; }
.uce-mobile-nav-close svg { width: 18px; height: 18px; }

.uce-mobile-nav-links { display: flex; flex-direction: column; gap: 2px; }

.uce-mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.uce-mobile-nav-link:hover { background: rgba(255,255,255,0.06); color: #e2eaf5; }
.uce-mobile-nav-link--highlight {
    background: rgba(200,160,66,0.1);
    color: #c8a042;
    font-weight: 700;
}
.uce-mobile-nav-link--highlight:hover {
    background: rgba(200,160,66,0.18);
    color: #e2c574;
}
.uce-mobile-nav-link--muted { color: #64748b; }

.uce-mobile-nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.uce-mobile-nav-icon svg { width: 100%; height: 100%; }

.uce-mobile-nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 8px 0;
}

/* ==========================================================================
   Main Content Area – Full Width
   ========================================================================== */
.uce-app-main {
    flex: 1;
    width: 100%;
}

.uce-app-content {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 24px 72px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.uce-app-footer {
    background: #070d18;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 40px 24px 32px;
    margin-top: auto;
}

.uce-footer-inner {
    max-width: 1380px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.uce-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.uce-footer-logo {
    font-size: 15px;
    font-weight: 700;
    color: #e2eaf5;
}

.uce-footer-tagline {
    font-size: 12px;
    color: #4a6080;
}

.uce-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.uce-footer-nav-link {
    font-size: 13px;
    color: #4a6080;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.uce-footer-nav-link:hover { color: #c8a042; background: rgba(200,160,66,0.06); }

.uce-footer-legal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.uce-footer-copy {
    font-size: 12px;
    color: #2d3f5a;
    margin: 0;
    text-align: center;
}
.uce-footer-legal-links { display: flex; align-items: center; gap: 10px; }
.uce-footer-legal-link { font-size: 12px; color: #2d3f5a; text-decoration: none; transition: color 0.15s; }
.uce-footer-legal-link:hover { color: #c8a042; }
.uce-footer-legal-sep { font-size: 12px; color: #1e2d3d; }

/* ==========================================================================
   Full-width layout overrides
   Remove sidebar/container max-width constraints from theme
   ========================================================================== */
body.uce-app-page #page,
body.uce-app-page #content,
body.uce-app-page .site,
body.uce-app-page .site-content,
body.uce-app-page main.site-main,
body.uce-app-page .wp-site-blocks {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.uce-app-page .sidebar,
body.uce-app-page #secondary,
body.uce-app-page .widget-area,
body.uce-app-page aside.primary-sidebar {
    display: none !important;
}

/* Submission form – centered narrow layout */
.uce-submission-page .uce-app-content {
    max-width: 860px;
}

/* Membership page – wider centered */
.uce-membership-page .uce-app-content {
    max-width: 1100px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .uce-nav-links { gap: 0; }
    .uce-nav-link { padding: 6px 10px; font-size: 13px; }
    .uce-nav-cta span { display: none; }
    .uce-nav-cta { padding: 8px; border-radius: 8px; width: 36px; height: 36px; justify-content: center; }
    .uce-nav-cta svg { width: 16px; height: 16px; margin: 0; }
}

/* Mobile – hide desktop nav, show hamburger */
@media (max-width: 768px) {
    .uce-nav-links { display: none; }
    .uce-nav-hamburger { display: flex; }
    .uce-nav-cta { display: none; }
    .uce-nav-logo-text { font-size: 15px; }
    .uce-nav-inner { padding: 0 16px; }
    .uce-app-content { padding: 0 16px 56px; }
    .uce-footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
    .uce-footer-copy { text-align: left; }
}

@media (max-width: 480px) {
    .uce-app-content { padding: 0 12px 48px; }
    .uce-top-nav { height: 56px; }
    .uce-nav-inner { height: 56px; }
    .uce-nav-logo-icon { width: 26px; height: 26px; }
    .uce-nav-logo-text { font-size: 14px; }
}

/* ==========================================================================
   Shared Page Hero – overrides for full-width layout
   ========================================================================== */
body.uce-app-page .uce-archive-hero {
    width: calc(100% + 48px);
    margin-left: -24px;
    margin-right: -24px;
    padding: 64px 24px 56px;
}

body.uce-app-page .uce-single-hero {
    width: calc(100% + 48px);
    margin-left: -24px;
    margin-right: -24px;
}

@media (max-width: 768px) {
    body.uce-app-page .uce-archive-hero {
        width: calc(100% + 32px);
        margin-left: -16px;
        margin-right: -16px;
        padding: 48px 16px 40px;
    }
    body.uce-app-page .uce-single-hero {
        width: calc(100% + 32px);
        margin-left: -16px;
        margin-right: -16px;
    }
}

@media (max-width: 480px) {
    body.uce-app-page .uce-archive-hero {
        width: calc(100% + 24px);
        margin-left: -12px;
        margin-right: -12px;
        padding: 40px 12px 32px;
    }
    body.uce-app-page .uce-single-hero {
        width: calc(100% + 24px);
        margin-left: -12px;
        margin-right: -12px;
    }
}

/* ==========================================================================
   Submission Form – Centered Card Layout
   ========================================================================== */
.uce-submission-form-wrap {
    max-width: 800px;
    margin: 40px auto;
}

.uce-form-header {
    text-align: center;
    padding: 0 0 32px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 32px;
}

.uce-form-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #e2eaf5;
    margin: 0 0 8px;
}

.uce-form-subtitle {
    color: #7a92b0;
    font-size: 15px;
    margin: 0;
}

/* ==========================================================================
   Membership Plans Page – Full Width Centered
   ========================================================================== */
.uce-membership-plans-wrap {
    padding: 48px 0;
}

.uce-plans-header {
    text-align: center;
    padding-bottom: 40px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .uce-top-nav, .uce-mobile-nav, .uce-mobile-nav-overlay,
    .uce-app-footer, .uce-nav-hamburger { display: none !important; }
    body.uce-app-page .uce-app-main { padding-top: 0; }
    body.uce-app-page { background: #fff; color: #000; }
}
