/*
Theme Name: ModernFlux
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A professional school & dating-ready theme with SchoolPro light/dark portal presets, glassmorphism, bento grids, Abyssinica SIL typography, 6 animated skeleton loaders, seamless page transitions, native Menu61 desktop sidebar & top-bar user integration, and rich Customizer controls.
Version: 2.5.8
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: modernflux
*/

/* ========== DESIGN TOKENS (SchoolPro Light Portal Default + Dark Glass Preset Support) ========== */
:root {
    --bg: #f4f7fb;
    --bg-secondary: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #007bff;
    --accent-glow: rgba(0, 123, 255, 0.28);
    --glass-bg: rgba(255, 255, 255, 0.94);
    --glass-border: rgba(15, 23, 42, 0.08);
    --card-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    --radius: clamp(0.75rem, 2vw, 1.25rem);
    --font-body: 'Abyssinica SIL', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition-speed: 0.3s;
    --header-padding-desktop: 0.85rem;
    --header-padding-mobile: 0.75rem;
    --icon-size: 24px;
    --logo-size: 48px;
    --header-bg: #ffffff;
    --header-status-bg: #ffffff;
    --header-glass: none;
    --header-glass-blur: 14px;
    --content-spacing-left: 0px;
    --content-spacing-right: 0px;
    --footer-bg: #ffffff;
    --footer-col-title-color: #0f172a;
    --footer-col-link-color: #475569;
    --footer-border-color: rgba(15, 23, 42, 0.08);
    --footer-copyright-border-color: rgba(15, 23, 42, 0.08);
    --upm-sidebar-width: 265px;
    --upm-sidebar-collapsed-width: 78px;
    --upm-sidebar-margin: 0px;
    --mf-sticky-top: 0px;
    --mf-admin-bar-h: 0px;
    --mf-viewport-min-height: 100dvh;
}
body.mf-preset-dark_glass {
    --bg: #0a0a0a;
    --bg-secondary: #111111;
    --text: #e0e0e0;
    --text-muted: #a1a1aa;
    --accent: #00f0ff;
    --accent-glow: rgba(0, 240, 255, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --header-bg: #111111;
    --header-status-bg: #111111;
    --footer-bg: #111111;
    --footer-col-title-color: #ffffff;
    --footer-col-link-color: #a1a1aa;
    --footer-border-color: rgba(255, 255, 255, 0.12);
    --footer-copyright-border-color: rgba(255, 255, 255, 0.08);
}
body.admin-bar {
    --mf-admin-bar-h: 32px;
}
@media (max-width: 782px) {
    body.admin-bar {
        --mf-admin-bar-h: 46px;
    }
}

/* ========== DEVICE STATUS / SAFE-AREA TOP BAR FILL ========== */
.mf-status-bar-safearea {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: var(--header-status-bg, var(--header-bg));
    z-index: 2147483000;
    pointer-events: none;
}

/* ========== GLOBAL ========== */
html, body {
    min-height: 100%;
    margin: 0;
    padding: 0;
}
html {
    font-size: clamp(16px, 1.8vw, 19px);
    scroll-behavior: smooth;
    background: var(--bg);
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition-speed), opacity var(--transition-speed); }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; font-family: var(--font-body); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 6vw, 4rem); }
h2 { font-size: clamp(1.65rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 2.6vw, 1.85rem); }

