/**
 * Styles pour le sélecteur d'icône ACF
 */

/* Wrapper pour le label et le bouton */
.acf-icon-picker-label-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 4px;
  gap: 10px;
  margin-bottom: 5px;
}

/* Wrapper secondaire pour la preview et le label */
.acf-icon-picker-preview-label-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.acf-icon-picker-preview-label-wrapper .acf-label {
  margin: 0px !important;
}

/* Preview de l'icône devant le label */
.acf-icon-picker-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.acf-icon-picker-preview i {
  font-size: 20px;
  width: 20px;
  height: 20px;
  line-height: 20px;
  display: inline-block;
}

.acf-icon-picker-preview i.dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  line-height: 20px;
}

/* Bouton d'icône dans les champs */
.acf-icon-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: #2271b1;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.acf-icon-picker-button:hover {
  background: #135e96;
}

.acf-icon-picker-button .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 1;
}

/* Modale de sélection d'icône */
#acf-icon-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
}

.acf-icon-picker-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.acf-icon-picker-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  z-index: 100001;
}

.acf-icon-picker-modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.acf-icon-picker-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.acf-icon-picker-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acf-icon-picker-modal-close:hover {
  color: #000;
}

.acf-icon-picker-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Tabs */
.acf-icon-picker-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.acf-icon-picker-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  transition: all 0.2s;
}

.acf-icon-picker-tab:hover {
  color: #2271b1;
}

.acf-icon-picker-tab.active {
  color: #2271b1;
  border-bottom-color: #2271b1;
  font-weight: 600;
}

/* Color picker */
.acf-icon-picker-color {
  margin-bottom: 15px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
}

.acf-icon-picker-color label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

.acf-icon-picker-color-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.acf-icon-picker-color-wrapper input[type="color"] {
  width: 50px;
  height: 35px;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  padding: 2px;
  background: #fff;
}

.acf-icon-picker-color-wrapper input[type="text"] {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  font-family: monospace;
}

.acf-icon-picker-color-wrapper input[type="text"]:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

.acf-icon-picker-search {
  margin-bottom: 15px;
}

.acf-icon-picker-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 14px;
}

.acf-icon-picker-search input:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

/* Grille d'icônes */
.acf-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.acf-icon-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.acf-icon-picker-item:hover {
  background: #f0f0f1;
  border-color: #2271b1;
}

.acf-icon-picker-item i,
.acf-icon-picker-item svg {
  font-size: 24px;
  margin-bottom: 8px;
  color: #2271b1;
  display: block;
  width: 24px;
  height: 24px;
}

.acf-icon-picker-item i.dashicons {
  font-size: 24px;
  width: 24px;
  height: 24px;
  line-height: 24px;
}

.acf-icon-picker-item svg.kadence-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
}

.acf-icon-picker-item span {
  font-size: 11px;
  color: #666;
  word-break: break-word;
}

/* Responsive */
@media (max-width: 768px) {
  .acf-icon-picker-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .acf-icon-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}
