/* =========================================
   VARIABLES & RESET
   ========================================= */
:root {
    --bg-body: #111827;
    --bg-feat: rgba(23, 32, 51, 0.6);
    --grad-pri: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    --bg-card: #1e293b;
    --text-white: #ffffff;
    --text-gray: #94a3b8;
    --lime: #d9f99d;
    --yellow: #E4FF3B;
    --rad-lg: 24px;
    --rad-md: 16px;
    --header-box-bg: #2d3748;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
    background: var(--bg-body);
    color: var(--text-white);
    min-height: 100vh;
    font-size: 16px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
}

/* UTILITIES */
.desktop-only,
.desktop-only-flex,
.desktop-only-inline {
    display: flex;
}

.mobile-only,
.mobile-only-flex {
    display: none !important;
}

.wrapper {
    width: 85%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

/* BACKGROUND */
.bg-wrap {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: #0f172a;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
}

.bg-glow-1 {
    width: 300px;
    height: 300px;
    background: #4f46e5;
    top: -50px;
    left: -50px;
}

.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: #0ea5e9;
    bottom: -100px;
    right: -100px;
    opacity: 0.4;
}

/* =========================================
   HEADER
   ========================================= */
header {
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    padding-top: 20px;
    position: relative;
    z-index: 100;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 45px;
}

.header-right,
.nav-menu {
    display: flex;
    align-items: center;
}

.header-right {
    gap: 40px;
}

.nav-menu {
    gap: 35px;
}

.nav-menu a {
    font-weight: 500;
    font-size: 16px;
    color: #ffffff;
}

.nav-menu a:hover {
    color: #60a5fa;
}

.btn-login {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    color: #ffffff;
}

/* User Dropdown Desktop */
.header-user-logged {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.arrow-icon {
    color: white;
    font-size: 14px;
    transition: transform 0.3s;
}

.header-user-logged.active .arrow-icon {
    transform: rotate(180deg);
}

.desktop-user-dropdown {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    width: 280px;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    z-index: 1000;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s;
}

.header-user-logged.active .desktop-user-dropdown {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   MOBILE NAV & MODAL
   ========================================= */
.mobile-btn {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.mobile-btn.active {
    border-color: var(--yellow);
    color: var(--yellow);
}

.mobile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-nav-dropdown {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: absolute;
    top: 75px;
    left: 0;
    width: 240px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: 0.25s;
    z-index: 999;
}

.mobile-nav-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-dropdown a {
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mobile-nav-dropdown a:hover {
    color: var(--lime);
    transform: translateX(5px);
}

/* Mobile User Modal (Compact) */
.mobile-user-modal {
    display: none;
    position: absolute;
    top: 75px;
    right: 16px;
    width: 280px;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    z-index: 1000;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(-10px);
    transition: 0.3s;
}

.mobile-user-modal.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* SHARED STYLES FOR DROPDOWN & MODAL */
.modal-info-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#modal-user-name,
#desktop-dropdown-name {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.gender-icon {
    color: var(--yellow);
    font-size: 14px;
}

.modal-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}

.modal-desc strong {
    color: #cbd5e1;
}

.btn-upgrade-modal {
    width: 100%;
    background: var(--yellow);
    color: black;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.modal-wallet-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: white;
}

.mw-left i {
    margin-right: 8px;
    color: #cbd5e1;
}

.mw-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mw-amount {
    color: var(--yellow);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.coin-symbol {
    background: var(--yellow);
    color: black;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
}

.mw-btn-deposit {
    background: white;
    color: black;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.modal-menu-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-menu-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
}

.modal-menu-links li a:hover {
    color: var(--yellow);
}

.modal-menu-links li a i {
    width: 20px;
    text-align: center;
}

/* =========================================
   MAIN CONTENT
   ========================================= */
main {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.top-section {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
    align-items: stretch;
}

/* Hero Card */
.hero-card {
    background: var(--grad-pri);
    border-radius: var(--rad-lg);
    padding: 60px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.2);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 65%;
    width: 100%;
}

.hero-content h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 24px;
}

.hero-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 35px;
    color: rgba(255, 255, 255, 0.95);
}

.hero-image {
    position: absolute;
    right: -40px;
    bottom: -60px;
    width: 480px;
    z-index: 1;
    pointer-events: none;
}

.hero-image img {
    width: 100%;
}

/* Nút đăng nhập Hero */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--yellow);
    color: black;
    padding: 16px 36px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 20px;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(228, 255, 59, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(228, 255, 59, 0.6);
}