/* Attractive Decorative Text Display (high contrast in both Light Portal and Dark Glass) */
.mf-decorated-title {
    position: relative;
    display: inline-block;
    background: linear-gradient(120deg, var(--text) 0%, var(--accent) 55%, var(--text) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: mfTextShimmer 6s ease-in-out infinite;
    padding-bottom: 0.35rem;
}
.mf-decorated-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 68px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #facc15 65%, transparent);
}
.mf-decorated-subtitle {
    color: var(--text-muted);
    letter-spacing: 0.015em;
    border-bottom: 1px dashed var(--glass-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
}
@keyframes mfTextShimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* Edge-to-edge / Exact Customizer Left & Right Spacing */
.full-width {
    width: 100%;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: var(--content-spacing-left, 0px);
    padding-right: var(--content-spacing-right, 0px);
}

/* Content container – strictly respects left/right spacing (0px = flush) */
.content-narrow {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.5rem 0;
}

/* ========== SKIP LINK ========== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent);
    color: #ffffff;
    padding: 0.5em 1em;
    z-index: 10000;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ========== HEADER ========== */
.site-header {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 0;
    transition: transform 0.3s ease, padding 0.3s ease, height 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
    z-index: 1000;
    position: relative;
    overflow: visible;
    margin: 0;
    padding: env(safe-area-inset-top, 0px) 0 0 0;
}
.site-header:not(.glass-header)::before,
.site-header:not(.glass-header)::after {
    display: none !important;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 96%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    margin: 0 auto;
    background: transparent;
    backdrop-filter: none;
    padding: var(--header-padding-desktop) 1.5rem;
    transition: all 0.3s ease;
    gap: 1rem;
    position: relative;
    z-index: 2;
}
.mf-desktop-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 0.65rem;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.mf-desktop-sidebar-toggle:hover {
    background: rgba(0, 123, 255, 0.08);
    border-color: var(--accent);
    color: var(--accent);
}
@media (max-width: 768px) {
    .mf-desktop-sidebar-toggle {
        display: none !important;
    }
}
.site-branding {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}
.site-branding a,
.custom-logo-link {
    display: inline-flex;
    align-items: center;
    max-height: 100%;
    min-height: 0;
}
.custom-logo {
    max-height: min(var(--logo-size, 48px), 100%);
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    transition: max-height 0.3s ease;
}
.site-header.is-shrunk .custom-logo {
    max-height: min(var(--logo-size, 48px), 36px, 100%);
}
.site-logo {
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    display: inline-block;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.site-logo:hover { color: var(--accent); }

/* Layouts */
.header-layout-centered .header-inner { flex-direction: column; }
.header-layout-centered .site-branding { margin-bottom: 0.35rem; }
.header-layout-minimal .nav-links { display: none; }

/* Logo position */
.logo-left .header-inner { justify-content: space-between; }
.logo-right .header-inner { justify-content: flex-end; }
.logo-center .header-inner { justify-content: center; }

.header-fullwidth .header-inner { max-width: 98%; }
.header-boxed .header-inner { max-width: 1240px; margin-left: auto; margin-right: auto; }

.sticky-header { position: sticky; top: 0; }
.header-hidden { transform: translateY(-100%); }
.site-header.is-shrunk .site-logo { font-size: 1.15rem; }
.site-header.is-shrunk .header-inner { padding-top: 0.35rem; padding-bottom: 0.35rem; }

/* Header Glass Effect (On/Off Controlled from Admin & Customizer + Pure Glass Slide Animation) */
.mf-header-glass-fx {
    display: none;
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}
.site-header.glass-header {
    backdrop-filter: blur(var(--header-glass-blur, 14px)) saturate(175%);
    -webkit-backdrop-filter: blur(var(--header-glass-blur, 14px)) saturate(175%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}
.site-header.glass-header .mf-header-glass-fx {
    display: block;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.03) 55%,
        rgba(255, 255, 255, 0.08) 100%
    );
}
.site-header.glass-header .mf-header-glass-fx::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 38%,
        rgba(255, 255, 255, 0.26) 50%,
        rgba(255, 255, 255, 0.08) 62%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: mfHeaderGlassSlide 5.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.site-header.glass-header .mf-header-glass-fx::after {
    content: "";
    position: absolute;
    top: -40%;
    left: -35%;
    width: 34%;
    height: 180%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: rotate(20deg);
    animation: mfHeaderGlassSweep 5.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes mfHeaderGlassSlide {
    0% { transform: translateX(-100%); opacity: 0.2; }
    45% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0.2; }
}
@keyframes mfHeaderGlassSweep {
    0% { transform: translateX(-140%) rotate(20deg); opacity: 0; }
    35% { opacity: 0.85; }
    75%, 100% { transform: translateX(380%) rotate(20deg); opacity: 0; }
}
.site-header:not(.glass-header) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.site-header:not(.glass-header) .mf-header-glass-fx {
    display: none !important;
}

/* Nav */
.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    padding: 0.35rem 0;
    position: relative;
}
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    appearance: none;
    -webkit-appearance: none;
    touch-action: manipulation;
}
.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: block;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.header-widget-area { margin-left: auto; display: flex; align-items: center; gap: 1rem; }

