/**
 * Tehono Market - External Import (V6 Pro Studio Style)
 */

/* Badge Réseau */
.th-network-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);
}

/* Forge structure (contexte Import) */
.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;
    font-family: 'Montserrat', sans-serif;
}
.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);
}
.th-forge-desc {
    color: #888;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 24px 0;
    font-family: 'Montserrat', sans-serif;
}

/* Bouton primaire (contexte Import) */
#th-section-import .th-btn-primary {
    padding: 12px 28px;
    background: #fff;
    border: none;
    border-radius: 10px;
    color: #0a0a0a;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
    display: inline-block;
    width: auto;
}
#th-section-import .th-btn-primary:hover {
    background: #e8e8e8;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,255,255,0.1);
}
#th-section-import .th-btn-primary:disabled {
    background: #333;
    color: #888;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

/* Grille */
#th-external-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

/* Cartes NFT */
.th-ext-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.th-ext-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Image */
.th-ext-img-box {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #000;
}

.th-ext-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.th-ext-card:hover .th-ext-img-box img {
    transform: scale(1.08);
}

/* Infos */
.th-ext-info {
    margin-bottom: 12px;
}

.th-ext-info strong {
    display: block;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.th-ext-info small {
    color: #cccccc !important;
    font-size: 11px !important;
    text-transform: uppercase;
}

/* Sélecteur Quantité */
.th-qty-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    margin-bottom: 12px;
    color: #ffffff !important;
}

/* Input Quantité */
.th-import-qty {
    width: 50px !important;
    height: 28px !important;
    background: #050505 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 12px !important;
    padding: 0 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}

.th-import-qty:focus {
    outline: none;
    border-color: rgba(255,255,255,0.3) !important;
}

.th-import-qty::-webkit-outer-spin-button,
.th-import-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.th-import-qty[type=number] {
    -moz-appearance: textfield;
}

/* Bouton Importer */
.th-btn-import {
    width: 100%;
    padding: 10px 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ccc !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

.th-btn-import:hover:not(:disabled) {
    background: #fff !important;
    color: #0a0a0a !important;
    border-color: #fff !important;
}

.th-btn-import:disabled {
    background: rgba(0, 0, 0, 0.4) !important;
    color: #888888 !important;
    border-color: #333333 !important;
    cursor: wait;
}

/* Bouton Mise à Jour (Nouveaux exemplaires détectés) */
.th-btn-update {
    color: #ccc !important;
    border-color: rgba(255,255,255,0.12) !important;
}

.th-btn-update:hover:not(:disabled) {
    background: #fff !important;
    color: #0a0a0a !important;
    border-color: #fff !important;
}

/* Bouton Déjà Importé */
.th-btn-imported {
    width: 100%;
    padding: 8px 0;
    background: transparent !important;
    border: 1px dashed rgba(255, 255, 255, 0.15) !important;
    color: #888888 !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    border-radius: 8px;
    cursor: not-allowed;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0.5;
}

/* États */
#th-scan-error {
    display: none;
}

.th-empty-msg {
    text-align: center;
    color: #aaaaaa !important;
    padding: 40px;
    grid-column: 1 / -1;
    font-style: italic;
    font-size: 13px;
}

.th-loading {
    text-align: center;
    color: #cccccc !important;
    padding: 40px;
    grid-column: 1 / -1;
    animation: th-pulse 1.5s infinite;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes th-pulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
        color: #fff;
    }

    100% {
        opacity: 0.3;
    }
}
/* ═══════════════════════════════════════════════
   🔧 RESPONSIVE PATCH — External Import
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    #th-external-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 480px) {
    #th-external-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .th-ext-card { padding: 8px !important; border-radius: 12px !important; }
    .th-ext-img-box { border-radius: 8px !important; margin-bottom: 8px !important; }
    .th-ext-info strong { font-size: 12px !important; }
    .th-ext-info small { font-size: 10px !important; }
    .th-qty-selector { padding-top: 8px !important; font-size: 11px !important; }
    .th-btn-import { padding: 8px 0 !important; font-size: 10px !important; }
    .th-network-badge { font-size: 9px !important; padding: 4px 8px !important; }
}

@media (max-width: 380px) {
    #th-external-grid {
        gap: 6px !important;
    }
    .th-ext-card { padding: 6px !important; }
    .th-ext-info strong { font-size: 11px !important; }
}
