/**
 * Tehono Market V5 - FINAL STABLE
 * Design : Dark Cyber, Cartes 3 Étages, Badges Intelligents
 */

 /* =========================================
   0. OVERRIDE GLOBAL DE LA POLICE
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&display=swap');

.th-v3-full-container *,
.th-v3-container *,
.th-studio-card *,
.th-v3-gallery *,
#th-nft-modal-overlay * {
    font-family: 'Montserrat', sans-serif !important;
}

/* =========================================
   1. STRUCTURE & LAYOUT
   ========================================= */
.th-v3-container,
.th-studio-card,
.th-v3-gallery {
    max-width: 100%;
    margin: 0 auto;
    background: transparent;
    color: #ffffff;
    padding: 20px 0;
    font-family: 'Montserrat', system-ui, sans-serif;
}

/* On cache les titres car gérés par les onglets - sauf dans les sections Forge */
.th-studio-card h3:not(.th-forge-section-header h3),
.th-v3-gallery h3 {
    display: none !important;
}
.th-forge-section-header h3 {
    display: block !important;
}

/* Conteneurs Formulaires - bordure sur les DIV parents, pas les FORM */
#th-collection-form,
#th-section-mint,
#th-section-sell,
#th-section-import {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.02);
    padding: 36px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08) !important;
    box-sizing: border-box;
}
/* Les FORM internes n'ont pas de bordure propre */
#th-mint-form,
#th-sell-form {
    max-width: 100%;
    border: none !important;
    padding: 0;
    background: transparent;
}

/* Sections fullwidth (Ventes, Offres) - bordure + padding */
.th-studio-card.th-fullwidth-card {
    background: rgba(255, 255, 255, 0.02) !important;
    padding: 36px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

/* =========================================
   2. FORMULAIRES (Avec Correctif Select)
   ========================================= */
.th-group {
    margin-bottom: 25px;
}

.th-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #b0b0b0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* Inputs & Selects */
.th-group input[type="text"],
.th-group input[type="number"],
.th-group textarea,
.th-group select {
    width: 100%;
    padding: 16px 18px;
    background-color: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #e8e8e8 !important;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.25s ease;
    box-sizing: border-box;
    font-family: inherit;
}
/* Aligner la hauteur des inputs et selects sur une meme ligne */
.th-group input[type="text"],
.th-group input[type="number"],
.th-group select {
    height: 52px;
}

/* Focus */
.th-group input:focus,
.th-group textarea:focus,
.th-group select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.25);
    background-color: rgba(0,0,0,0.45);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.03);
}

/* ✅ CORRECTIF LISTE DÉROULANTE (SELECT) */
.th-group select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23888888%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 18px top 50%;
    background-size: 12px auto;

    /* Force la couleur du texte sélectionné */
    color: #e8e8e8 !important;
    -webkit-text-fill-color: #e8e8e8 !important;
    background-color: rgba(0,0,0,0.35) !important;
}

.th-group select option {
    background: #111116;
    color: #e0e0e0;
    padding: 10px;
}

/* Upload */
input[type="file"] {
    background: rgba(255,255,255,0.02);
    padding: 30px;
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: 12px;
    width: 100%;
    text-align: center;
    color: #999;
    cursor: pointer;
    transition: all 0.3s;
}

input[type="file"]:hover {
    border-color: rgba(255,255,255,0.25);
    color: #ddd;
    background: rgba(255,255,255,0.04);
}

/* =========================================
   3. BOUTONS PRIMAIRES (Mint/Sell)
   ========================================= */
.th-btn-primary,
button[type="submit"] {
    width: 100%;
    padding: 16px;
    background: #fff !important;
    border: none !important;
    border-radius: 10px;
    color: #0a0a0a !important;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
    font-family: 'Montserrat', sans-serif;
}

.th-btn-primary:hover,
button[type="submit"]:hover {
    background: #e0e0e0 !important;
    color: #0a0a0a !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,255,255,0.1);
}