/* Header wave */
.header-wave {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    margin-bottom: -2px;
    position: relative;
    z-index: 999;
}
.header-wave svg { display: block; width: 100%; height: auto; }

/* Entrance animation */
@keyframes headerFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.site-header { animation: headerFadeIn 0.6s ease-out both; }

/* ========== SITE CONTENT, WORKSPACE SHELL & STICKY FOOTER ========== */
body {
    display: flex;
    flex-direction: column;
    min-height: calc(var(--mf-viewport-min-height, 100dvh) - var(--mf-admin-bar-h, 0px));
    margin-left: 0;
    padding-left: 0;
    background: var(--bg);
    color: var(--text);
    overflow-x: clip;
}

#page-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: calc(var(--mf-viewport-min-height, 100dvh) - var(--mf-admin-bar-h, 0px));
    width: 100%;
    min-width: 0;
    transition: margin-left 0.25s ease, width 0.25s ease, max-width 0.25s ease;
}

.mf-workspace-shell {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex: 1 0 auto;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.site-content {
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.site-header,
.site-footer,
.apple-action-bar {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* ========== BENTO GRID & GLASS CARDS ========== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: clamp(1rem, 3vw, 2rem);
    max-width: 1200px;
    margin: 0 auto;
}
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
}
.glass-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px var(--accent-glow); }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.75em 1.8em;
    border-radius: 50px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.15s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #ffffff; border: none; }
.btn-glow:hover { box-shadow: 0 0 20px var(--accent-glow); }

/* ========== SCROLL REVEAL ========== */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1), transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.split-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
    transition-delay: var(--delay, 0s);
}
.reveal.visible .split-char { opacity: 1; transform: translateY(0); }

