/* ============================
   main.html — National umbrella site
   Extends style.css
   ============================ */

:root {
    --national: #0b3d91;
    --national-deep: #061b45;
    --accent-gold: #c9a227;
    --accent-warm: #e0b83a;
    --soft: #f4f6fb;
}

.is-main .logo-mark.national {
    background: linear-gradient(135deg, var(--national), #3584e4);
    color: #fff;
}

.header-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px var(--s-3);
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand);
    transition: var(--transition);
}
.header-chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (max-width: 900px) { .header-chip { display: none; } }

/* ---------- National hero ---------- */
.national-hero {
    position: relative;
    padding: 70px 0 90px;
    background: radial-gradient(ellipse at top left, #0b3d91 0%, #061b45 60%, #020a24 100%);
    color: #fff;
    overflow: hidden;
}
.national-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.25) 50%, transparent 50%),
        radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,.2) 50%, transparent 50%),
        radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.18) 50%, transparent 50%),
        radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,.22) 50%, transparent 50%);
    background-size: 220px 220px;
    opacity: .6;
    pointer-events: none;
}
.national-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 60px;
    align-items: center;
}
.national-hero-text .hero-tag {
    display: inline-block;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.national-hero-text h1 {
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.15;
    margin-bottom: 18px;
}
.national-hero-text h1 .accent { color: var(--accent-warm); }
.national-hero-text p {
    color: rgba(255,255,255,.82);
    font-size: 1.08rem;
    margin-bottom: 30px;
    max-width: 540px;
}
.national-hero-text .hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Decorative "map" */
.national-hero-map {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 460px;
    margin: 0 auto;
}
.map-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.15);
    animation: spin 40s linear infinite;
}
.map-ring.r2 { inset: 15%; border-color: rgba(255,255,255,.2); animation-duration: 30s; animation-direction: reverse; }
.map-ring.r3 { inset: 30%; border-color: rgba(201,162,39,.35); animation-duration: 20s; }
.map-core {
    position: absolute;
    inset: 42%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-warm));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #061b45;
    font-size: 1.4rem;
    box-shadow: 0 10px 40px rgba(201,162,39,.4);
}
.map-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-warm);
    box-shadow: 0 0 0 var(--s-1) rgba(224,184,58,.25), 0 0 20px rgba(224,184,58,.6);
    transform-origin: center;
    transform:
        translate(-50%, -50%)
        rotate(var(--d))
        translateY(-180px)
        rotate(calc(-1 * var(--d)));
    animation: pulse 2.4s ease-in-out infinite;
}
.map-pin.p2 { animation-delay: .2s; }
.map-pin.p3 { animation-delay: .4s; }
.map-pin.p4 { animation-delay: .6s; }
.map-pin.p5 { animation-delay: .8s; }
.map-pin.p6 { animation-delay: 1.0s; }
.map-pin.p7 { animation-delay: 1.2s; width: 18px; height: 18px; background: #fff; }

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) rotate(var(--d)) translateY(-180px) rotate(calc(-1 * var(--d))) scale(1); }
    50% { transform: translate(-50%, -50%) rotate(var(--d)) translateY(-180px) rotate(calc(-1 * var(--d))) scale(1.4); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
    .national-hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .national-hero-map { max-width: 300px; }
    .map-pin { transform: translate(-50%, -50%) rotate(var(--d)) translateY(-120px) rotate(calc(-1 * var(--d))); }
    @keyframes pulse {
        0%, 100% { transform: translate(-50%, -50%) rotate(var(--d)) translateY(-120px) rotate(calc(-1 * var(--d))) scale(1); }
        50% { transform: translate(-50%, -50%) rotate(var(--d)) translateY(-120px) rotate(calc(-1 * var(--d))) scale(1.4); }
    }
}

/* ---------- Stats strip ---------- */
.stats-strip {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 36px 0;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 calc(-1 * var(--s-1)) 20px rgba(15,23,42,.06);
}
.stats-strip-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--s-5);
    text-align: center;
}
.strip-stat {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    position: relative;
}
.strip-stat:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(-1 * var(--s-3));
    transform: translateY(-50%);
    height: 36px;
    width: 1px;
    background: var(--line);
}
.strip-num {
    font-size: clamp(1.6rem, 2.8vw, 2.4rem);
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -0.02em;
}
.strip-lbl {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}
@media (max-width: 720px) {
    .stats-strip-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .strip-stat:not(:last-child)::after { display: none; }
}

