/* Style automatique pour tous les champs Django */
form input[type="text"],
form input[type="email"], 
form input[type="password"],
form input[type="number"],
form input[type="tel"],
form input[type="url"],
form textarea,
form select {
    width: 100%!important;
    padding: 1rem 1.25rem!important;
    border-radius: 1rem!important; /* rounded-2xl */
    border: 1px solid rgba(148, 163, 184, 0.3)!important; /* border-slate-400/30 */
    background: rgba(255, 255, 255, 0.1)!important; /* bg-white/10 */
    backdrop-filter: blur(4px)!important;
    transition: all 0.3s ease-in-out!important;
    color: rgb(248, 250, 252)!important; /* text-slate-50 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)!important;
}

form input[type="text"]::placeholder,
form input[type="email"]::placeholder, 
form input[type="password"]::placeholder,
form textarea::placeholder {
    color: rgb(148, 163, 184); /* text-slate-400 */
}

/* Focus state pour tous les champs */
form input[type="text"]:focus,
form input[type="email"]:focus, 
form input[type="password"]:focus,
form input[type="number"]:focus,
form input[type="tel"]:focus,
form input[type="url"]:focus,
form textarea:focus,
form select:focus {
    outline: none!important;
    border-color: rgba(249, 115, 22, 0.6)!important; /* border-orange-500/60 */
    background: rgba(255, 255, 255, 0.15)!important; /* bg-white/15 */
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1)!important;
    transform: translateY(-1px)!important;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(30, 41, 59, 0.5); /* bg-slate-800/50 */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(71, 85, 105, 0.5); /* border-slate-700/50 */
    border-radius: 1.5rem; /* rounded-3xl */
    padding: 2rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    transition: all 0.3s ease-in-out;
}

form:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* shadow-xl */
    transform: translateY(-2px);
}

form p {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

form label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgb(248, 250, 252); /* text-slate-50 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.form-field {
    width: 100%!important;
    padding: 1rem 1.25rem!important;
    border-radius: 1rem!important; /* rounded-2xl */
    border: 1px solid rgba(148, 163, 184, 0.3)!important; /* border-slate-400/30 */
    background: rgba(255, 255, 255, 0.1)!important; /* bg-white/10 */
    backdrop-filter: blur(4px)!important;
    transition: all 0.3s ease-in-out!important;
    color: rgb(248, 250, 252)!important; /* text-slate-50 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)!important;
}

.form-field::placeholder {
    color: rgb(148, 163, 184); /* text-slate-400 */
}

/* Focus state */
.form-field:focus {
    outline: none!important;
    border-color: rgba(249, 115, 22, 0.6)!important; /* border-orange-500/60 */
    background: rgba(255, 255, 255, 0.15)!important; /* bg-white/15 */
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1)!important;
    transform: translateY(-1px)!important;
}

/* Error state */
.form-field.error {
    border-color: rgba(239, 68, 68, 0.6)!important; /* border-red-500/60 */
    background: rgba(239, 68, 68, 0.05)!important; /* bg-red-500/5 */
}

/* Success state */
.form-field.success {
    border-color: rgba(34, 197, 94, 0.6)!important; /* border-green-500/60 */
    background: rgba(34, 197, 94, 0.05)!important; /* bg-green-500/5 */
}

/* Check Box */
.form-field.form-checkbox {
    width: 28px!important;
    height: 28px!important;
    padding: 0!important;
    background: rgba(255, 255, 255, 0.1)!important;
    border: 1px solid rgba(148, 163, 184, 0.3)!important;
    position: relative;
    appearance: none;
    cursor: pointer;
}