/* ========== MARQUEE ========== */
.marquee { overflow: hidden; white-space: nowrap; background: var(--bg-secondary); padding: 1rem 0; width: 100%; }
.marquee-content { display: inline-block; animation: marquee 20s linear infinite; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ========== STICKY SECTIONS ========== */
.sticky-section {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-bottom: 1px solid var(--glass-border);
    width: 100%;
}

/* ========== TYPEWRITER ========== */
.typewriter::after { content: '|'; animation: blink 0.7s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ========== SKELETON LOADER & SEAMLESS PAGE TRANSITIONS ========== */
.skeleton {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, rgba(0, 123, 255, 0.14), var(--bg) 70%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.38s ease;
}
.skeleton.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.skeleton.is-transitioning {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.skeleton-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    width: min(320px, 92vw);
    padding: 2rem 1.75rem;
    background: rgba(11, 36, 91, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 40px rgba(0, 123, 255, 0.18);
    animation: pulse 1.8s infinite ease-in-out;
    position: relative;
    overflow: hidden;
}
@keyframes pulse {
    0%, 100% { opacity: 0.92; transform: scale(0.985); }
    50% { opacity: 1; transform: scale(1); }
}

/* 1. Dating Classic */
.skeleton-card.dating .skeleton-heart {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, #ff3366, #cc0044);
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') center / contain no-repeat;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') center / contain no-repeat;
    animation: heartBeat 1s infinite;
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}
.skeleton-card.dating .skeleton-profile {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(90deg, #2a2a2a 25%, #3f3f46 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* 2. Education Classic */
.skeleton-card.education .skeleton-book {
    width: 72px;
    height: 72px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2300f0ff"><path d="M4 6H2v14c0 1.1.9 2 2 2h16v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-3 9h-6V7h6v4z"/></svg>') no-repeat center;
    background-size: contain;
    animation: bookShake 1.2s infinite;
}
@keyframes bookShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}
.skeleton-card.education .skeleton-cap {
    width: 88px;
    height: 88px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2300f0ff"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>') no-repeat center;
    background-size: contain;
    animation: capFloat 1.4s infinite ease-in-out;
}
@keyframes capFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 3. Dating Aurora */
.skeleton-card.dating_aurora {
    background: linear-gradient(145deg, rgba(45, 12, 42, 0.92), rgba(14, 18, 38, 0.94));
    border-color: rgba(244, 63, 94, 0.45);
    box-shadow: 0 20px 60px rgba(244, 63, 94, 0.28), 0 0 35px rgba(217, 70, 239, 0.22);
}
.skeleton-aurora-orb {
    position: relative;
    width: 112px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.skeleton-aurora-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 3px;
    background: conic-gradient(from 0deg, #fb7185, #e879f9, #38bdf8, #fb7185);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mfSpin 2.2s linear infinite;
}
.skeleton-aurora-heart {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #fb7185, #f43f5e, #d946ef);
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') center / contain no-repeat;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') center / contain no-repeat;
    animation: heartBeat 0.95s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(244, 63, 94, 0.7));
}
.skeleton-wave-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 26px;
}
.skeleton-wave-bars span {
    width: 6px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fb7185, #c084fc);
    animation: mfWaveBar 1.1s ease-in-out infinite;
}
.skeleton-wave-bars span:nth-child(2) { animation-delay: 0.15s; }
.skeleton-wave-bars span:nth-child(3) { animation-delay: 0.3s; }
.skeleton-wave-bars span:nth-child(4) { animation-delay: 0.45s; }
.skeleton-wave-bars span:nth-child(5) { animation-delay: 0.6s; }
@keyframes mfWaveBar {
    0%, 100% { height: 8px; opacity: 0.55; }
    50% { height: 26px; opacity: 1; }
}

/* 4. Dating Spark */
.skeleton-card.dating_spark {
    background: linear-gradient(155deg, rgba(38, 12, 24, 0.94), rgba(40, 18, 10, 0.94));
    border-color: rgba(251, 146, 60, 0.45);
    box-shadow: 0 20px 60px rgba(249, 115, 22, 0.24), 0 0 35px rgba(244, 63, 94, 0.25);
}
.skeleton-spark-stack {
    position: relative;
    width: 118px;
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.skeleton-spark-card {
    position: absolute;
    width: 68px;
    height: 86px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.skeleton-spark-card.back {
    background: linear-gradient(135deg, #fb923c, #f43f5e);
    transform: rotate(-11deg) translateX(-12px);
    opacity: 0.72;
    animation: mfCardLeft 2s ease-in-out infinite;
}
.skeleton-spark-card.front {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    transform: rotate(7deg) translateX(8px);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mfCardRight 2s ease-in-out infinite;
}
.skeleton-spark-card.front::after {
    content: "";
    width: 30px;
    height: 30px;
    background: #ffffff;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') center / contain no-repeat;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') center / contain no-repeat;
    animation: heartBeat 1.1s infinite;
}
@keyframes mfCardLeft {
    0%, 100% { transform: rotate(-11deg) translateX(-12px); }
    50% { transform: rotate(-16deg) translateX(-18px) translateY(-3px); }
}
@keyframes mfCardRight {
    0%, 100% { transform: rotate(7deg) translateX(8px); }
    50% { transform: rotate(11deg) translateX(14px) translateY(-4px); }
}

/* 5. School Campus Horizon */
.skeleton-card.school_modern {
    background: linear-gradient(145deg, rgba(11, 36, 91, 0.96), rgba(5, 19, 54, 0.96));
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 20px 60px rgba(0, 123, 255, 0.25), 0 0 35px rgba(56, 189, 248, 0.2);
}
.skeleton-horizon-crest {
    position: relative;
    width: 108px;
    height: 108px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.22), rgba(250, 204, 21, 0.16));
    border: 1px solid rgba(56, 189, 248, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: capFloat 1.8s ease-in-out infinite;
}
.skeleton-horizon-crest::before {
    content: "";
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, #facc15, #38bdf8);
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm6.82 6L12 12.72 5.18 9 12 5.28 18.82 9zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73v3.72z"/></svg>') center / contain no-repeat;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm6.82 6L12 12.72 5.18 9 12 5.28 18.82 9zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73v3.72z"/></svg>') center / contain no-repeat;
}
.skeleton-progress-track {
    width: 85%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.skeleton-progress-fill {
    width: 48%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #007bff, #38bdf8, #facc15);
    animation: mfProgressSlide 1.5s ease-in-out infinite;
}
@keyframes mfProgressSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(220%); }
}

/* 6. School Scholar Prism */
.skeleton-card.school_academy {
    background: linear-gradient(150deg, rgba(17, 24, 54, 0.94), rgba(30, 27, 75, 0.95));
    border-color: rgba(250, 204, 21, 0.42);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.25), 0 0 35px rgba(250, 204, 21, 0.16);
}
.skeleton-prism-stage {
    position: relative;
    width: 112px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.skeleton-prism-orbit {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2px dashed rgba(250, 204, 21, 0.55);
    animation: mfSpin 7s linear infinite;
}
.skeleton-prism-book {
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, #fde047, #38bdf8, #818cf8);
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1zm0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5v11.5z"/></svg>') center / contain no-repeat;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1zm0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5v11.5z"/></svg>') center / contain no-repeat;
    animation: bookShake 1.6s ease-in-out infinite;
}

@keyframes mfSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.skeleton-line {
    height: 11px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.08) 25%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.08) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-icon-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    color: var(--accent);
    text-align: center;
}
.skeleton-icon {
    font-size: 1.75rem;
    line-height: 1;
}
#skeleton-rotating-text {
    font-weight: 600;
    color: #ffffff;
    transition: opacity 0.25s ease;
}