/* Links bên dưới nút đăng nhập */
.hero-links {
    display: flex;
    gap: 25px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.hero-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.hero-links a i {
    color: #ffffff;
}

.hero-links a:hover {
    color: var(--yellow);
    text-decoration: none;
}

.hero-links a:hover i {
    color: var(--yellow);
}

/* -----------------------------------------
   GIAO DIỆN ĐÃ ĐĂNG NHẬP (HERO COMPACT)
   ----------------------------------------- */
.user-dashboard-card {
    width: 100%;
    margin-top: 5px;
}

.logged-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

#hero-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.logged-user-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#hero-user-name-display {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.logged-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    display: flex;
    flex-direction: column;
}

.stat-card-header {
    background: var(--header-box-bg);
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    text-align: center;
}

.stat-card-header.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wallet-amount {
    color: var(--yellow);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.coin-symbol-sm {
    background: var(--yellow);
    color: black;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
}

.stat-btn {
    width: 100%;
    padding: 8px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
}

.btn-lime-full {
    background: var(--yellow);
    color: black;
}

.btn-white-full {
    background: white;
    color: black;
}

.logged-bottom-links {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 0 2px;
}

.logged-bottom-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-weight: 500;
}

.logged-bottom-links a:hover {
    color: var(--yellow);
}

/* Side Cards */
.side-cards {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-item {
    flex: 1;
    border-radius: var(--rad-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: #334155;
}

.card-rophim {
    background: #8c7a6b;
}

.card-bg {
    position: absolute;
    inset: 0;
    width: 65%;
    margin-left: auto;
    background-size: cover;
    background-position: center;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 60%);
    mask-image: linear-gradient(to right, transparent 0%, black 60%);
}

.card-item .content {
    position: relative;
    z-index: 2;
    width: 50%;
    padding-left: 40px;
    text-align: left;
}

.card-logo img {
    height: 50px;
    margin-bottom: 15px;
    object-fit: contain;
}

.card-item .content p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
}

.btn-white {
    background: white;
    color: #0f172a;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Features */
.features-container {
    background: var(--bg-feat);
    border-radius: var(--rad-lg);
    padding: 80px 60px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 80px 60px;
}

.feature-item {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.icon-box i {
    font-size: 32px;
    color: var(--lime);
}

.feature-text h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.feature-text p {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    color: #cbd5e1;
}

/* Footer */
footer {
    padding: 60px 0;
    margin-top: 80px;
    border-top: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    font-size: 15px;
    color: #ffffff;
}

.copyright {
    color: #aeb3c2;
}

.copyright strong {
    color: #ffffff;
}

.footer-links {
    display: flex;
    gap: 40px;
    font-weight: 500;
    color: #ffffff;
}

.footer-links a {
    color: #ffffff;
}

/* =========================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================= */
@media (min-width: 993px) {
    footer {
        flex-direction: row;
        justify-content: space-between;
        padding: 50px 0;
    }

    footer .copyright {
        order: 1;
    }

    footer .footer-links {
        order: 2;
    }
}

@media (max-width: 992px) {

    .desktop-only,
    .desktop-only-flex,
    .desktop-only-inline {
        display: none !important;
    }

    .mobile-only,
    .mobile-only-flex {
        display: flex !important;
    }

    .wrapper {
        width: 100%;
        padding: 0 16px;
    }

    header {
        height: 70px;
        display: grid;
        grid-template-columns: 50px 1fr 50px;
        margin-bottom: 20px;
    }

    .logo {
        justify-content: center;
    }

    .logo img {
        height: 35px;
    }

    .top-section {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero-card {
        background: transparent;
        box-shadow: none;
        padding: 30px 10px;
        text-align: center;
        flex-direction: column;
    }

    .hero-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: normal;
    }

    .hero-content h1 {
        font-size: 28px;
        margin-bottom: 12px;
        text-align: center;
    }

    .hero-content p {
        font-size: 15px;
        margin-bottom: 25px;
        color: #cbd5e1;
        text-align: center;
    }

    .btn-primary {
        width: 100%;
        margin-bottom: 15px;
        font-size: 16px;
    }

    .hero-links {
        width: 100%;
        justify-content: space-between;
        padding: 0 5px;
        font-size: 14px;
    }

    .hero-links a {
        gap: 6px;
    }

    .hero-image {
        display: none;
    }

    .mobile-dark-card {
        background: #111827;
        border-radius: 20px;
        padding: 20px;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .logged-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card-item {
        padding: 40px 20px;
        min-height: 280px;
        justify-content: center;
        text-align: center;
        background: #1a202c;
    }

    .card-bg {
        width: 100%;
        height: 100%;
        opacity: 0.3;
        mask-image: none;
        -webkit-mask-image: none;
    }

    .card-item .content {
        width: 100%;
        padding: 0 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .card-logo {
        margin: 0 auto 20px auto;
    }

    .btn-white {
        width: auto;
        min-width: 180px;
        justify-content: center;
        margin: 0;
    }

    .features-container {
        padding: 50px 30px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .feature-text h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .footer-links {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
        order: 1;
    }

    .copyright {
        order: 2;
        margin-top: 5px;
    }
}