/* ========== RESET SIMPLE ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #050711;
    color: #f5f5f7;
}

/* ========== BACKGROUND GLOBAL ========== */
.app-background {
    min-height: 100vh;
    background:
        radial-gradient(circle at 0% 0%, rgba(76, 81, 191, 0.5), transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(0, 196, 204, 0.5), transparent 50%),
        #050711;
    padding-bottom: 48px;
}

/* ========== TOPBAR / HEADER ========== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    background: rgba(6, 10, 23, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4c51bf, #00c4cc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 0 18px rgba(0, 196, 204, 0.5);
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #ffffff;
}

/* ========== NAVIGATION PRINCIPALE ========== */
.main-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    position: relative;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    text-decoration: none;
    color: #b3b7d4;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 10%;
    bottom: 0;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4c51bf, #00c4cc);
    transition: width 0.2s ease;
}

.nav-link:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active {
    color: #ffffff;
}

.nav-link.active::after {
    width: 80%;
}

/* ========== TOPBAR DROITE ========== */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.balance-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888fb0;
}

.balance-value {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

/* ========== BOUTONS GÉNÉRIQUES ========== */
.btn {
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #4c51bf, #00c4cc);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 196, 204, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(0, 196, 204, 0.6);
}

.btn-outline {
    background: transparent;
    color: #e1e3ff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

/* ========== PROFIL UTILISATEUR ========== */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
}

.logout-link {
    font-size: 11px;
    color: #ff6b81;
    text-decoration: none;
    opacity: 0.9;
}

.logout-link:hover {
    opacity: 1;
}

.avatar-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid rgba(0, 196, 204, 0.6);
    box-shadow: 0 0 16px rgba(0, 196, 204, 0.4);
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== BOUTONS LOGIN / REGISTER ========== */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== CONTENU PRINCIPAL ========== */
.main-content {
    max-width: 1000000px;
    margin: 24px auto 0;
    padding: 0 24px;
}

/* ========== HERO / BANDEAU ========== */
.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px;
    border-radius: 16px;
    background: radial-gradient(circle at 0% 0%, rgba(76, 81, 191, 0.20), transparent 60%),
                radial-gradient(circle at 100% 100%, rgba(0, 196, 204, 0.18), transparent 60%),
                rgba(9, 12, 32, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
    margin-bottom: 32px;
}

.hero-left h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.hero-left p {
    font-size: 13px;
    color: #c1c5e6;
    max-width: 420px;
}

.hero-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.hero-user-card {
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(6, 10, 23, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: right;
}

.hero-user-label {
    font-size: 11px;
    color: #9599c7;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-user-name {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* ========== SECTIONS CATÉGORIES ========== */
.category-section {
    margin-top: 32px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
}

.category-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent);
}

/* ========== GRILLE DES CASES ========== */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}

/* Card de chaque caisse */
.case-card {
    position: relative;
    cursor: pointer;
    border-radius: 16px;
    padding: 10px 10px 12px;
    background: radial-gradient(circle at 0% 0%, rgba(76, 81, 191, 0.20), transparent 55%),
                rgba(9, 12, 32, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.case-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
    border-color: rgba(0, 196, 204, 0.7);
}

/* Image caisse */
.case-image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.06), transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Texte caisse */
.case-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.case-name {
    font-size: 14px;
    font-weight: 500;
}

.case-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.case-price {
    font-size: 14px;
    font-weight: 600;
    color: #00ffc8;
}

.case-open-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #c4c7f0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .topbar {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }

    .topbar-left {
        width: 100%;
        justify-content: space-between;
    }

    .topbar-right {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .main-content {
        padding: 10px;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-right {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .main-nav {
        display: none; /* ou à transformer en menu burger */
    }

    .case-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