/* Bouton inline (pas pleine largeur) */
.th-btn-inline {
    width: auto !important;
    padding: 12px 28px !important;
    display: inline-block !important;
}

#btn-step-2 {
    background: #fff !important;
    color: #0a0a0a !important;
}

/* Bouton ghost compact (ex: ajouter un trait) */
.th-btn-ghost-sm {
    font-size: 11px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: #ccc;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
}
.th-btn-ghost-sm:hover {
    background: #fff;
    color: #0a0a0a;
    border-color: #fff;
}

/* =========================================
   3b. STRUCTURE SECTION FORGE
   ========================================= */
.th-forge-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.th-forge-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #f0f0f0;
}
.th-forge-badge {
    font-size: 10px;
    background: rgba(255,255,255,0.06);
    padding: 4px 10px;
    border-radius: 6px;
    color: #999;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid rgba(255,255,255,0.06);
}
/* Force le style des selects Forge */
select.th-forge-select,
body select.th-forge-select,
body select#sell-crypto,
body #th-sell-form select#sell-crypto {
    width: 100% !important;
    padding: 16px 18px !important;
    background-color: rgba(0,0,0,0.35) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 10px !important;
    color: #e8e8e8 !important;
    -webkit-text-fill-color: #e8e8e8 !important;
    font-size: 14px !important;
    font-family: 'Montserrat', sans-serif !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    opacity: 1 !important;
    height: auto !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23888888%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px top 50% !important;
    background-size: 10px auto !important;
    box-sizing: border-box !important;
    outline: none !important;
    color-scheme: dark !important;
}
select.th-forge-select option,
body select#sell-crypto option {
    background: #111116 !important;
    color: #e0e0e0 !important;
}

.th-forge-desc {
    color: #888;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

/* =========================================
   4. GALERIE & CARTES (Le Design Validé)
   ========================================= */
.th-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.th-nft-card {
    background: #0a0a0a;
    border-radius: 16px;
    border: 1px solid #1f1f1f;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s, box-shadow 0.3s;
}
/* Garde-fou contre lazy-load tiers qui force display:none sur les cards.
   Le selecteur ID-equivalent (deux classes specifiques) et !important
   battent l'inline style:display=none injecte par le plugin tiers. */
.th-portfolio-container .th-nft-card,
.th-gallery-grid .th-nft-card,
.th-pf-clickable.th-nft-card,
.th-gallery-clickable.th-nft-card {
    display: flex !important;
}

.th-nft-card:hover {
    border-color: #333;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.th-nft-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #000;
    border-bottom: 1px solid #1a1a1a;
}

/* --- BADGES (BULLES) --- */
/* Important : on force l'affichage pour contrer l'ancien code */
.th-nft-badge {
    display: block !important; 
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    z-index: 10;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    text-transform: uppercase;
}

/* VERTE (En Vente) */
.th-badge-green {
    background: rgba(0, 0, 0, 0.85);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.5);
}

/* CYAN (Wallet / Non listé) */
.th-badge-wallet {
    background: rgba(0, 0, 0, 0.85);
    color: #00d2d3; /* Cyan */
    border: 1px solid rgba(0, 210, 211, 0.5);
    box-shadow: 0 0 8px rgba(0, 210, 211, 0.3);
}

/* ROUGE (Épuisé) */
.th-badge-red {
    background: rgba(0, 0, 0, 0.85);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.5);
}