.form-field.form-checkbox:checked {
    background: linear-gradient(135deg, #f97316, #ea580c)!important; /* gradient orange */
    border-color: rgba(249, 115, 22, 0.6)!important;
}

.form-field.form-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Styliser le champ de fichier */
form input[type="file"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 1rem; /* rounded-2xl */
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    color: rgb(248, 250, 252);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

form input[type="file"]:hover {
    border-color: rgba(249, 115, 22, 0.4);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

form input[type="file"]:focus {
    outline: none;
    border-color: rgba(249, 115, 22, 0.6);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Si tu veux cacher l'input natif et créer un bouton personnalisé */
form #file-upload-button {
    display: none!important;
}

/* Style pour un bouton personnalisé */
form .custom-file-upload {
    display: inline-block;
    padding: 1rem 2rem;
    cursor: pointer;
    background: linear-gradient(135deg, #f97316, #ea580c); /* gradient orange */
    color: white;
    border-radius: 1rem; /* rounded-2xl */
    border: none;
    transition: all 0.3s ease-in-out;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.3), 0 4px 6px -2px rgba(249, 115, 22, 0.1);
    backdrop-filter: blur(8px);
}

form .custom-file-upload:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(249, 115, 22, 0.4);
}

/* Form validation */
form ul.errorlist {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #fca5a5; /* text-red-300 */
    background: rgba(239, 68, 68, 0.1); /* bg-red-500/10 */
    backdrop-filter: blur(4px);
    padding: 1rem 1.5rem;
    border-radius: 1rem; /* rounded-2xl */
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
}


/* Checkboxes multiples personnalisées */

/* Conteneur principal des checkboxes */
#id_categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: fit-content;
    transition: height 0.3s ease-in-out;
    
    /* Retirer la bordure du conteneur */
    background: none!important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Chaque ligne de checkbox */
#id_categories > div {
    position: relative;
}

/* Labels des checkboxes */
#id_categories label {
    display: block;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.3); /* border-slate-400/30 */
    border-radius: 1rem; /* rounded-2xl */
    background: rgba(255, 255, 255, 0.1); /* bg-white/10 */
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgb(248, 250, 252); /* text-slate-50 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Effet hover sur les labels */
#id_categories label:hover {
    border-color: rgba(249, 115, 22, 0.4); /* border-orange-500/40 */
    background: rgba(255, 255, 255, 0.15); /* bg-white/15 */
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.15);
}

/* Cacher les checkboxes natives */
#id_categories input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Animation de sélection - icône */
#id_categories label::after {
    content: '✓';
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 16px;
    font-weight: bold;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease-in-out;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Classe pour afficher l'icône quand sélectionné */
#id_categories label.selected {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.2))!important;
    border-color: rgba(249, 115, 22, 0.6)!important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1)!important;
}

#id_categories label.selected::after {
    opacity: 1;
    transform: scale(1);
}

/* ================================
   RESPONSIVE DESIGN - MOBILE
   ================================ */

/* Tablettes et petits écrans */
@media (max-width: 768px) {
    /* Formulaires */
    form {
        padding: 1.5rem!important;
        gap: 1.25rem!important;
        border-radius: 1.25rem!important; /* rounded-2xl */
        margin: 1rem!important;
    }

    /* Champs de formulaire */
    form input[type="text"],
    form input[type="email"], 
    form input[type="password"],
    form input[type="number"],
    form input[type="tel"],
    form input[type="url"],
    form textarea,
    form select,
    .form-field {
        padding: 0.875rem 1rem!important;
        border-radius: 0.75rem!important; /* rounded-xl */
        font-size: 1rem!important;
    }

    /* Labels */
    form label {
        font-size: 0.875rem!important;
    }

    /* Grid des checkboxes */
    #id_categories {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr))!important;
        gap: 0.5rem!important;
    }

    #id_categories label {
        padding: 0.75rem 1rem!important;
        font-size: 0.875rem!important;
        border-radius: 0.75rem!important; /* rounded-xl */
    }

    #id_categories label::after {
        top: 0.625rem!important;
        right: 0.75rem!important;
        font-size: 14px!important;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    /* Formulaires encore plus compacts */
    form {
        padding: 1rem!important;
        gap: 1rem!important;
        border-radius: 1rem!important; /* rounded-xl */
        margin: 0.5rem!important;
    }

    /* Champs de formulaire */
    form input[type="text"],
    form input[type="email"], 
    form input[type="password"],
    form input[type="number"],
    form input[type="tel"],
    form input[type="url"],
    form textarea,
    form select,
    .form-field {
        padding: 0.75rem 0.875rem!important;
        border-radius: 0.625rem!important; /* rounded-lg */
        font-size: 1rem!important;
    }

    /* Labels plus petits */
    form label {
        font-size: 0.8125rem!important;
    }

    /* Grid des checkboxes en colonne unique */
    #id_categories {
        grid-template-columns: 1fr!important;
        gap: 0.375rem!important;
    }

    #id_categories label {
        padding: 0.625rem 0.875rem!important;
        font-size: 0.8125rem!important;
        border-radius: 0.625rem!important; /* rounded-lg */
    }

    #id_categories label::after {
        top: 0.5rem!important;
        right: 0.625rem!important;
        font-size: 12px!important;
    }

    /* Boutons personnalisés plus compacts */
    form .custom-file-upload {
        padding: 0.75rem 1.5rem!important;
        font-size: 0.875rem!important;
        border-radius: 0.75rem!important;
    }

    /* Messages d'erreur plus compacts */
    form ul.errorlist {
        padding: 0.75rem 1rem!important;
        border-radius: 0.75rem!important;
        font-size: 0.8125rem!important;
    }
}

