/* Définition des couleurs et police */
:root {
    --bg-dark: #121212;
    --bg-card: #1e1117;
    --bordeaux-dark: #4a0d1b;
    --bordeaux-main: #6b1426;
    --bordeaux-light: #942138;
    --bordeaux-bright: #b82d49;
    --text-main: #f5f5f5;
    --text-muted: #bfb0b5;
    --border-color: #521522;
    --font-family: Verdana, sans-serif;
}

.catalogue-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem 5%;
    flex: 1;
}

/* Zone de recherche */
.search-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--bordeaux-bright);
    box-shadow: 0 6px 18px rgba(184, 45, 73, 0.3);
}

/* Grille de couleurs */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* === EFFET FLASH CARD 3D === */
.color-card {
    background-color: transparent;
    perspective: 1000px; /* Donne la perspective 3D */
    cursor: pointer;
    height: 220px; /* Hauteur fixe requise pour l'effet de retournement */
}

/* Le conteneur interne qui va tourner */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

/* Animation au clic (ajout de la classe .is-flipped en JS) */
.color-card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.color-card:hover .card-inner {
    box-shadow: 0 6px 18px rgba(184, 45, 73, 0.5);
}

/* Faces avant et arrière */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* --- FACE AVANT --- */
.card-front {
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
}

.color-swatch {
    height: 120px;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
}

.color-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.color-code {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffd700;
    letter-spacing: 1px;
}

.color-name {
    font-size: 0.95rem;
    color: var(--text-main);
}

/* --- FACE ARRIERE (CONVERSIONS) --- */
.card-back {
    background-color: var(--bordeaux-dark);
    color: var(--text-main);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid var(--bordeaux-bright);
}

.card-back h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #ffd700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    width: 100%;
}

.card-back p {
    margin: 0.5rem 0;
    font-size: 1rem;
    width: 100%;
    text-align: left;
}

.card-back strong {
    color: var(--text-muted);
}

/* Message quand aucun résultat */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 3rem;
    background-color: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
}