/* --- INFOS & ACTIONS --- */
.th-nft-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.th-nft-name {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Label "Prix Unitaire" avec Ligne Haute */
.th-shop-label {
    font-size: 11px; 
    color: #888; 
    text-transform: uppercase; 
    border-top: 1px solid #222; 
    padding-top: 10px; 
    margin-top: 5px; 
    margin-bottom: 5px; 
    text-align: center;
}

/* Conteneur Prix avec Ligne Basse */
.th-shop-price-container {
    border-bottom: 1px solid #222; 
    padding-bottom: 12px; 
    margin-bottom: 12px; 
    width: 100%; 
    text-align: center;
}

.th-price-eth {
    font-size: 18px; 
    color: #2ecc71; 
    font-weight: 800; 
    display: block; 
    line-height: 1.2;
}

.th-live-xpf {
    font-size: 15px; 
    color: #e0e0e0; 
    font-weight: 700; 
    display: block; 
    margin-top: 4px;
}

/* Zone Actions (Input + Bouton) */
.th-shop-actions-row {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    width: 100%;
}

.th-shop-actions-row input[type="number"] {
    width: 50px !important;
    height: 40px !important;
    background: #111 !important;
    border: 1px solid #333 !important;
    color: #fff !important;
    border-radius: 8px !important;
    text-align: center !important;
    font-weight: bold;
    padding: 0 !important;
    margin: 0 !important;
}

/* BOUTON ACHETER (Electric) */
.th-buy-btn {
    flex: 1;
    height: 40px;
    background: linear-gradient(135deg, #2ecc71, #26de81); 
    color: #000;
    font-weight: 800;
    font-size: 13px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 4px 6px rgba(46, 204, 113, 0.2);
}

.th-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
    filter: brightness(1.1);
}

.th-buy-btn:disabled {
    background: #222 !important;
    color: #555 !important;
    box-shadow: none !important;
    cursor: default;
    transform: none;
    border: 1px solid #333;
}

/* Boutons Delete (Pour Wallet) */
.btn-delete {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-delete:hover {
    background: #e74c3c;
    color: #fff;
}

/* =========================================
   CORRECTIF VISIBILITÉ (Priorité Absolue)
   ========================================= */

/* On utilise "body" devant pour augmenter la priorité du sélecteur */
body select#th-sell-selector,
body select#nft-collection-select{
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;

    color: #e8e8e8 !important;
    background-color: rgba(0,0,0,0.35) !important;
    -webkit-text-fill-color: #e8e8e8 !important;

    opacity: 1 !important;
    height: auto !important;
    padding: 16px 18px !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 10px !important;

    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23888888%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 18px top 50% !important;
    background-size: 12px auto !important;
}

body select#th-sell-selector option,
body select#nft-collection-select option {
    color: #e0e0e0 !important;
    background-color: #111116 !important;
}

/* =========================================
   8. GESTIONNAIRE DE VENTE (SHORTCODE STYLE)
   ========================================= */

/* Le Conteneur global */
#th-manager-container {
    /* Suppression des marges superflues puisque plus de titre */
    margin-top: 0; 
    border: 1px solid rgba(235, 238, 245, 0.14);
    border-radius: 18px;
    background: transparent;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03) inset,
        0 18px 60px rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    width: 100%;
}

/* th-manage-table : styles migrés vers th-unified-table dans th-tables.css */

.btn-action-mini {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    font-family: 'Montserrat', sans-serif;
}

.btn-update {
    background: transparent;
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.12);
}
.btn-update:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}

.btn-cancel {
    background: transparent;
    color: #999;
    border: 1px solid rgba(255,255,255,0.08);
}
.btn-cancel:hover {
    background: rgba(231,76,60,0.08);
    color: #e74c3c;
    border-color: rgba(231,76,60,0.25);
}

/* =========================================
   9. FORMULAIRES PLEINE LARGEUR
   ========================================= */

/* On force les conteneurs à prendre toute la largeur */
.th-studio-card {
    max-width: 100% !important;
    width: 100% !important;
}

/* Optionnel : Si tu veux garder une marge sur les côtés sur mobile */
@media (max-width: 768px) {
    #th-mint-form,
    #th-sell-form {
        padding: 20px !important; /* Un peu moins de padding sur mobile */
    }
}

/* ==========================================================================
   UX PROFIL (Ta'iara Gate) - Édition & Survol
   ========================================================================== */

/* 1. Le Conteneur Principal : On le fond dans le décor (transparent) */
#th-section-profile {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 20px !important;
    margin-bottom: 50px !important;
}

