:root {
    /* Couleurs Principales */
    --bg-dark: #050505;
    --bg-card: #0F0F0F;
    
    /* Accents & Gradients */
    --brand-accent: #6366f1; /* Indigo */
    --brand-glow: #a855f7;   /* Purple */
    --brand-gradient: linear-gradient(135deg, var(--brand-accent), var(--brand-glow));
    
    /* États */
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    
    /* Textes */
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --text-dark: #1f2937;

    /* Transparences (Glassmorphism) */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-blur: 12px;
}

/* =========================================
   2. BASE & UTILITAIRES
   ========================================= */
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    /* Mesh Gradient de fond (optionnel si géré par Tailwind) */
    background-image: radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
                      radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
                      radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-attachment: fixed;
}

/* Panneau effet verre */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

        .glass-card {
            background: rgba(255, 255, 255, 0.03);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.05);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
/* Inputs sombres modernes */
.input-dark,
.custom-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transition: all 0.2s ease;
}

.input-dark:focus,
.custom-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--brand-accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* =========================================
   3. ANIMATIONS
   ========================================= */
.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-bounce-in {
    animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* =========================================
   4. COMPOSANTS : LISTES & DRAG DROP
   ========================================= */
/* Drag Handle */
.drag-handle { 
    cursor: grab; 
    color: var(--text-muted);
    transition: color 0.2s;
}
.drag-handle:hover { color: var(--text-main); }
.drag-handle:active { cursor: grabbing; }

/* Items de liste (Index.php) */
#link-container {
    position: relative;
    min-height: 100px; 
    margin-bottom: 50px;
}

.list-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px; 
    display: block;
    z-index: 1;
    list-style: none;
}

.list-item.is-dragging {
    z-index: 9999;

}

/* =========================================
   5. COMPOSANTS : ICÔNES SOCIALES
   ========================================= */
.icon-item {
    transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
}

.icon-item:hover {
    transform: translateY(-2px);
    background-color: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
}

.sortable-ghost {
    opacity: 0.4;
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed var(--brand-accent);
}

/* Badge Statut (Point vert/rouge) */
.status-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}
.status-dot.active { background-color: var(--color-success); color: var(--color-success); }
.status-dot.inactive { background-color: var(--color-danger); color: var(--color-danger); }

/* =========================================
   6. COMPOSANTS : MODALES
   ========================================= */
.modal {
    transition: opacity 0.3s ease;
}

.modal-content {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: #0F0F0F;
    border: 1px solid var(--glass-border);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal.hidden .modal-content {
    transform: scale(0.95) translateY(20px);
}

/* Toggle Switch (Checkbox) */
.toggle-checkbox {
    appearance: none;
    width: 3rem;
    height: 1.5rem;
    background: #374151;
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-checkbox:checked {
    background: var(--brand-accent);
}

.toggle-checkbox:checked::after {
    transform: translateX(1.5rem);
}

/* =========================================
   7. COMPOSANTS : NOTIFICATIONS (TOAST)
   ========================================= */
.status-message,
#notification {
    position: fixed;
    bottom: 20px;
    right: 20px; /* Ou centré selon la page */
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    z-index: 9999;
    animation: slideInToast 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Type Succès */
.status-message.success,
#notification:not(.error) {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-success);
}

/* Type Erreur */
.status-message.error,
#notification.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

@keyframes slideInToast {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================
   8. COMPOSANTS : APERÇU TÉLÉPHONE
   ========================================= */
.phone-preview {
    box-shadow: 0 0 0 8px #1f1f1f, 0 0 0 10px #333, 0 20px 50px rgba(0,0,0,0.5);
    transition: background 0.3s ease;
    border-radius: 2.5rem;
}

/* =========================================
   9. CUSTOM INPUTS (Color Picker, Range)
   ========================================= */
/* Range Slider */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--brand-accent);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Wrapper selecteur couleur */
.color-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: transform 0.2s;
}
.color-wrapper:hover { 
    transform: scale(1.1); 
    border-color: white; 
}
.color-wrapper input[type="color"] {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    padding: 0; margin: 0;
    border: none;
    cursor: pointer;
}

/* Onglets Mobile */
.tab-btn {
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
}
.tab-btn.active {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border-bottom: 2px solid var(--brand-accent);
}
/* =========================================
   10. BUTTON PREVIEW (USER STYLES BASE)
   ========================================= */
.preview-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s;
    user-select: none;
    text-decoration: none;
    /* Les styles dynamiques (couleur, radius) sont gérés par PHP/JS */
    border: 0 solid transparent;
    outline: none;
    overflow: hidden;
}

.preview-btn:active {
    transform: scale(0.98);
}


/* Styles globaux pour tous les selects */
select {
    background-color: #1f1f1f;   /* Fond sombre */
    color: #ffffff;              /* Texte blanc */
    border: 1px solid #444;      /* Bordure légèrement claire */
    padding: 0.75rem 1rem;       /* Ajuste le padding */
    border-radius: 1rem;         /* Coins arrondis */
    appearance: none;            /* Supprime le style natif du select */
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

/* Changement de fond et bordure au hover */
select:hover {
    background-color: #2a2a2a;
    border-color: #6366f1; /* couleur accent */
}

/* Changement de bordure au focus */
select:focus {
    outline: none;
    border-color: #a855f7;  /* couleur glow */
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Option sélectionnée (s'assure que texte est visible) */
select option {
    background-color: #1f1f1f;
    color: #ffffff;
}

/* Option hover dans le menu déroulant */
select option:hover {
    background-color: #2a2a2a;
}





/* Contour animé */
.item-content::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid rgba(99, 102, 241, 0.0);
    transition: 
        inset 0.25s ease,
        border-color 0.25s ease;
    pointer-events: none;
}

/* État actif (drag / hover / focus) */
.list-item.is-dragging .item-content::before {
    inset: -3px; /* ➜ le contour grandit */
    border-color: rgba(99, 102, 241, 0.8);
}


/* Style de base pour toutes les alertes */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(8px);
    border: 1px solid transparent;
    animation: fadeInDown 0.5s ease-out;
}

/* Alerte Succès (Vert/Émeraude) */
.alert-success {
    background: rgba(16, 185, 129, 0.1); /* Vert très transparent */
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399; /* Texte émeraude clair */
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.05);
}

/* Alerte Erreur (Rouge/Rose) */
.alert-error {
    background: rgba(239, 68, 68, 0.1); /* Rouge très transparent */
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171; /* Texte rouge clair */
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.05);
}

/* Animation d'apparition */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour le texte en gras dans l'alerte */
.alert strong {
    color: inherit;
    font-weight: 700;
}