/* ---------- Aimag selector ---------- */
.aimag-selector .section-head { align-items: flex-start; }
.aimag-filter { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.aimag-filter .chip {
    padding: var(--s-2) var(--s-4);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    transition: var(--transition);
}
.aimag-filter .chip.active,
.aimag-filter .chip:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.aimag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-top: var(--s-5);
}
.aimag-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.aimag-chip::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}
.aimag-chip > * { position: relative; z-index: 1; transition: color var(--transition); }
.aimag-chip:hover { border-color: transparent; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.aimag-chip:hover::before { opacity: 1; }
.aimag-chip:hover .aimag-code,
.aimag-chip:hover .aimag-name,
.aimag-chip:hover .aimag-sub { color: #fff; }

.aimag-code {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--brand);
    background: var(--bg-soft);
    padding: 3px var(--s-2);
    border-radius: 6px;
    margin-bottom: 10px;
    transition: var(--transition);
}
.aimag-chip:hover .aimag-code { background: rgba(255,255,255,.2); }

.aimag-name {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.aimag-sub { font-size: 0.78rem; color: var(--muted); }

.aimag-chip.is-ub::after {
    content: "★";
    position: absolute;
    top: 10px;
    right: var(--s-3);
    color: var(--accent-gold);
    font-size: 1rem;
    z-index: 1;
}

/* ---------- News aimag tag ---------- */
.news-aimag-tag {
    position: absolute;
    bottom: var(--s-3);
    left: var(--s-3);
    background: rgba(255,255,255,.95);
    color: var(--brand);
    padding: var(--s-1) 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
}
.news-img { position: relative; }

/* ---------- Lessons ---------- */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: var(--s-5);
}
.lesson-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    transition: var(--transition);
    display: block;
}
.lesson-card:hover { transform: translateY(calc(-1 * var(--s-1))); box-shadow: var(--shadow-lg); border-color: transparent; }
.lesson-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.lesson-thumb i {
    font-size: 2rem;
    opacity: .9;
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,.25);
    backdrop-filter: blur(6px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.lesson-card:hover .lesson-thumb i { background: rgba(255,255,255,.4); transform: scale(1.1); }
.lesson-dur {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,.65);
    color: #fff;
    padding: 3px var(--s-2);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}
.lesson-body { padding: var(--s-4) 18px 18px; }
.lesson-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--s-2);
}
.lesson-body h4 {
    font-size: 1rem;
    line-height: 1.35;
    margin-bottom: 10px;
    color: var(--text);
}
.lesson-meta {
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ---------- Funds / Experience ---------- */
.funds-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.fund-col {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 30px;
}
.fund-col.accent-col {
    background: linear-gradient(140deg, var(--national-deep), var(--brand));
    color: #fff;
    border-color: transparent;
}
.fund-col.accent-col h3,
.fund-col.accent-col h4,
.fund-col.accent-col p { color: #fff; }
.fund-col.accent-col p { color: rgba(255,255,255,.75); }

.fund-head { margin-bottom: 20px; }
.fund-list, .experience-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.fund-list li { list-style: none; }
.fund-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 14px;
    padding: 10px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
}
.fund-row:hover {
    background: #fff;
    box-shadow: var(--shadow-sm);
    border-left-color: var(--c-brand);
}
.fund-thumb {
    width: 72px;
    height: 56px;
    background-size: cover;
    background-position: center;
    background-color: var(--c-line);
    flex-shrink: 0;
    border: 1px solid var(--c-line);
}
.fund-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.fund-info { min-width: 0; }
.fund-info h4 { font-size: var(--fs-base); margin-bottom: 2px; color: var(--c-text); }
.fund-info p { font-size: var(--fs-sm); color: var(--muted); }
.fund-arrow {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--c-brand);
    font-size: 0.85rem;
    transition: var(--motion-fast);
}
.fund-row:hover .fund-arrow { transform: translateX(3px); color: var(--c-brand-light); }

