:root {
    /* Palette Dark Mode "Bidify" Style */
    --bg-app: #0d1117;
    /* Fond principal (très sombre) */
    --bg-surface: #161b22;
    /* Fond des cartes / éléments */
    --bg-input: #21262d;
    /* Fond des inputs */

    --primary: #238636;
    /* Vert action (comme GitHub/Bidify 'success') ou Bleu */
    --primary-hover: #2ea043;
    --accent: #1f6feb;
    /* Bleu vivid pour les liens/boutons secondaires */

    --text-main: #f0f6fc;
    /* Blanc cassé pour lisibilité */
    --text-muted: #8b949e;
    /* Gris pour sous-textes */

    --border: #30363d;
    /* Bordures subtiles */
    --radius: 12px;
    /* Arrondis modernes */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    /* Ombres profondes */

    --nav-height: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    /* Supprime le flash bleu sur mobile */
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    padding-bottom: calc(var(--nav-height) + 20px);
    /* Espace pour la navbar mobile */
    padding-top: 60px;
    /* Espace pour le header mobile */
}

/* --- Typographie --- */
h1,
h2,
h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

p {
    color: var(--text-muted);
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* --- Layout Mobile First --- */

/* Header (Logo + Notifications) */
header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(13, 17, 23, 0.95);
    /* Semi-transparent */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(90deg, #1f6feb, #238636);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    white-space: nowrap;
    /* Empêche le retour à la ligne du diamant */
}

/* Cacher éléments sur mobile/desktop selon besoin */
.hidden {
    display: none !important;
}

.desktop-only {
    display: none;
}

/* Cache le logo desktop sur mobile, libère l'espace pour les icônes */
nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    /* Espacement égal */
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    /* Pour iPhone X+ */
}

.nav-links {
    display: flex;
    width: 100%;
    justify-content: center;
    /* Centre les éléments */
    gap: 20px;
    /* Espace fixe et serré entre les icônes */
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    flex: 0 0 auto;
    /* Ne s'étire pas, garde sa largeur naturelle */
    display: flex;
    justify-content: center;
}

.nav-links a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    gap: 4px;
    padding: 8px;
    transition: color 0.2s;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--text-main);
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

/* --- Barre de Recherche (Mobile) --- */
.search-container {
    margin-bottom: 30px;
    /* Espace avec les articles */
    margin-top: 10px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 50px;
    /* Arrondi */
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    outline: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
}

.search-input:focus {
    border-color: var(--accent);
}


/* --- Vues et Sections --- */
.view {
    padding: 15px;
    max-width: 600px;
    /* Centré look app */
    margin: 0 auto;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Cartes Enchères --- */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* 1 colonne sur mobile */
    gap: 20px;
    padding-bottom: 20px;
}

.item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.item-card:active {
    transform: scale(0.98);
    /* Petit effet de clic */
}

.card-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    /* Ratio fixe */
    background: var(--bg-input);
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badges */
.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge-active {
    border: 1px solid var(--primary);
}

.badge-sold {
    border: 1px solid #da3633;
    color: #da3633;
    background: rgba(50, 10, 10, 0.9);
}

.badge-expired {
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
}


.card-body {
    padding: 15px;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-main);
}

.card-price-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.card-seller-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Détail Item --- */
.detail-container {
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.detail-image-box img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: black;
}

.detail-info-box {
    padding: 20px;
}

.big-price {
    font-size: 2.5rem;
    color: var(--accent);
    letter-spacing: -1px;
}

/* --- Formulaires --- */
form {
    background: transparent;
    /* Fond transparent pour se fondre */
    padding: 0;
    box-shadow: none;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 25px;
    /* Augmenté de 15px à 25px pour espacer Email et MDP */
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--accent);
}

/* --- Boutons --- */
button {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: filter 0.2s;
}

button[type="submit"],
.btn-green {
    background: var(--primary);
    color: white;
    margin-top: 20px;
    /* Ajoute de l'espace avant le bouton */
}

button:hover {
    filter: brightness(1.1);
}

.btn-black {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    margin-bottom: 15px;
}

/* --- Notifications --- */
#notifications {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 2000;
    text-align: center;
}

.notification {
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s;
}

.success {
    background: var(--primary);
    color: white;
}

.error {
    background: #da3633;
    color: white;
}


/* --- Desktop (Responsive) --- */
@media (min-width: 768px) {

    /* Navbar passe en haut à gauche ou centrée */
    header-bar {
        display: none;
        /* Cache le header mobile */
    }

    .desktop-only {
        display: block;
        /* Affiche le logo desktop */
    }

    body {
        padding-top: 20px;
        padding-bottom: 20px;
        padding-left: 20px;
        padding-right: 20px;
    }

    nav {
        position: sticky;
        top: 20px;
        width: 100%;
        max-width: 1000px;
        /* Plus large pour accueillir le logo */
        margin: 0 auto 30px auto;
        border-radius: 50px;
        /* Nav flottante style iOS/Mac */
        height: 70px;
        padding: 0 40px;
        justify-content: space-between;
    }

    .nav-links {
        justify-content: flex-end;
        /* Pousse les liens à droite */
        width: auto;
        /* Ne prend plus toute la largeur */
        gap: 30px;
    }

    .nav-links li {
        flex: 0 0 auto;
    }

    .nav-links a {
        flex-direction: row;
        font-size: 1rem;
    }

    .nav-icon {
        margin-right: 8px;
        font-size: 1.1rem;
        margin-bottom: 0;
    }

    /* Espacement barre de recherche */
    .search-container {
        margin-top: 20px;
        margin-bottom: 40px;
        /* Plus d'espace avant la grille */
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        max-width: 1000px;
        margin: 0 auto;
    }

    .detail-container {
        display: flex;
        align-items: flex-start;
        max-width: 1000px;
        margin: 0 auto;
    }
}