/* ========== FOOTER ========== */
body.footer-hidden .mf-footer-dock,
body.footer-hidden .site-footer,
body.footer-hidden .footer-wave {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
body.footer-hidden,
body.footer-hidden #page-content {
    min-height: auto !important;
}
body.footer-hidden .site-content {
    flex: 0 1 auto !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
body.footer-hidden .site-content > *:last-child {
    min-height: auto !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.mf-footer-dock {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.site-footer {
    flex-shrink: 0;
    width: 100%;
    padding: 2rem 1.25rem;
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border-color, var(--glass-border));
    color: var(--text-muted);
    text-align: center;
    margin-top: 0;
    position: relative;
    z-index: 95;
}
.footer-inner {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.footer-widgets {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(0.55rem, 2vw, 1.75rem);
    align-items: stretch;
    margin-bottom: 2rem;
    width: 100%;
}
.footer-layout-1 .footer-widgets { grid-template-columns: minmax(0, 1fr); }
.footer-layout-2 .footer-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-layout-3 .footer-widgets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.footer-layout-4 .footer-widgets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.footer-layout-centered .footer-inner {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}
.footer-layout-centered .footer-widgets { grid-template-columns: minmax(0, 1fr); }

.footer-widget-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.55rem;
    min-width: 0;
    width: 100%;
    border-left: 2px solid var(--footer-border-color, rgba(15, 23, 42, 0.14));
    padding-left: clamp(0.45rem, 1.5vw, 1rem);
    overflow-wrap: anywhere;
    word-break: break-word;
}
.footer-widget-area .footer-widget {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
}
.footer-widget-area ul,
.footer-widget-area ol,
.footer-widget-area .menu,
.mf-footer-col-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.38rem;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
}
.footer-widget-area h3,
.footer-widget-area .widget-title,
.mf-footer-col-title,
.mf-footer-col-title a {
    margin: 0 0 0.25rem 0;
    font-weight: 700;
    font-size: clamp(0.8rem, 1.8vw, 1.05rem);
    line-height: 1.3;
    color: var(--footer-col-title-color, #0f172a) !important;
    background: none !important;
    -webkit-text-fill-color: currentColor;
    text-align: left;
    padding-bottom: 0.2rem;
}
.mf-footer-col-title::after,
.footer-widget-area .widget-title::after { display: none; }
.mf-footer-col-title a:hover { color: var(--accent) !important; }
.mf-footer-col-list,
.mf-footer-col-list li,
.mf-footer-col-list a,
.footer-widget-area li,
.footer-widget-area p,
.footer-widget-area a:not(.mf-footer-col-title-link) {
    color: var(--footer-col-link-color, var(--text-muted));
    font-size: clamp(0.72rem, 1.5vw, 0.9rem);
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    max-width: 100%;
}
.mf-footer-col-list a:hover,
.footer-widget-area a:hover { color: var(--accent); }
.footer-badge {
    display: inline-block;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 0.22rem 0.85rem;
    border-radius: 20px;
    margin-bottom: 0.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.footer-menu { list-style: none; display: flex; justify-content: center; gap: 2rem; margin: 1rem 0; flex-wrap: wrap; }
.footer-menu a { color: var(--text-muted); font-size: 0.9rem; }
.footer-menu a:hover { color: var(--accent); }

.social-icons { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.social-icons a:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.social-icons svg { width: 18px; height: 18px; fill: currentColor; }

.footer-wave { width: 100%; overflow: hidden; line-height: 0; margin-top: -2px; }
.footer-wave svg { display: block; width: 100%; height: auto; }

.footer-copyright {
    border-top: 1px solid var(--footer-copyright-border-color, rgba(15, 23, 42, 0.08));
    margin-top: 1.5rem;
    padding-top: 1rem;
}
.footer-text { margin-top: 1rem; font-size: 0.9rem; }

/* ========== DATING & SCHOOL EXTRA ========== */
.stat-number { font-size: clamp(2rem, 6vw, 3rem); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.profile-card { text-align: center; }
.profile-card img { object-fit: cover; margin: 0 auto 1rem; }
.heart-icon { width: 60px; height: 60px; }
.search-bar select,
.search-bar input {
    font-family: var(--font-body);
    transition: border-color 0.3s;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 0.75em 1.5em;
    border-radius: 50px;
}
.search-bar select:focus,
.search-bar input:focus { border-color: var(--accent); outline: none; }
#join input:focus { border-color: var(--accent); outline: none; }

/* ========== UTILITY ========== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== RESPONSIVE (MOBILE & TABLET) ========== */
@media (max-width: 768px) {
    .header-inner {
        padding: var(--header-padding-mobile) 1rem;
        max-width: 100% !important;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        border-top: 1px solid var(--glass-border);
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 1.25rem 1.25rem;
        gap: 0.25rem;
        z-index: 999;
    }
    .nav-links.active { display: flex; }
    .nav-links a {
        display: block;
        padding: 0.75rem 0.5rem;
        min-height: 44px;
        border-bottom: 1px solid var(--glass-border);
    }
    .hamburger { display: flex; }

    .footer-layout-2 .footer-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-layout-3 .footer-widgets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-layout-4 .footer-widgets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .footer-widgets { gap: 0.5rem; }
    .footer-menu { flex-direction: column; gap: 0.5rem; }
    .footer-widget-area { margin-bottom: 0; padding-left: 0.45rem; }

    body { margin-left: 0 !important; }
    .mf-workspace-shell { flex-direction: column; }
    .content-narrow { padding: 1rem 0; }
    .footer-inner {
        max-width: 100% !important;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }
    .apple-action-bar {
        width: 100% !important;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .upm-desktop-sidebar { display: none !important; }
}

/* ========== CENTER HEADER ICONS ========== */
.header-icons-centered .header-inner { flex-wrap: wrap; }
.header-icons-centered .header-custom-icons {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0.5rem 0;
    order: 2;
}
.header-icons-centered .site-branding { order: 1; }
.header-icons-centered nav,
.header-icons-centered .header-widget-area { order: 3; }
@media (max-width: 768px) {
    .header-icons-centered .header-custom-icons { order: 0; margin-top: 0; }
    .header-icons-centered .header-inner { flex-direction: column; }
}

/* ========== HEADER CUSTOM ICONS ========== */
.header-custom-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.75rem;
}
.header-custom-icon {
    display: inline-flex;
    width: var(--icon-size, 28px);
    height: var(--icon-size, 28px);
    border-radius: 50%;
    transition: transform 0.2s, box-shadow 0.2s;
}
.header-custom-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}
.header-custom-icon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 4px var(--accent-glow));
}

/* ========== HEADER CENTER ROTATING TEXT ========== */
.site-header.has-center-text .header-inner { position: relative; }
.site-header.has-center-text .header-center-text {
    text-align: center;
    margin: 0;
    flex: 1;
}
#header-rotating-text {
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#header-rotating-text.slide-out {
    transform: translateY(-16px);
    opacity: 0;
}
@media (max-width: 768px) {
    .site-header.has-center-text .header-center-text {
        font-size: 0.88rem;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
        min-width: 0;
    }
}

/* ========== APPLE ACTION BAR ========== */
.apple-action-bar {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    transition: transform 0.3s ease, height 0.2s;
    position: relative;
    display: flex;
    align-items: center;
}
.apple-action-bar.bar-hidden { transform: translateY(-100%); }
.apple-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
}
.apple-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.2s ease;
    position: relative;
}
.apple-action-icon img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.2s;
}
.apple-action-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent-glow);
    border-color: var(--accent);
}
.apple-action-icon .icon-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    color: var(--accent);
}
@media (max-width: 768px) {
    .apple-bar-inner { gap: 0.75rem; }
    .apple-action-icon { width: 52px; height: 52px; }
    .apple-action-icon img { max-width: 42px; max-height: 42px; }
}