.experience-list li { list-style: none; }
.exp-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 14px;
    padding: 10px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--motion-fast);
}
.exp-row:hover {
    background: rgba(255,255,255,.14);
    border-color: var(--c-gold);
    transform: translateX(-2px);
}
.exp-thumb {
    width: 80px;
    height: 72px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    flex-shrink: 0;
}
.exp-info { min-width: 0; }
.exp-info h4 { color: #fff; }
.exp-info p { color: rgba(255,255,255,.75); }
.exp-aimag {
    background: var(--accent-gold);
    color: var(--national-deep);
    padding: var(--s-1) 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    align-self: flex-start;
    flex-shrink: 0;
}
.experience-list h4 { font-size: var(--fs-base); margin-bottom: var(--s-1); }
.experience-list p { font-size: var(--fs-sm); }

@media (max-width: 860px) { .funds-grid { grid-template-columns: 1fr; } }

/* ---------- Dashboard ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: var(--s-5);
    margin-top: var(--s-5);
}
.chart-card, .rank-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--s-5);
}
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.chart-head h4 { font-size: var(--fs-md); }
.chip-sm {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--bg-soft);
    padding: var(--s-1) 10px;
    border-radius: 999px;
}
.chart-bars {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 6px;
    height: 180px;
    align-items: end;
    padding-bottom: var(--s-2);
    border-bottom: 1px solid var(--line);
}
.bar {
    position: relative;
    height: var(--h);
    background: linear-gradient(to top, var(--brand), var(--brand-light));
    border-radius: 6px 6px 0 0;
    transition: var(--transition);
    cursor: default;
}
.bar:hover { background: linear-gradient(to top, var(--accent-gold), var(--accent-warm)); }
.bar span {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
    opacity: 0;
    transition: var(--transition);
}
.bar:hover span { opacity: 1; }
.chart-axis {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 6px;
    margin-top: 10px;
}
.chart-axis span { text-align: center; font-size: 0.72rem; color: var(--muted); }

.rank-card h4 { font-size: var(--fs-md); margin-bottom: 18px; }
.rank-list { display: flex; flex-direction: column; gap: var(--s-3); }
.rank-list li {
    display: grid;
    grid-template-columns: var(--s-5) 110px 1fr 40px;
    gap: 10px;
    align-items: center;
}
.rank-pos {
    width: var(--s-5);
    height: var(--s-5);
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rank-list li:nth-child(1) .rank-pos { background: var(--accent-gold); color: var(--national-deep); }
.rank-list li:nth-child(2) .rank-pos { background: #c0c5cf; color: #1a1f2e; }
.rank-list li:nth-child(3) .rank-pos { background: #d9a86a; color: #fff; }
.rank-name { font-size: 0.9rem; font-weight: 600; }
.rank-bar { height: var(--s-2); background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.rank-fill { display: block; height: 100%; background: linear-gradient(to right, var(--brand), var(--brand-light)); border-radius: 999px; }
.rank-val { text-align: right; font-size: 0.9rem; font-weight: 700; color: var(--brand); }

@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ---------- Forums & Polls ---------- */
.forums-polls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-5);
}
.forum-panel, .poll-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--s-5);
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.see-all-sm {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand);
}

.forum-list { display: flex; flex-direction: column; gap: var(--s-3); }
.forum-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
}
.forum-list li:hover { background: #fff; box-shadow: var(--shadow-sm); border-left: 3px solid var(--brand); padding-left: 11px; }
.forum-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.forum-info { flex: 1; min-width: 0; }
.forum-info h4 { font-size: 0.95rem; margin-bottom: var(--s-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forum-info p { font-size: 0.78rem; color: var(--muted); }
.forum-aimag {
    color: var(--brand);
    font-weight: 700;
}
.forum-count {
    background: var(--brand);
    color: #fff;
    padding: var(--s-1) 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.poll-card { padding: var(--s-1) 0; }
.poll-card h4 { font-size: 1.05rem; line-height: 1.35; margin-bottom: 6px; }
.poll-sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 20px; }
.poll-options { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.poll-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.poll-name { font-size: 0.9rem; font-weight: 600; }
.poll-pct { font-size: 0.9rem; font-weight: 700; color: var(--brand); }
.poll-bar {
    height: 10px;
    background: var(--bg-soft);
    border-radius: 999px;
    overflow: hidden;
}
.poll-fill {
    display: block;
    height: 100%;
    background: linear-gradient(to right, var(--brand), var(--accent-gold));
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(.4,0,.2,1);
}
.btn-block { width: 100%; justify-content: center; }

@media (max-width: 900px) { .forums-polls-grid { grid-template-columns: 1fr; } }
