:root {
    --lge-primary: #2563eb;
    --lge-primary-dark: #1d4ed8;
    --lge-light-bg: #eff6ff;
    --lge-page-bg: #f8fafc;
    --lge-surface: #ffffff;
    --lge-text: #0f172a;
    --lge-muted: #64748b;
    --lge-border: #e2e8f0;
    --lge-green: #22c55e;
    --lge-orange: #f97316;
    --lge-red: #ef4444;
    --lge-purple: #9333ea;
    --lge-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --lge-radius: 16px;
    --lge-radius-lg: 22px;
    --lge-shell-width: 100%;
    --lge-content-width: 760px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--lge-page-bg);
    color: var(--lge-text);
    font-family: "Cairo", sans-serif;
    direction: rtl;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.learngoegy-app {
    min-height: 100vh;
}

.lge-shell {
    min-height: 100vh;
    padding: 0 0 92px;
}

.lge-header,
.lge-content {
    width: min(100%, var(--lge-shell-width));
    margin: 0 auto;
}

.lge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    background: var(--lge-surface);
    border-bottom: 1px solid var(--lge-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.lge-header-user,
.lge-header-stats,
.lge-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.lge-card__title,
.lge-button,
.lge-header-user__meta strong,
.lge-stat-card__value {
    font-family: "Poppins", "Cairo", sans-serif;
}

.lge-chip {
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    background: #f8fafc;
    border: 1px solid #dbeafe;
    min-width: 54px;
    justify-content: center;
}

.lge-chip--xp {
    color: var(--lge-primary);
}

.lge-chip--streak {
    color: var(--lge-orange);
    border-color: #fed7aa;
    background: #fff7ed;
}

.lge-chip__icon,
.lge-footer-nav__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
}

.lge-chip__icon svg,
.lge-footer-nav__icon svg {
    width: 100%;
    height: 100%;
}

.lge-header-user__meta {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.lge-header-user__meta small {
    color: var(--lge-muted);
}

.lge-header-user__avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--lge-primary);
    color: #fff;
    font-family: "Poppins", "Cairo", sans-serif;
    font-weight: 700;
}

.lge-content {
    width: min(calc(100% - 24px), var(--lge-content-width));
    padding: 28px 0 0;
}

.lge-page {
    display: grid;
    gap: 16px;
}

.lge-card {
    background: var(--lge-surface);
    border-radius: var(--lge-radius-lg);
    border: 1px solid var(--lge-border);
    box-shadow: var(--lge-shadow);
    padding: 20px;
}

.lge-card--soft {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.lge-card__eyebrow {
    color: var(--lge-primary);
    font-weight: 700;
    font-size: 0.85rem;
}

.lge-card__title {
    margin: 10px 0 8px;
    font-size: 1.5rem;
}

.lge-card__text {
    margin: 0;
    color: var(--lge-muted);
    line-height: 1.8;
}

.lge-grid {
    display: grid;
    gap: 14px;
}

.lge-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lge-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lge-button,
.lge-button-secondary,
.lge-button-ghost {
    border: 0;
    border-radius: 18px;
    padding: 15px 18px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lge-button {
    background: var(--lge-primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.lge-button-secondary {
    background: #fff;
    color: var(--lge-primary);
    border: 1px solid var(--lge-border);
}

.lge-button-ghost {
    background: #fff;
    color: var(--lge-muted);
    border: 1px solid var(--lge-border);
}

.lge-button:hover,
.lge-button-secondary:hover,
.lge-button-ghost:hover {
    transform: translateY(-1px);
}

.lge-stat-card {
    padding: 18px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--lge-border);
    box-shadow: var(--lge-shadow);
}

.lge-stat-card__label {
    display: block;
    color: var(--lge-muted);
    margin-bottom: 10px;
}

.lge-stat-card__value {
    font-size: 2rem;
    font-weight: 700;
}

.lge-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--lge-border);
}

.lge-badge.is-locked {
    color: var(--lge-muted);
    opacity: 0.7;
}

.lge-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #edf2f7;
}

.lge-progress__bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--lge-primary);
    transition: width 0.3s ease;
}

.lge-footer-nav {
    position: fixed;
    right: 0;
    left: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 12px max(14px, calc((100vw - var(--lge-content-width)) / 2)) calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--lge-border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.05);
    z-index: 30;
}

.lge-footer-nav__item {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 8px 6px;
    border-radius: 16px;
    color: #94a3b8;
}

.lge-footer-nav__item.is-active {
    color: var(--lge-primary);
}

.lge-footer-nav__icon {
    width: 20px;
    height: 20px;
}

.lge-footer-nav__label {
    font-size: 0.74rem;
    font-weight: 700;
}

.lge-empty-state {
    padding: 26px;
    text-align: center;
    color: var(--lge-muted);
}

body.lge-dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

body.lge-dark-mode .lge-header,
body.lge-dark-mode .lge-card,
body.lge-dark-mode .lge-stat-card,
body.lge-dark-mode .lge-footer-nav,
body.lge-dark-mode .lge-button-secondary,
body.lge-dark-mode .lge-button-ghost {
    background: #111827;
    border-color: #1f2937;
    color: #e2e8f0;
}

body.lge-dark-mode .lge-card__text,
body.lge-dark-mode .lge-stat-card__label,
body.lge-dark-mode .lge-footer-nav__item {
    color: #94a3b8;
}

@media (max-width: 960px) {
    .lge-grid--2,
    .lge-grid--3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .lge-shell {
        padding-bottom: 86px;
    }

    .lge-header {
        padding: 16px 12px;
    }

    .lge-content {
        width: min(calc(100% - 16px), var(--lge-content-width));
        padding-top: 16px;
    }

    .lge-header-user__meta strong {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lge-card {
        padding: 18px;
    }

    .lge-footer-nav {
        padding-right: 4px;
        padding-left: 4px;
    }
}
