:root {
    /* Les couleurs sont injectées dynamiquement depuis le serveur */
    /* Plus besoin de couleurs de fallback */
}

/* Plus besoin de gestion du chargement - couleurs injectées directement */



/* ========== BOUTON MODAL PALETTE DE COULEURS ========== */


/* Popup de la palette (en bas à droite) */
.color-palette-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
    backdrop-filter: blur(3px);
}

.color-palette-content {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 0;
    border-radius: 20px;
    width: 420px;
    max-height: calc(100vh - 40px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideInRight 0.3s ease-out;
    overflow: visible;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* En-tête du modal */
.color-palette-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.color-palette-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.color-palette-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-edit-toggle {
    position: absolute;
    top: 15px;
    right: 60px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-edit-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Sélecteur de couleur intégré dans les contrôles */
.color-picker-integrated {
    width: 60px;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: none;
}

.color-picker-integrated:hover {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.color-picker-integrated:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}





.color-palette-close:hover {
    transform: scale(1.2);
    color: #ffd700;
}

/* Corps du modal */
.color-palette-body {
    padding: 20px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Personnalisation de la barre de défilement */
.color-palette-body::-webkit-scrollbar {
    width: 8px;
}

.color-palette-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.color-palette-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.color-palette-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Grille des couleurs */
.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 10px;
}

.color-item {
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 3px solid transparent;
}

.color-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.color-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.color-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 8px;
    border: 2px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.color-item:hover .color-preview {
    transform: scale(1.1);
}

.color-name {
    font-weight: 600;
    color: var(--couleur-texte);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.color-value {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* Contrôles de couleur */
.color-controls {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.color-controls h4 {
    margin: 0 0 15px 0;
    color: var(--couleur-texte);
    text-align: center;
}

.color-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.color-input-group label {
    font-weight: 600;
    color: var(--couleur-texte);
    min-width: 80px;
}

.color-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.color-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.color-picker {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-picker:hover {
    transform: scale(1.1);
}

/* Boutons d'action */
.color-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.color-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 120px;
}

.color-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.color-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.color-btn-secondary {
    background: #6c757d;
    color: white;
}

.color-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.color-btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.color-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.color-btn-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
}

.color-btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.4);
}

/* Bouton reset individuel */
.individual-reset-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
    font-size: 0.85rem !important;
    padding: 10px 20px !important;
    min-width: 140px !important;
}

.individual-reset-btn:hover {
    background: linear-gradient(135deg, #ff5252, #d63031) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

/* Amélioration des boutons principaux */
.btn-main {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-main:hover::before {
    left: 100%;
}

.btn-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-main:active {
    transform: translateY(-1px);
}

.btn-main i {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Boutons avec couleurs personnalisées */
.btn-main[style*="background-color: var(--couleur-chaleureuse)"] {
    background: linear-gradient(135deg, #e29578, #d67b5a) !important;
    color: white !important;
}

.btn-main[style*="background-color: var(--couleur-chaleureuse)"]:hover {
    background: linear-gradient(135deg, #d67b5a, #c96b4a) !important;
    box-shadow: 0 8px 25px rgba(226, 149, 120, 0.4);
}

.btn-main[style*="background-color: var(--couleur-nature)"] {
    background: linear-gradient(135deg, #a3b18a, #8fa376) !important;
    color: white !important;
}

.btn-main[style*="background-color: var(--couleur-nature)"]:hover {
    background: linear-gradient(135deg, #8fa376, #7a8f62) !important;
    box-shadow: 0 8px 25px rgba(163, 177, 138, 0.4);
}

/* Animation pour les boutons en mode édition */
.editing-mode .btn-main {
    position: relative;
    animation: pulse 2s infinite;
}

.editing-mode .btn-main::after {
    content: '✏️';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    animation: bounce 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3); }
    100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-2px); }
}

/* Container pour les boutons avec bouton de lien */
.btn-container {
    position: relative;
    display: inline-block;
}

/* Bouton de modification de lien */
.btn-link-edit {
    position: absolute;
    right: -35px;
    top: 50%;
    transform: translateY(-50%);
    background: #007bff;
    border: none;
    border-radius: 50%;
    color: white;
    padding: 8px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-link-edit:hover {
    background: #0056b3;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* Les boutons de lien ne s'affichent QUE en mode édition */
.editing-mode .btn-link-edit {
    opacity: 1 !important;
    background: #dc3545 !important;
    display: flex !important;
}

/* Force l'affichage pour debug */
.btn-link-edit {
    display: none;
}

.editing-mode .btn-link-edit {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.editing-mode .btn-link-edit:hover {
    background: #c82333;
    transform: translateY(-50%) scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .color-palette-content {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .color-btn {
        padding: 10px 20px;
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .color-palette-content {
        width: auto;
        max-height: calc(100vh - 20px);
    }
    
    .color-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 5px;
    }
    
    .color-item {
        padding: 10px 6px;
    }
    
    .color-preview {
        width: 45px;
        height: 45px;
    }
    
    .color-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .color-input-group label {
        text-align: center;
    }
    
    .color-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .color-palette-body {
        padding: 15px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .color-palette-content {
        bottom: 5px;
        right: 5px;
        left: 5px;
        max-height: calc(100vh - 10px);
    }
    
    .color-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .color-item {
        padding: 8px 4px;
    }
    
    .color-preview {
        width: 40px;
        height: 40px;
    }
    
    .color-palette-body {
        padding: 12px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
    
    .color-palette-header h3 {
        font-size: 1.2rem;
    }
}

/* Animation de fermeture */
.color-palette-modal.closing .color-palette-content {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}






/* Masquer le scrollbar mais garder la fonctionnalité de défilement */
html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE et Edge */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Masquer les éléments d'édition invisibles en haut à droite */
[data-editable="true"][data-type="color"] {
    display: none !important;
}

body {
    font-family: 'Comic Neue', cursive, sans-serif;
    background-color: var(--couleur-fond);
    color: var(--couleur-texte);
    line-height: 1.6;
    overflow-x: hidden; /* Empêcher le défilement horizontal */
}

/* Navigation façon menu maison */
.navbar {
    background-color: var(--couleur-chaleureuse);
    border-bottom: 3px dotted var(--couleur-douce);
    font-size: 1.1rem;
}

.navbar-brand {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.8rem;
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.nav-link {
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 15px;
    margin: 0 3px;
}

.nav-link:hover {
    background-color: var(--couleur-douce);
    color: var(--couleur-texte) !important;
}

/* Bannière accueil */
.hero {
    background: linear-gradient(rgba(242, 215, 182, 0.664), rgba(242, 215, 182, 0.614));
    padding: 4rem 0;
    border-bottom: 8px double var(--couleur-chaleureuse);
}

.titre-principal {
    font-family: 'Patrick Hand', cursive;
    color: var(--couleur-texte);
    text-shadow: 2px 2px 0px var(--couleur-douce);
    font-size: 2.8rem;
}

/* Cartes chatons façon polaroids */
.kitten-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--couleur-douce);
}

.kitten-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.kitten-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.kitten-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.kitten-info {
    padding: 1.5rem;
}

.kitten-title {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.6rem;
    color: var(--couleur-chaleureuse);
    margin-bottom: 0.8rem;
}

.kitten-meta {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--couleur-texte);
}

.kitten-meta i {
    color: var(--couleur-nature);
    margin-right: 8px;
    width: 18px;
    text-align: center;
}

.btn-adopt {
    background: linear-gradient(135deg, var(--couleur-yeux), #5ab0c4);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-adopt:hover {
    background: linear-gradient(135deg, var(--couleur-nature), #8fa376);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.price-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--couleur-chaleureuse);
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.9rem;
}

/* Boutons faits main */
.btn-main {
    background-color: var(--couleur-chaleureuse);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.btn-main:hover {
    background-color: var(--couleur-douce);
    color: var(--couleur-texte);
    transform: translateY(-2px);
}

/* Section "Notre philosophie" */
.philosophie {
    background-color: white;
    border: 2px dashed var(--couleur-nature);
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
}

.philosophie:before {
    content: "❤";
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--couleur-fond);
    padding: 0 10px;
    color: var(--couleur-chaleureuse);
    font-size: 1.5rem;
}

/* Témoignages façon post-it */
.temoignage {
    background: #fef9c7;
    padding: 1.5rem;
    transform: rotate(-2deg);
    box-shadow: 5px 5px 7px rgba(0,0,0,0.1);
    position: relative;
    border-left: 4px solid var(--couleur-chaleureuse);
}

.temoignage:after {
    content: "";
    position: absolute;
    bottom: -15px;
    right: 10px;
    border-width: 15px 15px 0;
    border-style: solid;
    border-color: #fef9c7 transparent;
}

/* Pied de page cosy */
footer {
    background-color: var(--couleur-texte);
    color: var(--couleur-douce);
    padding: 2rem 0;
    text-align: center;
    border-top: 5px solid var(--couleur-chaleureuse);
}

.signature {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--couleur-douce);
}

/* Effet de pattes de chat */
.paw-print {
    position: absolute;
    opacity: 0.1;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .titre-principal {
        font-size: 2rem;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }
}