* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --ieee-blue: #00629B;
    --ieee-blue-dark: #004a75;
    --ieee-blue-light: #e6f2f9;
    --ieee-cyan: #00b5e2;
    --text-dark: #1a1a1a;
    --text-body: #333333;
    --text-muted: #666666;
    --bg-white: #ffffff;
    --border: #dce4ea;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.14);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-white);
    color: var(--text-body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ===== TOP UTILITY BAR with marquee ===== */
.top-bar {
    background: var(--ieee-blue);
    color: #fff;
    font-size: 0.78rem;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    letter-spacing: 0.3px;
}

.top-bar-left {
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.72rem;
}

.top-bar-left::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

.marquee-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 96%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 96%, transparent 100%);
}

.marquee-track {
    display: inline-flex;
    white-space: nowrap;
    animation: scroll-left 35s linear infinite;
    will-change: transform;
}

.marquee-track span {
    padding-right: 4rem;
    color: rgba(255,255,255,0.95);
    font-weight: 500;
}

.marquee-track span::before {
    content: '📢';
    margin-right: 0.6rem;
    font-size: 0.85rem;
}

@keyframes scroll-left {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-wrap:hover .marquee-track {
    animation-play-state: paused;
}

.top-bar-links {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.top-bar-links a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

.top-bar-links a:hover { color: #fff; }

/* ===== NAVIGATION ===== */
nav {
    position: sticky;
    top: 0;
    width: 100%;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    padding: 0 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--ieee-blue);
    text-decoration: none;
    letter-spacing: -0.3px;
    flex-shrink: 0;
}

.nav-logo .logo-mark {
    width: 36px;
    height: 36px;
    background: var(--ieee-blue);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
}

/* ===== NAV MENU ===== */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.55rem 0.85rem;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
}

.nav-item > a:hover,
.nav-item.active > a {
    color: var(--ieee-blue);
    background: var(--ieee-blue-light);
}

.nav-item .chevron {
    font-size: 0.6rem;
    transition: transform 0.25s;
    color: var(--text-muted);
    display: inline-block;
    line-height: 1;
}

.nav-item:hover .chevron,
.nav-item.open .chevron {
    transform: rotate(180deg);
    color: var(--ieee-blue);
}

/* ===== DROPDOWN ===== */
.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
}

.nav-item:hover .dropdown,
.nav-item.open .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.dropdown li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.65rem 0.9rem;
    border-radius: 7px;
    transition: all 0.18s;
    white-space: nowrap;
}

.dropdown li a:hover {
    background: var(--ieee-blue-light);
    color: var(--ieee-blue);
    padding-left: 1.1rem;
}

.dropdown li a::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ieee-blue);
    opacity: 0;
    transition: opacity 0.18s;
}

.dropdown li a:hover::before {
    opacity: 1;
}

/* ===== MOBILE TOGGLE ===== */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1150px) {
    .nav-item > a { padding: 0.55rem 0.6rem; font-size: 0.82rem; }
}

@media (max-width: 1024px) {
    .nav-container { padding: 0 1.25rem; }

    .mobile-toggle { display: block; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 1rem 1.25rem;
        gap: 0.15rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }

    .nav-menu.open { display: flex; }

    .nav-item { position: static; }

    .nav-item > a {
        display: flex;
        justify-content: space-between;
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    /* Mobile accordion dropdowns */
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--border);
        border-radius: 0;
        padding: 0 0 0 1rem;
        margin: 0.25rem 0 0.5rem 1rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, margin 0.3s ease;
    }

    .nav-item.open .dropdown {
        max-height: 500px;
        margin: 0.25rem 0 0.75rem 1rem;
    }

    .nav-item:hover .dropdown {
        max-height: 0;
        margin: 0.25rem 0 0.5rem 1rem;
    }

    .nav-item.open:hover .dropdown {
        max-height: 500px;
        margin: 0.25rem 0 0.75rem 1rem;
    }

    .dropdown li a {
        padding: 0.65rem 0.9rem;
        font-size: 0.85rem;
    }

    .dropdown li a:hover { padding-left: 1.1rem; }
}

@media (max-width: 780px) {
    .top-bar { padding: 0.5rem 1rem; font-size: 0.72rem; }
    .top-bar-links { gap: 1rem; }
}