/* 2. L'Avatar : Effet de pulsation au survol (Halo Blanc Pur, Sans Bordure, AVEC ROTATION) */
#th-profile-avatar-img {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: none !important;
}
#th-profile-avatar-img:hover {
    transform: scale(1.05) rotate(5deg) !important;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4) !important;
}

/* 3. L'Icône Appareil Photo : Suppression totale (Désormais géré via le clic sur l'image) */
label[for="th-avatar-upload"] {
    /* Si des résidus de l'icône restent, on s'assure qu'ils sont invisibles */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 4. Le Pseudo : Survol lumineux et animation du crayon */
#th-profile-pseudo-text {
    letter-spacing: 2px;
    transition: all 0.3s ease !important;
}
#th-pseudo-display-mode button {
    opacity: 0.3 !important;
    transition: all 0.3s ease !important;
}
#th-pseudo-display-mode:hover #th-profile-pseudo-text {
    color: #fff !important;
    text-shadow: 0 0 15px rgba(255,255,255,0.15) !important;
}
#th-pseudo-display-mode:hover button {
    opacity: 1 !important;
    transform: scale(1.15) !important;
}

/* 5. Le Champ d'Édition */
#th-user-pseudo {
    background: rgba(0,0,0,0.6) !important;
    border: 1px dashed rgba(255,255,255,0.2) !important;
    transition: all 0.3s ease !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5) !important;
}
#th-user-pseudo:focus {
    border-style: solid !important;
    border-color: rgba(255,255,255,0.4) !important;
    box-shadow: 0 0 15px rgba(255,255,255,0.05), inset 0 2px 5px rgba(0,0,0,0.5) !important;
    background: rgba(0,0,0,0.8) !important;
}

/* 6. L'Adresse du Wallet : Aspect "Badge" cliquable */
#th-profile-wallet-display {
    background: rgba(255,255,255,0.04) !important;
    padding: 6px 12px !important;
    border-radius: 50px !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    letter-spacing: 1px;
    transition: all 0.3s ease !important;
    cursor: pointer;
}
#th-profile-wallet-display:hover {
    background: rgba(255,255,255,0.08) !important;
    box-shadow: 0 0 15px rgba(255,255,255,0.05) !important;
    color: #fff !important;
}

/* =========================================
   BADGES DE RANG (GAMIFICATION)
   ========================================= */

/* Style de base pour tous les badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
    line-height: 1;
}

.rank-badge i {
    margin-right: 6px;
    font-style: normal; /* Pour que l'émoji s'affiche droit */
    font-size: 1.1em;
}

/* --- COULEURS PAR RANG (0 à 15) --- */