.apple-action-bar[data-desktop-count="1"] .apple-action-icon:nth-child(n+2),
.apple-action-bar[data-desktop-count="2"] .apple-action-icon:nth-child(n+3),
.apple-action-bar[data-desktop-count="3"] .apple-action-icon:nth-child(n+4),
.apple-action-bar[data-desktop-count="4"] .apple-action-icon:nth-child(n+5),
.apple-action-bar[data-desktop-count="5"] .apple-action-icon:nth-child(n+6),
.apple-action-bar[data-desktop-count="6"] .apple-action-icon:nth-child(n+7),
.apple-action-bar[data-desktop-count="7"] .apple-action-icon:nth-child(n+8),
.apple-action-bar[data-desktop-count="8"] .apple-action-icon:nth-child(n+9) { display: none; }

@media (max-width: 768px) {
    .apple-action-bar[data-mobile-count="1"] .apple-action-icon:nth-child(n+2),
    .apple-action-bar[data-mobile-count="2"] .apple-action-icon:nth-child(n+3),
    .apple-action-bar[data-mobile-count="3"] .apple-action-icon:nth-child(n+4),
    .apple-action-bar[data-mobile-count="4"] .apple-action-icon:nth-child(n+5) { display: none; }
}

/* ========== FLOATING BUTTONS ========== */
.floating-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9998;
}
.floating-btn,
.floating-message,
.floating-phone,
.floating-backtotop {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-muted);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
}
.floating-btn:hover,
.floating-message:hover,
.floating-phone:hover,
.floating-backtotop:hover {
    transform: scale(1.08);
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}
.floating-btn svg,
.floating-message svg,
.floating-phone svg,
.floating-backtotop svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* ========== AUTO CONTRAST CLASSES ========== */
body.header-bg-light .site-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
body.header-bg-light .site-logo,
body.header-bg-light .nav-links a,
body.header-bg-light .header-custom-icon svg,
body.header-bg-light .header-widget-area * {
    color: #0f172a !important;
}
body.header-bg-light .hamburger {
    border-color: rgba(15, 23, 42, 0.16);
}
body.header-bg-light .hamburger span {
    background: #0f172a;
}
@media (max-width: 768px) {
    body.header-bg-light .nav-links {
        background: rgba(255, 255, 255, 0.98);
        border-color: rgba(15, 23, 42, 0.1);
    }
    body.header-bg-light .nav-links a {
        border-bottom-color: rgba(15, 23, 42, 0.08);
    }
}
body.header-bg-dark .site-logo,
body.header-bg-dark .nav-links a,
body.header-bg-dark .header-custom-icon svg,
body.header-bg-dark .header-widget-area * {
    color: #ffffff !important;
}
body.header-bg-dark .hamburger span {
    background: #ffffff;
}