@media (max-width: 520px) {
    .top-bar-left { display: none; }
    .top-bar-links a:first-child { display: none; }
    .nav-logo { font-size: 1.1rem; }
    .nav-logo .logo-mark { width: 32px; height: 32px; font-size: 0.8rem; }
}

/* Anchored sections clear the sticky nav */
[id] { scroll-margin-top: 80px; }

/* ===== Mode-of-presentation notice (shared, high visibility) ===== */
.mode-notice-wrap { background: #fff8e6; padding: 1.75rem 1.5rem; border-bottom: 1px solid #f3dca0; }
.mode-notice-wrap .mode-notice { max-width: 1100px; margin: 0 auto; }
.mode-notice {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #fff8e6;
    border: 2px solid #d32f2f;
    border-left-width: 8px;
    border-radius: 12px;
    padding: 1.1rem 1.4rem;
    margin: 1.5rem 0;
    color: #3b1a00;
    box-shadow: 0 4px 14px rgba(211, 47, 47, 0.12);
    text-align: left;
}
.mode-notice-icon {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: #d32f2f;
    color: #fff;
    font-weight: 800;
    font-size: 1.4rem;
    line-height: 2.4rem;
    text-align: center;
}
.mode-notice h3 { font-size: 1.15rem; font-weight: 800; color: #b71c1c; margin-bottom: 0.4rem; line-height: 1.3; }
.mode-notice ul { margin: 0; padding-left: 1.2rem; }
.mode-notice li { font-size: 1rem; line-height: 1.55; margin: 0.2rem 0; }
.mode-notice p { font-size: 0.98rem; line-height: 1.55; margin: 0; }
.mode-notice strong { color: #b71c1c; }
.mode-notice.compact { padding: 0.8rem 1.1rem; margin: 1.25rem 0; }
.mode-notice.compact .mode-notice-icon { width: 1.9rem; height: 1.9rem; line-height: 1.9rem; font-size: 1.1rem; }
@media (max-width: 520px) {
    .mode-notice { padding: 0.9rem 1rem; gap: 0.7rem; border-left-width: 6px; }
    .mode-notice-icon { width: 1.9rem; height: 1.9rem; line-height: 1.9rem; font-size: 1.1rem; }
    .mode-notice h3 { font-size: 1.02rem; }
    .mode-notice li { font-size: 0.95rem; }
    .mode-notice-wrap { padding: 1.25rem 1rem; }
}

/* IEEE tag in the header */
.nav-logo .ieee-tag { display: flex; align-items: center; gap: 0.45rem; margin-left: 0.35rem; padding-left: 0.75rem; border-left: 1px solid #d0d7de; }
.nav-logo .ieee-mark { height: 26px; width: auto; display: block; }
.nav-logo .ieee-approval { font-size: 0.7rem; font-weight: 700; color: #b45309; letter-spacing: 0; white-space: nowrap; }
@media (max-width: 600px) {
    .nav-logo { font-size: 1rem; gap: 0.4rem; }
    .nav-logo .ieee-tag { margin-left: 0.1rem; padding-left: 0.45rem; gap: 0.3rem; }
    .nav-logo .ieee-mark { height: 18px; }
    .nav-logo .ieee-approval { font-size: 0.55rem; line-height: 1.15; white-space: normal; max-width: 4.2rem; }
}

/* Important note (fraud warning) */
.important-note-wrap { background: #fff; padding: 1.5rem 1.5rem 0; }
.important-note-wrap .important-note { max-width: 1100px; margin: 0 auto; }
.important-note { display: flex; gap: 1rem; align-items: flex-start; background: #fdecea; border: 2px solid #c62828; border-radius: 10px; padding: 1.1rem 1.25rem; text-align: left; }
.important-note-icon { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: #c62828; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.important-note h3 { margin: 0 0 0.4rem; font-size: 1.1rem; color: #8e1b1b; }
.important-note ul { margin: 0; padding-left: 1.1rem; color: #3a1a1a; line-height: 1.55; font-size: 0.97rem; }
.important-note li + li { margin-top: 0.3rem; }
.important-note a { color: #8e1b1b; font-weight: 700; word-break: break-word; }
@media (max-width: 600px) { .important-note { padding: 0.9rem; gap: 0.7rem; } .important-note ul { font-size: 0.92rem; } }