/* Très petits écrans (téléphones en mode portrait) */
@media (max-width: 360px) {
    form {
        padding: 0.75rem!important;
        gap: 0.875rem!important;
        margin: 0.25rem!important;
    }

    form input[type="text"],
    form input[type="email"], 
    form input[type="password"],
    form input[type="number"],
    form input[type="tel"],
    form input[type="url"],
    form textarea,
    form select,
    .form-field {
        padding: 0.625rem 0.75rem!important;
        font-size: 0.9375rem!important;
    }

    form label {
        font-size: 0.75rem!important;
    }
}

/* ================================
   FORCE STYLE POUR INPUT DE RECHERCHE BLOG
   ================================ */

#blog-search {
    width: 100%!important;
    padding-left: 1rem!important;
    padding-right: 3rem!important;
    padding-top: 1rem!important;
    padding-bottom: 1rem!important;
    border-radius: 1rem!important;
    border: 1px solid rgba(71, 85, 105, 0.5)!important;
    background: rgba(30, 41, 59, 0.5)!important;
    backdrop-filter: blur(4px)!important;
    transition: all 0.3s ease-in-out!important;
    color: rgb(248, 250, 252)!important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)!important;
    font-size: 1rem!important;
    line-height: 1.5!important;
}

#blog-search::placeholder {
    color: rgb(148, 163, 184)!important;
    font-size: 1rem!important;
}

#blog-search:focus {
    outline: none!important;
    border-color: rgba(6, 182, 212, 0.6)!important;
    background: rgba(30, 41, 59, 0.7)!important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1)!important;
    transform: translateY(-1px)!important;
}

/* ================================
   STYLE DARK MODE POUR SELECTS
   ================================ */

/* Style des selects */
form select {
    background-color: rgb(30, 41, 59)!important; /* bg-slate-800 */
    color: rgb(248, 250, 252)!important; /* text-slate-50 */
    border: 1px solid rgba(71, 85, 105, 0.5)!important; /* border-slate-600/50 */
}

/* Style des options dans les selects */
form select option {
    background-color: rgb(30, 41, 59)!important; /* bg-slate-800 */
    color: rgb(248, 250, 252)!important; /* text-slate-50 */
    padding: 0.75rem 1rem!important;
}

/* Style hover pour les options */
form select option:hover,
form select option:focus,
form select option:checked {
    background-color: rgb(51, 65, 85)!important; /* bg-slate-700 */
    color: rgb(248, 250, 252)!important; /* text-slate-50 */
}

/* Style au focus des selects */
form select:focus {
    background-color: rgb(51, 65, 85)!important; /* bg-slate-700 */
    border-color: rgba(6, 182, 212, 0.6)!important; /* border-cyan-500/60 */
}

/* Style pour les selects avec des classes spécifiques */
.select-category,
.select-sort {
    background-color: rgb(30, 41, 59)!important; /* bg-slate-800 */
    color: rgb(248, 250, 252)!important; /* text-slate-50 */
    border: 1px solid rgba(71, 85, 105, 0.5)!important; /* border-slate-600/50 */
}

.select-category option,
.select-sort option {
    background-color: rgb(30, 41, 59)!important; /* bg-slate-800 */
    color: rgb(248, 250, 252)!important; /* text-slate-50 */
}



