/* ===================================================================
   NG SKIN GENERATOR - STYLESHEET FINAL V3 + UVCharacter Adjustments
   =================================================================== */

/* --- 1. Variables et Style Global --- */
:root {
    --dark-background: #111214;
    --primary-text: #e0e0e0;
    --card-background: #1a1a24;
    --border-color: #3f4156;
    --accent-blue: #5e72e4;
    --accent-purple: #825ee4;
    --font-main: 'Lato', 'Arial', sans-serif;
}

html {
    font-family: var(--font-main);
    background-color: var(--dark-background);
    color: var(--primary-text);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

main {
    max-width: 850px;
    width: 90%;
    padding: 1em 0 4em 0;
    text-align: center;
}

/* --- 2. Bannière et Typographie --- */
.banniere { margin-bottom: 2em; padding-top: 2em; }
.banniere img { max-width: 350px; height: auto; }

h1 {
    font-size: clamp(2.5rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 0.5em 0;
}

h2 {
    font-size: clamp(1.6rem, 4vw, 2rem);
    color: #fff;
    width: 100%;
    text-align: center;
    margin: 2em 0 1em 0;
}

h3 {
    font-size: 1.3em;
    font-weight: 600;
    color: #aab2e4;
    margin: 0 0 1em 0;
}

p { line-height: 1.6; font-size: 1em; max-width: 600px; margin: 0 auto 1.5em auto; }
a { color: var(--accent-purple); text-decoration: none; font-weight: bold; transition: color 0.3s ease; }
a:hover { color: var(--accent-blue); }

/* --- 3. Formulaire de Recherche --- */
form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 2.5em 0;
}

.form-hint {
    font-size: 0.9em;
    color: #888;
    margin-top: -1.5em; /* Rapproche le texte du formulaire */
    margin-bottom: 2em;
}

input[type="text"] {
    background-color: #1e1e2d;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #ffffff;
    padding: 15px 20px;
    font-size: 1.1em;
    min-width: 280px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(130, 94, 228, 0.5);
}

input[type="submit"] {
    background-image: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.1em;
    padding: 15px 30px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

input[type="submit"]:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(130, 94, 228, 0.4); }

/* --- 4. Section des Résultats --- */
.tab-result {
    margin-top: 2em;
}

/* --- 5. Bannière Publicitaire --- */
.ad-banner-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
}

.ad-banner-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(130, 94, 228, 0.35);
}

.ad-banner {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-purple);
    border-radius: 8px;
    padding: 2em;
    text-align: left;
    margin: 3em 0;
}

.ad-banner h3 { margin-top: 0; color: #fff; font-size: 1.5em; }
.ad-banner p { max-width: 100%; margin-bottom: 1.5em; }

.ad-link {
    display: inline-block;
    background-color: var(--accent-purple);
    color: #fff !important;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.ad-banner-link:hover .ad-link {
    background-color: var(--accent-blue);
}

/* --- 6. Footer --- */
footer { width: 100%; text-align: center; padding: 2em 0; margin-top: auto; font-size: 0.9em; color: #888; }


/* ===================================================================
   7. STYLES ADDITIONNELS (ONGLETS, 3D, UPLOAD, 2D)
   =================================================================== */

/* --- Système d'onglets --- */
.tabs {
    display: flex;
    justify-content: center;
    border-bottom: 2px solid var(--border-color);
    margin: 1em 0 2em 0;
}

.tab-link {
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-text);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    margin-bottom: -2px; /* Pour que la bordure active fusionne avec la bordure du conteneur */
}

.tab-link:hover {
    background-color: var(--card-background);
    color: #fff;
}

.tab-link.active {
    color: #fff;
    border-bottom: 3px solid var(--accent-purple);
}

/* --- Contenu des onglets --- */
.tab-content {
    display: none; /* Caché par défaut */
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Visualiseur 3D (Adapté pour le DIV) --- */
.viewer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5em;
    min-height: 400px; /* Donne une hauteur au conteneur */
    min-width: 300px; /* Donne une largeur au conteneur */
}

/* Le div qui contiendra le canvas généré par uvcharacter.js */
#skin_viewer {
    width: 300px; /* Largeur souhaitée */
    height: 400px; /* Hauteur souhaitée */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-background);
    display: flex; /* Pour centrer un éventuel message d'erreur */
    align-items: center;
    justify-content: center;
}
/* Le canvas créé dynamiquement par three.js */
#skin_viewer canvas {
     max-width: 100%;
     max-height: 100%;
}


/* --- Outil de Conversion --- */
input[type="file"] {
    background-color: #1e1e2d;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #ffffff;
    padding: 15px 20px;
    font-size: 1em;
    cursor: pointer;
    font-family: var(--font-main);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box; /* Assure que le padding ne casse pas la largeur */
    margin-bottom: 1em; /* Espace avant le bouton */
}

input[type="file"]::file-selector-button {
    background-color: var(--accent-purple);
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    margin-right: 15px;
    transition: background-color 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
    background-color: var(--accent-blue);
}

.converter-result img {
    max-width: 128px;
    margin: 1.5em 0;
    image-rendering: pixelated;
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

.error {
    color: #ff5555;
    font-weight: bold;
    background-color: rgba(255, 85, 85, 0.1);
    border: 1px solid #ff5555;
    border-radius: 8px;
    padding: 1em;
    max-width: 600px;
    margin: 1em auto;
}

/* --- STYLES 2D (RÉINTÉGRÉS) --- */
.separator {
    color: #fff;
    font-size: 1.5em;
    margin: 2.5em 0 1em 0; /* Plus d'espace au-dessus */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5em;
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Taille min plus petite */
    gap: 20px;
    margin-top: 2em;
}

.skin-section {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5em; /* Padding réduit */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Aligne en haut */
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skin-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(94, 114, 228, 0.25);
}

.skin-section img {
    max-width: 100%;
    height: auto;
    margin-top: 1em;
    image-rendering: pixelated;
}

/* Style spécifique pour les images de tête (plus petites) */
.skin-section div img {
    max-width: 64px; /* Ajustez si nécessaire */
    margin: 0.5em;
}

/* Bouton de téléchargement (style partagé) */
.download-btn {
    display: inline-block;
    background-image: linear-gradient(90deg, #3c4a9a, #5b3ca1);
    padding: 12px 25px;
    border-radius: 8px;
    color: #fff !important; /* Force la couleur pour être sûr */
    font-weight: bold;
    margin-top: 1.5em;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.download-btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(130, 94, 228, 0.4);
}