/* ========== HIDE EMPTY WIDGET MESSAGES ========== */
.widget_archive .no-archives,
.widget_categories .no-categories {
    display: none;
}

/* ========== CRITICAL FIX: Roster Table Horizontal Scroll ========== */
body.has-upm-sidebar #sdr-roster-table-container,
body.has-upm-sidebar .sdr-table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
    display: block !important;
}
body.has-upm-sidebar .sdr-roster-table {
    width: auto !important;
    min-width: 100% !important;
    table-layout: auto !important;
}
body.has-upm-sidebar .sdr-roster-table td,
body.has-upm-sidebar .sdr-roster-table th {
    white-space: nowrap !important;
}
body.has-upm-sidebar .sdr-roster-container {
    overflow: visible !important;
    max-width: 100% !important;
}
body.has-upm-sidebar #page-content,
body.has-upm-sidebar .mf-workspace-shell,
body.has-upm-sidebar .site-content,
body.has-upm-sidebar .site-content .full-width {
    overflow: visible !important;
    min-width: 0 !important;
}
body.has-upm-sidebar .site-header,
body.has-upm-sidebar .site-content,
body.has-upm-sidebar .site-footer,
body.has-upm-sidebar .apple-action-bar {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
body.has-upm-sidebar .site-header {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
body.has-upm-sidebar .site-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
body.has-upm-sidebar .site-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

@media (max-width: 768px) {
    .upm-desktop-sidebar { display: none !important; }
    body.has-upm-sidebar > .upm-desktop-sidebar ~ #page-content {
        padding-left: 0 !important;
    }
    #page-content {
        min-height: auto;
        min-width: auto !important;
        overflow: visible !important;
    }
}