/* Rangs Débutants & Terrestres */
.rank-0  { background-color: #FFD700; color: #000; border: 1px solid #e6c200; } /* Fondateur */
.rank-1  { background-color: #8BC34A; } /* Graine */
.rank-2  { background-color: #388E3C; } /* Jeune Pousse */
.rank-3  { background-color: #E67E22; } /* Aventurier */

/* Rangs Maritimes & Artisanat */
.rank-4  { background-color: #795548; } /* Constructeur */
.rank-5  { background-color: #F4A460; color: #2c3e50; } /* Piroguier (Texte sombre pour contraste) */
.rank-6  { background-color: #3498DB; } /* Explorateur */
.rank-7  { background-color: #1ABC9C; } /* Chef de pêche */
.rank-8  { background-color: #2980B9; } /* Navigateur */

/* Rangs Mystiques & Supérieurs */
.rank-9  { background-color: #8E44AD; } /* Cartographe */
.rank-10 { background-color: #FF7F50; } /* Gardien du Récif */
.rank-11 { background-color: #3F51B5; box-shadow: 0 0 10px rgba(63, 81, 181, 0.4); } /* Maître des Étoiles */

/* Rangs Nobles & Anciens */
.rank-12 { background-color: #BDC3C7; color: #2c3e50; } /* Noble (Argent) */
.rank-13 { background-color: #7F8C8D; } /* Ancêtre (Pierre) */
.rank-14 { background-color: #ECF0F1; color: #2c3e50; border: 1px solid #bdc3c7; } /* Esprit de l'Île (Blanc) */
.rank-15 { background-color: #E74C3C; } /* Guerrier (Rouge) */

/* --- RANGS DE PRESTIGE (16 & 17) --- */

/* Rang 16 - Légende de Ta’iara (Noir & Or) */
.rank-16 {
    background: linear-gradient(135deg, #1a1a1a 0%, #434343 100%);
    border: 1px solid #D4AF37;
    color: #D4AF37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

/* Rang 17 - Arbre de la Vie Éternelle (Émeraude Pulsant) */
.rank-17 {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
    border: 1px solid #2ecc71;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* =========================================
   WIDGET PROGRESSION (SHORTCODE)
   ========================================= */

.th-rank-widget {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 20px;
    /* Animation d'apparition */
    animation: fadeInRank 0.5s ease-out;
}

@keyframes fadeInRank {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Style Pro pour le badge de stock dans le Marché */
.th-detail-stock-badge {
    background: #000000 !important; /* Fond noir pur */
    color: #2ecc71 !important;    /* Texte en vert Ta'iara pour le contraste */
    border: 1px solid rgba(255, 255, 255, 0.15); /* Bordure discrète */
    padding: 4px 10px;
    border-radius: 4px;            /* Coins légèrement arrondis style "Pro" */
    font-weight: 900;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);    /* Effet de transparence si l'image bouge dessous */
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* ==========================================================================
   📱 OPTIMISATIONS MOBILE GLOBALES (SMARTPHONE & TABLETTE)
   ========================================================================== */
@media (max-width: 768px) {
    
    /* 1. ESPACES ET CONTENEURS (Moins de marges pour gagner de la place) */
    .th-v3-container,
    .th-studio-card,
    #th-collection-form,
    #th-mint-form,
    #th-sell-form {
        padding: 15px !important;
        border-radius: 16px !important;
    }

    /* 2. PROFIL (Avatar et Pseudo) : On empile au centre */
    #th-section-profile > div {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
    }
    #th-section-profile > div > div:nth-child(2) {
        align-items: center !important;
        width: 100% !important;
    }
    #th-pseudo-display-mode, 
    #th-pseudo-edit-mode {
        justify-content: center !important;
        width: 100% !important;
    }

    /* 3. MISSIONS ET ACCÈS RAPIDES : Une seule colonne fluide */
    .th-missions-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .th-mission-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
        padding: 15px !important;
    }
    .th-mission-action {
        width: 100% !important;
        display: flex !important;
        justify-content: flex-end !important;
    }

    /* 4. FORMULAIRES DE CRÉATION (Mint / Vente) : Les champs s'empilent */
    .th-studio-card > div[style*="display:flex"],
    #th-create-col-ui > div[style*="display:flex"],
    #th-mint-form > div[style*="display:flex"],
    #th-sell-form > div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 15px !important;
    }
    .th-group {
        width: 100% !important;
        margin-bottom: 15px !important;
    }

    /* 5. BARRE DE RECHERCHE ET FILTRES GALERIE */
    .th-toolbar {
        max-width: 100% !important;
        border-radius: 16px !important;
        padding: 8px !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        top: 0 !important;
    }
    .th-toolbar .th-search-wrap {
        flex: 1 1 100% !important;
    }
    .th-toolbar .th-toolbar-sep { display: none !important; }
    .th-toolbar .th-filter-select { flex: 1; min-width: 0; }

    /* 6. TABLEAUX D'HISTORIQUE (Scroll horizontal forcé) */
    #th-section-activity > div[style*="overflow-x:auto"] {
        border-radius: 8px !important;
        padding-bottom: 10px !important;
    }

    .th-table-responsive-wrapper table { min-width: 600px !important; }
    .th-mobile-full-width { width: 100% !important; flex: none !important; margin-bottom: 10px; }
}
/* =========================================
   COMPOSANTS HARMONISÉS - Toolbar Unifiée
   ========================================= */

/* Le conteneur toolbar - centré, compact, bordure unique */
.th-toolbar {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 auto 30px auto;
    max-width: 780px;
    width: 100%;
    background: rgba(11, 11, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 6px 8px;
    box-sizing: border-box;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 10px;
    z-index: 100;
}

/* Le champ de recherche - pilule intégrée à gauche */
.th-toolbar .th-search-unified {
    flex: 1;
    min-width: 0;
    max-width: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 9px 16px 9px 38px;
    border-radius: 50px;
    outline: none;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.25s ease, background 0.25s ease;
    box-sizing: border-box;
}
.th-toolbar .th-search-unified:focus {
    border-color: #2ecc71;
    background: rgba(255, 255, 255, 0.08);
}
.th-toolbar .th-search-unified::placeholder {
    color: #555;
    font-weight: 500;
}

/* Icône loupe positionnée dans le champ */
.th-search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.th-search-wrap::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 2;
}

/* Le select de tri - discret, fondu dans la barre */
.th-toolbar .th-filter-select {
    background: transparent;
    border: none;
    color: #999;
    padding: 8px 12px;
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 20px;
    white-space: nowrap;
}
.th-toolbar .th-filter-select:hover,
.th-toolbar .th-filter-select:focus {
    color: #fff;
}
.th-toolbar .th-filter-select option {
    background: #111;
    color: #ccc;
}

/* Séparateur vertical subtil */
.th-toolbar-sep {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Toggle Grille/Liste - icônes compactes */
.th-toolbar .th-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    color: #555;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.th-toolbar .th-view-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.th-toolbar .th-view-toggle.active {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

/* Le bouton clear (croix) dans la recherche */
.th-search-wrap .th-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s;
}
.th-search-wrap .th-clear-btn:hover {
    background: rgba(231, 76, 60, 0.3);
}

/* Responsive */
@media (max-width: 640px) {
    .th-toolbar {
        max-width: 100%;
        border-radius: 16px;
        padding: 8px;
        flex-wrap: wrap;
        gap: 6px;
        top: 0;
    }
    .th-search-wrap {
        flex: 1 1 100%;
    }
    .th-toolbar .th-filter-select {
        flex: 1;
        min-width: 0;
    }
    .th-toolbar-sep { display: none; }
}

/* =========================================
   LEGACY - compatibilité existante
   ========================================= */

/* Toggle Grille/Liste hors toolbar */
.th-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    color: #666;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.th-view-toggle:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
}
.th-view-toggle.active {
    background: #2ecc71;
    color: #000;
    border-color: #2ecc71;
}

/* Barre de recherche unifiée hors toolbar */
.th-search-unified {
    width: 100%;
    max-width: 380px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    outline: none;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}
.th-search-unified:focus {
    border-color: #2ecc71;
}
.th-search-unified::placeholder {
    color: #666;
}


/* =========================================
   9. BOUTON DÉPÔT HARMONISÉ (Sanctuaire)
   ========================================= */
.th-deposit-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 5px 12px !important;
    font-size: 9px !important;
    background: transparent !important;
    border: 1px solid #ff0099 !important;
    border-radius: 6px !important;
    color: #ff0099 !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.25s ease !important;
    font-family: 'Outfit', sans-serif !important;
    letter-spacing: 0.8px;
    box-shadow: none !important;
    height: 28px;
    white-space: nowrap;
}

.th-deposit-btn:hover {
    background: linear-gradient(135deg, #ff0099, #cc0077) !important;
    color: #fff !important;
    box-shadow: 0 5px 20px rgba(255,0,153,0.5) !important;
    border: 1px solid #ff0099 !important;
    transform: none !important;
    opacity: 1 !important;
}

/* =========================================
   BOUTON FERMETURE MODALE - Style unifié partout
   Couvre toutes les classes/IDs de croix "fermer une fenetre" du site :
   modales NFT, offre, feedback, vip, help 3D, profil pro, viewer creator.
   Toutes les proprietes en !important + selecteurs larges pour battre tout
   override (theme Astra, styles inline, CSS des plugins).
   ========================================= */
.th-modal-close,
button.th-modal-close,
.help-close-top,
button.help-close-top,
.help-close,
button.help-close,
.th-fb-modal-close,
button.th-fb-modal-close,
#th-vip-modal-close,
#th-offer-close,
.th-close-btn,
button.th-close-btn {
    position: absolute !important;
    top: 14px !important; right: 14px !important;
    width: 32px !important; height: 32px !important;
    min-width: 32px !important; min-height: 32px !important;
    max-width: 32px !important; max-height: 32px !important;
    padding: 0 !important; margin: 0 !important;
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    z-index: 50 !important;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    text-decoration: none !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
}
.th-modal-close:hover,
button.th-modal-close:hover,
.help-close-top:hover,
button.help-close-top:hover,
.help-close:hover,
button.help-close:hover,
.th-fb-modal-close:hover,
button.th-fb-modal-close:hover,
#th-vip-modal-close:hover,
#th-offer-close:hover,
.th-close-btn:hover,
button.th-close-btn:hover {
    background: rgba(231,76,60,0.85) !important;
    border-color: #e74c3c !important;
    color: #fff !important;
    transform: none !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* ═══ MODALE NFT - Responsive ═══ */
@media (max-width: 768px) {
    #th-nft-modal-overlay {
        padding: 10px !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
    }
    #th-nft-modal-overlay .th-modal-glass {
        flex-direction: column !important;
        max-width: 100% !important;
        max-height: none !important;
        border-radius: 16px !important;
        margin: 10px 0 !important;
    }
    /* Image - carré compact en haut */
    #th-nft-modal-overlay .th-modal-glass > div:first-child {
        padding: 16px !important;
        max-height: 50vh !important;
    }
    #th-nft-modal-overlay .th-modal-glass > div:first-child img,
    #th-nft-modal-overlay .th-modal-glass > div:first-child video {
        max-height: 45vh !important;
        border-radius: 10px !important;
    }
    /* Infos - sous l'image */
    #th-nft-modal-overlay .th-modal-glass > div:nth-child(3) {
        padding: 20px 16px !important;
    }
    #th-nft-modal-overlay .th-modal-glass h2 {
        font-size: 18px !important;
        padding-right: 0 !important;
    }
    /* Close button */
    #th-nft-modal-overlay .th-modal-close {
        top: 8px !important;
        right: 8px !important;
    }
}

@media (max-width: 480px) {
    #th-nft-modal-overlay .th-modal-glass > div:first-child {
        padding: 12px !important;
        max-height: 40vh !important;
    }
    #th-nft-modal-overlay .th-modal-glass > div:nth-child(3) {
        padding: 16px 12px !important;
    }
    #th-nft-modal-overlay .th-modal-glass h2 {
        font-size: 16px !important;
    }
}

/* ═══════════════════════════════════════════════
   🔧 RESPONSIVE PATCH V2 - Market Style (Galerie NFT)
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Éclater Elementor ── */
    .elementor-widget-container:has(.th-v3-gallery),
    .elementor-element:has(.th-v3-gallery),
    .e-con:has(.th-v3-gallery),
    .e-con-inner:has(.th-v3-gallery) {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow-x: clip !important;
    }
    .th-v3-gallery {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 6px !important;
    }

    /* ── Toolbar - 2 lignes : filtres+Sanctum en haut, recherche en bas ── */
    .th-toolbar {
        max-width: 100% !important;
        border-radius: 14px !important;
        padding: 8px !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        top: 0 !important;
        position: sticky !important;
        z-index: 100 !important;
    }
    /* Ligne 1 : filtre + boutons vue + sanctum */
    .th-toolbar .th-filter-select {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        font-size: 11px !important;
        order: 1 !important;
    }
    .th-toolbar .th-view-toggle {
        width: 30px !important;
        height: 30px !important;
        order: 2 !important;
    }
    .th-sanctum-btn,
    #btn-gallery-sanctum {
        font-size: 9px !important;
        padding: 0 10px !important;
        height: 30px !important;
        order: 3 !important;
        flex-shrink: 0 !important;
    }
    /* Séparateurs inline cachés */
    .th-toolbar-sep,
    .th-toolbar > div[style*="width:1px"] {
        display: none !important;
    }
    /* Ligne 2 : recherche pleine largeur en bas */
    .th-search-wrap {
        flex-basis: 100% !important;
        width: 100% !important;
        order: 10 !important;
        min-width: 0 !important;
    }

    /* ── NFT Grid - 2 colonnes, miniatures réduites ── */
    .th-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 8px 0 !important;
    }

    /* ── NFT Card - miniatures moins grandes sur tablette ── */
    .th-nft-card {
        border-radius: 12px !important;
    }
    .th-nft-card img,
    .th-nft-card video {
        aspect-ratio: 1/1 !important;
        max-height: 180px !important;
    }
    .th-nft-info {
        padding: 10px 8px !important;
        gap: 4px !important;
    }
    .th-nft-name { font-size: 12px !important; }
    .th-shop-label { font-size: 8px !important; }
    .th-price-eth { font-size: 14px !important; }
    .th-live-xpf { font-size: 11px !important; }

    /* Boutons acheter/offre */
    .th-shop-actions-row {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    .th-buy-btn {
        font-size: 10px !important;
        padding: 6px 8px !important;
    }
    .th-qty-input {
        width: 32px !important;
        font-size: 11px !important;
        padding: 4px !important;
    }
    .th-offer-btn {
        font-size: 9px !important;
        padding: 5px 6px !important;
    }

    /* Badges stock */
    .th-nft-badge,
    .th-detail-stock-badge {
        font-size: 8px !important;
        padding: 2px 6px !important;
        top: 6px !important;
        right: 6px !important;
    }

    /* Creator row */
    .th-nft-creator { font-size: 10px !important; }
    .th-nft-creator img { width: 16px !important; height: 16px !important; }

    /* Rank badges */
    .rank-badge { font-size: 0.7rem !important; padding: 2px 6px !important; }
    #th-manager-container { border-radius: 12px !important; }
}

@media (max-width: 480px) {

    .th-v3-gallery { padding: 0 4px !important; }

    /* Grid */
    .th-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    /* Miniatures encore plus petites */
    .th-nft-card img,
    .th-nft-card video {
        max-height: 140px !important;
    }

    /* Nft info */
    .th-nft-info { padding: 8px 6px !important; }
    .th-nft-name { font-size: 11px !important; }
    .th-price-eth { font-size: 13px !important; }
    .th-live-xpf { font-size: 10px !important; }

    /* Boutons */
    .th-buy-btn { font-size: 9px !important; padding: 5px 6px !important; }
    .th-qty-input { width: 28px !important; height: 26px !important; font-size: 10px !important; }
    .th-offer-btn { font-size: 8px !important; }

    /* Toolbar */
    .th-toolbar {
        border-radius: 12px !important;
        padding: 6px !important;
    }
    .th-toolbar .th-search-unified {
        font-size: 12px !important;
        padding: 7px 10px 7px 32px !important;
    }
    .th-toolbar .th-filter-select { font-size: 10px !important; }
    .th-sanctum-btn,
    #btn-gallery-sanctum {
        font-size: 8px !important;
        padding: 0 8px !important;
        height: 28px !important;
        letter-spacing: 0.5px !important;
    }

    /* Forms */
    #th-collection-form,
    #th-mint-form,
    #th-sell-form {
        padding: 14px !important;
        border-radius: 14px !important;
    }
    .th-group label { font-size: 11px !important; }
    .th-group input[type="text"],
    .th-group input[type="number"],
    .th-group textarea,
    .th-group select {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 380px) {
    .th-grid { gap: 4px !important; }
    .th-nft-card img, .th-nft-card video { max-height: 120px !important; }
    .th-nft-info { padding: 6px 5px !important; }
    .th-nft-name { font-size: 10px !important; }
    .th-buy-btn { font-size: 8px !important; }
}
