/* MegaMind theme — IBM Plex (professional UI type) */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --mm-font-sans: 'IBM Plex Sans', system-ui, sans-serif;
    --mm-font-display: 'IBM Plex Sans', system-ui, sans-serif;
    --mm-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --mm-text-base: 1.0625rem;
    --mm-text-label: 0.8125rem;
    --mm-line: 1.55;
    --theme-accent: #8b5cf6;
    --theme-btn-from: #8b5cf6;
    --theme-btn-to: #7c3aed;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --menu-primary: var(--theme-accent);
    --card-bg: rgba(30, 41, 59, 0.8);
    --card-border: rgba(148, 163, 184, 0.1);
    --rainbow-gradient: linear-gradient(90deg,
        #ff0000 0%, #ff8000 14%, #ffff00 28%, #80ff00 42%,
        #00ff00 57%, #00ff80 71%, #00ffff 85%, #0080ff 100%
    );
}

body.dark, .dark {
    background: #0f172a !important;
    color: #f8fafc !important;
}

html {
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    font-family: var(--mm-font-sans);
    font-size: var(--mm-text-base);
    line-height: var(--mm-line);
    letter-spacing: -0.011em;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

.font-display,
h1, h2, h3, h4,
.member-shell header h1,
.admin-shell header h1 {
    font-family: var(--mm-font-display);
    letter-spacing: -0.02em;
    font-weight: 600;
}

.font-mono-tech {
    font-family: var(--mm-font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.rainbow-card, .stat-card {
    position: relative;
    background: #1e293b !important;
    color: #f8fafc !important;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.rainbow-card h2, .rainbow-card h3, .rainbow-card p, .rainbow-card span, .rainbow-card a,
.rainbow-card td, .rainbow-card th, .rainbow-card label,
.stat-card h2, .stat-card h3, .stat-card p, .stat-card span, .stat-card a,
.stat-card td, .stat-card th, .stat-card label { color: #f8fafc !important; }

.rainbow-card .text-gray-400, .rainbow-card .text-gray-500, .rainbow-card th,
.stat-card .text-gray-400, .stat-card .text-gray-500, .stat-card th { color: #94a3b8 !important; }

.rainbow-card::before, .stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--rainbow-gradient);
    background-size: 200% 100%;
    animation: rainbow-flow 3s linear infinite;
}

@keyframes rainbow-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.rainbow-card:hover, .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.rainbow-card:hover::before, .stat-card:hover::before {
    animation-duration: 1.5s;
    height: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--theme-btn-from) 0%, var(--theme-btn-to) 100%);
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-family: var(--mm-font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
    color: white !important;
}

@media (prefers-reduced-motion: reduce) {
    .rainbow-card::before, .stat-card::before { animation: none; }
    .rainbow-card:hover, .stat-card:hover { transform: none; }
}

/* Journal panel — shared with admin dashboard */
.neon-input {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 12px;
    color: #f8fafc;
    font-family: var(--mm-font-sans);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    min-height: 2.75rem;
    width: 100%;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.06), inset 0 1px 0 rgba(255,255,255,0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.neon-input:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.15);
}
.label-cyan {
    font-family: var(--mm-font-sans);
    font-size: var(--mm-text-label);
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #67e8f9;
    text-transform: uppercase;
}
.rainbow-card .label-cyan { color: #22d3ee !important; }

/* —— Glass emboss (admin + member side heading menus + buttons; NOT sub-menus) —— */
:root {
    --mm-glass-radius: 50px;
    --mm-glass-bg: linear-gradient(165deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 45%, rgba(0, 0, 0, 0.18) 100%);
    --mm-glass-border: rgba(255, 255, 255, 0.14);
    --mm-glass-emboss:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 6px 14px rgba(0, 0, 0, 0.45),
        0 2px 4px rgba(0, 0, 0, 0.35);
    --mm-glass-emboss-hover:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 8px 18px rgba(0, 0, 0, 0.5),
        0 3px 6px rgba(0, 0, 0, 0.35);
    --mm-glass-emboss-active:
        inset 0 1px 0 rgba(165, 243, 252, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(34, 211, 238, 0.35),
        0 6px 16px rgba(8, 145, 178, 0.25),
        0 4px 10px rgba(0, 0, 0, 0.4);
}

.mm-glass-emboss,
#admin-sidebar .admin-nav-toggle,
#admin-sidebar .admin-logout-btn,
#member-sidebar .member-nav-toggle,
#member-sidebar .member-logout-btn,
#member-sidebar .member-return-btn,
.admin-shell header button,
.admin-shell header a.mm-glass-emboss,
.admin-shell main button[type="submit"],
.admin-shell main button[type="button"]:not(.sr-only),
.admin-shell main .mm-glass-emboss,
.member-shell header a.mm-glass-emboss,
.member-shell main button[type="submit"],
.member-shell main button[type="button"]:not(.sr-only),
.member-shell main .mm-glass-emboss {
    border-radius: var(--mm-glass-radius) !important;
    background-image: var(--mm-glass-bg) !important;
    background-color: rgba(15, 23, 42, 0.55) !important;
    border: 1px solid var(--mm-glass-border) !important;
    box-shadow: var(--mm-glass-emboss) !important;
    backdrop-filter: blur(14px) saturate(1.25);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
    transition: box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

#admin-sidebar .admin-nav-toggle:hover,
#admin-sidebar .admin-logout-btn:hover,
#member-sidebar .member-nav-toggle:hover,
#member-sidebar .member-logout-btn:hover,
#member-sidebar .member-return-btn:hover,
.admin-shell header button:hover,
.admin-shell header a.mm-glass-emboss:hover,
.admin-shell main button[type="submit"]:hover,
.admin-shell main button[type="button"]:not(.sr-only):hover,
.member-shell header a.mm-glass-emboss:hover,
.member-shell main button[type="submit"]:hover,
.member-shell main button[type="button"]:not(.sr-only):hover {
    box-shadow: var(--mm-glass-emboss-hover) !important;
    background-color: rgba(30, 41, 59, 0.72) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
}

#admin-sidebar .admin-nav-toggle,
#member-sidebar .member-nav-toggle {
    color: #94a3b8;
    letter-spacing: 0.06em;
}

#admin-sidebar .admin-nav-toggle[aria-expanded="true"],
#admin-sidebar .admin-nav-toggle.admin-nav-parent-active,
#member-sidebar .member-nav-toggle[aria-expanded="true"],
#member-sidebar .member-nav-toggle.member-nav-parent-active {
    color: #e2e8f0;
    border-color: rgba(34, 211, 238, 0.4) !important;
    box-shadow: var(--mm-glass-emboss-active) !important;
}

#admin-sidebar .admin-logout-btn,
#member-sidebar .member-logout-btn {
    color: #fecaca !important;
    border-color: rgba(244, 63, 94, 0.35) !important;
    background-image: linear-gradient(165deg, rgba(244, 63, 94, 0.18) 0%, rgba(15, 23, 42, 0.55) 60%, rgba(0, 0, 0, 0.2) 100%) !important;
}

#member-sidebar .member-return-btn {
    color: #cffafe !important;
    border-color: rgba(34, 211, 238, 0.4) !important;
}

/* Flat sub-menus — no glass emboss */
#admin-sidebar .admin-nav-sublink,
#member-sidebar .member-nav-sublink {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 8px !important;
}

#admin-sidebar .admin-nav-sublink.admin-nav-sub-active,
#member-sidebar .member-nav-sublink.member-nav-sub-active {
    background: rgba(34, 211, 238, 0.12) !important;
    color: #a5f3fc !important;
}

#admin-sidebar,
#member-sidebar {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.88)) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04), 8px 0 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .mm-glass-emboss,
    #admin-sidebar .admin-nav-toggle,
    #admin-sidebar .admin-logout-btn,
    #member-sidebar .member-nav-toggle,
    #member-sidebar .member-logout-btn,
    #member-sidebar .member-return-btn,
    .admin-shell header button,
    .admin-shell main button[type="submit"],
    .admin-shell main button[type="button"]:not(.sr-only),
    .member-shell main button[type="submit"],
    .member-shell main button[type="button"]:not(.sr-only) {
        transition: none;
    }
}