/* ==========================================================
   Menu61 Desktop Full-Height Left Rail Integration (with Collapse Toggle)
   ========================================================== */
@media (min-width: 769px) {
    body.has-upm-sidebar > #page-content {
        width: calc(100% - var(--upm-sidebar-width, 265px)) !important;
        max-width: calc(100% - var(--upm-sidebar-width, 265px)) !important;
        margin-left: var(--upm-sidebar-width, 265px) !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }
    body.has-upm-sidebar.upm-sidebar-collapsed > #page-content {
        width: calc(100% - var(--upm-sidebar-collapsed-width, 78px)) !important;
        max-width: calc(100% - var(--upm-sidebar-collapsed-width, 78px)) !important;
        margin-left: var(--upm-sidebar-collapsed-width, 78px) !important;
    }

    body.has-upm-sidebar #upmDesktopSidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        width: var(--upm-sidebar-width, 265px) !important;
        height: auto !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        z-index: 100000 !important;
        box-sizing: border-box !important;
        transition: width 0.25s ease !important;
    }
    body.has-upm-sidebar.upm-sidebar-collapsed #upmDesktopSidebar {
        width: var(--upm-sidebar-collapsed-width, 78px) !important;
    }

    body.has-upm-sidebar #upmDesktopSidebar .upm-desktop-sidebar-inner {
        position: relative !important;
        top: auto !important;
        min-height: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
    }

    body.has-upm-sidebar #page-content > .site-header,
    body.has-upm-sidebar #page-content > .apple-action-bar,
    body.has-upm-sidebar #page-content > .mf-workspace-shell,
    body.has-upm-sidebar #page-content > .site-footer {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 768px) {
    body.has-upm-sidebar > #page-content {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }
}
